[SDL] Re: [SDL]: Create a surface and fill it with a white color
Daniel Lännström
danne_89 at home.se
Wed Feb 11 07:46:08 PST 2004
On Tue, Feb 10, 2004 at 06:10:57PM +0000, James Gregory wrote:
> On Tue, 10 Feb 2004 17:48:26 +0100, Daniel Lännström wrote:
>
> > On Mon, Feb 09, 2004 at 07:30:33PM +0000, James Gregory wrote:
> >> On Mon, 09 Feb 2004 19:53:42 +0100, Daniel Lännström wrote:
> >>
> >> > Hello fellows!
> >> > I want to create and fill a surface with a white color. A use this code:
> >> >
> >> > mBackgrund = SDL_CreateRGBSurface(SDL_HWSURFACE, 640, 480, 8, 0, 0, 0, 0);
> >> > Uint32 color = SDL_MapRGB(mBakgrund->format, 255, 255 ,255);
> >> > SDL_FillRect(mBakgrund, 0, color);
> >>
> >> Is mBackgrund supposed to be the screen? The screen is a special sort of
> >> surface which you create with SDL_SetVideoMode, not with a normal create
> >> surface function.
> >>
> >> James
> >
> > No, mBackgrund is just a ordinary surface.
>
> In what way does it not work?
>
> After doing the above, do you then blit mBackgrund to the screen?
>
> James
Yep I do, but I got a black color.
More information about the SDL
mailing list