It’s not very clear what you want to do, please precise what are “pSurface” and? “m_pSurface”.
By the way, I’m not sure but the RGB masks don’t seem to be correct …
Personnally I’ve never cared about those masks and simply set:
Surface = SDL_CreateRGBSurface(SDL_SWSURFACE, rect.w, rect.h, 32, 0, 0, 0, 0);
Instead. Did you try it ?
I may be wrong (yet it works), can someone explain what’s the use of those rmask, gmask, bmask, amask ?
— En date de?: Mer 20.5.09, jyoti a ?crit? jyoti
Objet: [SDL] SDL SURFACE QUERY
?: sdl at libsdl.org
Date: Mercredi 20 Mai 2009, 10h37
I m new to sdl. I m trying sum basic things like I wish to make a surface on a
bigger surface and change the color of the smaller surface to red.
I used following code for smaller surface:
Surface = SDL_CreateRGBSurface(SDL_SWSURFACE, rect.w, rect.h,
SDL_FillRect(Surface, NULL, SDL_MapRGB(m_pSurface->format, 255, 0,0));
but the color is not getting set. pls help.
SDL mailing list
SDL at lists.libsdl.org