SDL framework - Problem loading image.

Discussion in 'Mac Programming' started by mlopres, Jan 19, 2010.

  1. mlopres macrumors newbie

    Joined:
    Jan 12, 2010
    #1
    So I'm using SDL to access the OpenGL framework and im developing on a MAC of course.

    For those familiar with SDL, i'm using the SDL_loadBMP() function to load in a image file from the hardrive. The problem I'm having is as soon as the program reaches this line of code, the program shuts down, and I get no information in the XCODE Debugger Console. Except some copywright information about GBD being free software, etc etc. Then the console returns control to me with a command prompt "(gdb)". I get no return code from the application, and none of my debug information is showing up.

    I know the app is dying right at the SDL_loadBMP() part, because when I comment out this section, or if I remove my "image.bmp" the program functions as normal. it seem to be an issue with just the actually loading of the file, not whether or not the file even exists.
     
  2. holmesf macrumors 6502a

    Joined:
    Sep 30, 2001
    #2
    It's entirely possible that SDL is not loading the .bmp correctly. I've experienced this in the past ... sometimes bitmap files store their height as negative in order to flip themselves vertically, but this can confuse SDL (as one example). My advice is trying to save the .bmp using a different program (which will perhaps format the .bmp correctly), or switching to use SDL_Image (which may use different code to load .bmp files).
     

Share This Page