Why does this code not work

Hi folks,

i have one simple question

WHY does this code not work?

if i declare “sdl_surface* screen” as a global variable it works
fine, but as i want to use it as a parameter for the whole bunch of
funktions, it didn’t work

i can compile the code without errors,

but the application works only till “77”

anyone knows why?

may be its on the SDL_DisplayFormat();???

ps: i just startet programming with sdl and BeOS 5.01

-------------- next part --------------
A non-text attachment was scrubbed…
Name: main.c
Type: application/octet-stream
Size: 6367 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20000821/b4bc0ef6/attachment.obj

Your function:
void InitSDL( const char* wm_title, SDL_Surface* screen )
changes “screen” inside the function itself,
then you main function do not get a changed variable “screen” back,
but only the same. (int RunThisFuck() do not get a changed “screen”)

To solve this changes your function:
void InitSDL( const char* wm_title, SDL_Surface** screen )
and call it with:
InitSDL( “Smilewars0001”, &screen );

Check for other errors like that.

To smile or not to smile, this is the question…
Luc-Olivier