SDL_SetColorKey Question & error

Hello.

SDL_SetColorKey(Const, SDL_SRCCOLORKEY, SDL_MapRGB(Main::MainControl.SurfScreen->format, 255, 255, 255));

Process terminated with status 3 (0 minutes, 0 seconds).
Error is at this point in file. From my experience i know that status 3 in SDL is cause NULL Pointer.
Error may be at Main::MainControl.SurfScreen-format… MainControl is a public static class object… SurfScreen = SDL_SetVideoMode(Screen_Width, Screen_Height, Screen_BPP, SDL_HWSURFACE | SDL_DOUBLEBUF);
I know the 1st argument in SDL_MapRGB requires Pixel format but what em i suposed to pass? that i dont understand
i use my images at “32bit” without alpha all “.png” format.
Ani help is appreciated.

Hello,

Your SDL_MapRGB seems fine.
I take that “MainControl.SurfScreen” is properly initialzed.
What about this oddly named “Const” parameter ? Is it a valid SDL_Surface ?

Clement.

Hello,

Your SDL_MapRGB seems fine.
I take that “MainControl.SurfScreen” is properly initialzed.
What about this oddly named “Const” parameter ? Is it a valid SDL_Surface ?

Clement.

oh it has bean long time.
Basically my problem is, that i am grabbing value from incorrect position.