Error messge about a locked surface when blitting

i made an image in the gimp, and saved it as a bitmap file.
i wrote the following functions:

main
show_loading_screen
load_bitmap -> used to load a bitmap ( SDL_LoadBMP( filename ), and
error handling )
show_bitmap -> used to blit images ( SDL_BlitSurface(), and error
handling )

two strange things happen when trying to blit the loading screen:

  • the width and height retreived from the surface in show_bitmap() (
    surface->w and surface->h ) are verry odd. they are supposed to be 800 and
    600, but the actual data retreived gets in the tens of thousands.
  • i get an error message from show_bitmap() telling me a surface must not be
    locket for blitting. but i didn’t lock it!

does anyone recognise this?–
Sijmen

i made an image in the gimp, and saved it as a bitmap file.
i wrote the following functions:

main
show_loading_screen
load_bitmap -> used to load a bitmap ( SDL_LoadBMP( filename ), and
error handling )
show_bitmap -> used to blit images ( SDL_BlitSurface(), and error
handling )

two strange things happen when trying to blit the loading screen:

  • the width and height retreived from the surface in show_bitmap() (
    surface->w and surface->h ) are verry odd. they are supposed to be 800 and
    600, but the actual data retreived gets in the tens of thousands.
  • i get an error message from show_bitmap() telling me a surface must not be
    locket for blitting. but i didn’t lock it!

does anyone recognise this?

This looks like you have structure packing set for the code including
SDL.h - is there a #pragma pack or anything in headers you’re including?

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

This looks like you have structure packing set for the code including
SDL.h - is there a #pragma pack or anything in headers you’re including?

well, actually, my pc has just crashed
isn’t able to boot at all
means i can’t try to check it out
but could it has anything to do with the fact that i’m running rh8?