Thread: Images

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    4

    Images

    I am fimiliar with graphics and imaging in C, although specificly on the Sony PSP. I do homebrew programming, and i wanted to look into 2D gfx in c. I am running Mac OS X and using XCODE. If you can help me out, i will appreciate it very much.

    thank you.

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    You'll need to use a graphics library; perhaps the SDL. http://libsdl.org/

    Also see this SDL tutorial for Max OS X: http://www.meandmark.com/sdlopenglpart1.html

    Graphics programming is pretty complicated, though; don't try it if you haven't been programming for very long.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    Registered User
    Join Date
    Jan 2007
    Posts
    4
    is it really all that different.

    on the psp you just include the "graphics.h", "framebuffer.h" , "png.h" and "pspgu.h" headers and to initialize the gfx you call "initGraphics()"

    then you load the image by pointing to the struct Image.

    Code:
    Image* img = loadImage("./directory/image.png");
    then you blit the image w/ one of two functions..

    Code:
    blitAlphaImageToScreen(0, 0, width, height, imgsrc, x, y);
    or 
    blitImageToScreen(width, height, imgsrc, x, y);
    then you have to flip the buffer to dislplay the images.

    Code:
    flipScreen();
    i am just saying this because this is what i am used to and i want to know wat i am getting into here . Thanks again.

  4. #4
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    Those functions are part of a graphics library for the PSP. If you want to write graphics applications for a PC, you need to use a graphics library available for your platform (windows, linux, etc...). Libraries like SDL have functions which are analagous to the ones you've mentioned. Libraries like OpenGL are strictly rendering libraries, and don't have built-in support for things like images.

  5. #5
    Registered User
    Join Date
    Jan 2007
    Posts
    4
    so the SDL is my best choice, eh?

    thank you. im gonna go read some tutorials today

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Images
    By _Nate_ in forum C Programming
    Replies: 4
    Last Post: 05-18-2008, 10:50 PM
  2. Images
    By gvector1 in forum C++ Programming
    Replies: 7
    Last Post: 02-25-2003, 09:59 AM
  3. images, icons, and cursors, OH MY!
    By DarkViper in forum Windows Programming
    Replies: 3
    Last Post: 01-07-2003, 02:26 PM
  4. STL, Queues And Images
    By simly01 in forum C++ Programming
    Replies: 3
    Last Post: 06-24-2002, 12:31 PM
  5. A simple question on Images....
    By LonelyPlanetWa in forum C Programming
    Replies: 7
    Last Post: 05-20-2002, 07:34 AM