I don’t know how to clear the screen in SDL after rendering an image.
In an OpenGL scene (which I don’t intend to use in this case) you use glClear(blah); or glClearColor(blah);
How do I do this with SDL?
Winner of the 2003 Internet Service Providers’ Association awards for Best Unmetered ISP and Best Consumer Application.
SDL_FillRect(SDL_GetVideoSurface(), NULL,
SDL_MapRGB(SDL_GetVideoSurface()->format, 0,0,0));On Wednesday 25 June 2003 08:40, gpa at fsmail.net wrote:
I don’t know how to clear the screen in SDL after rendering an image.
In an OpenGL scene (which I don’t intend to use in this case) you use
glClear(blah); or glClearColor(blah);
How do I do this with SDL?
–
Eduardo B. Fonseca
ebf at aedsolucoes.com.br
OpenPGP Public Key: F5206326
Hey! “SDL_GetVideoSurface()”… that’s a neat trick!
I don’t think I had ever noticed that one before.
-bill!
(wondering if he needs an evil global variable (“SDL_Surface * screen;”)
any more
)On Wed, Jun 25, 2003 at 11:15:15AM -0300, Eduardo B. Fonseca wrote:
SDL_FillRect(SDL_GetVideoSurface(), NULL,
SDL_MapRGB(SDL_GetVideoSurface()->format, 0,0,0));
–
bill at newbreedsoftware.com Got kids? Get Tux Paint!
http://newbreedsoftware.com/bill/ http://newbreedsoftware.com/tuxpaint/
Eduardo B. Fonseca wrote:> On Wednesday 25 June 2003 08:40, gpa at fsmail.net wrote:
I don’t know how to clear the screen in SDL after rendering an image.
In an OpenGL scene (which I don’t intend to use in this case) you use
glClear(blah); or glClearColor(blah);
How do I do this with SDL?
SDL_FillRect(SDL_GetVideoSurface(), NULL,
SDL_MapRGB(SDL_GetVideoSurface()->format, 0,0,0));
I was just wondering, if we use 16 or 24bit display, is it always the
same as:
SDL_FillRect(SDL_GetVideoSurface(), NULL, 0);
???
–
Milan Babuskov
http://njam.sourceforge.net
Eduardo B. Fonseca wrote:
I don’t know how to clear the screen in SDL after rendering an image.
How do I do this with SDL?
SDL_FillRect(SDL_GetVideoSurface(), NULL,
SDL_MapRGB(SDL_GetVideoSurface()->format, 0,0,0));
If you want to clear the screen to pure black, the fastest way is
probably using just zero as the color. I’ve used this in my games
without any problems, but correct me if I’m wrong =)
Of course this won’t work in 8bit mode if the color index 0 is not black
but it should work in higher color depths.
Like this: SDL_FillRect(screen, NULL, 0);–
Mika Halttunen
@Mika_Halttunen