The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL_SetColorKey Question & error
tw3tye


Joined: 22 Jan 2012
Posts: 18
Hello.
Code:

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.
c1702


Joined: 24 Apr 2012
Posts: 3
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 ?

Clément.
tw3tye


Joined: 22 Jan 2012
Posts: 18
c1702 wrote:
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 ?

Clément.


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