Fastest way to clear the screen

Hi!
What is the fastest way to clear a surface e.g the screen?

–Anders Folkesson

Hi!
What is the fastest way to clear a surface e.g the screen?

There may be a faster way, but I think SDL_FillRect will do the trick.

That’s how I clear the screen anyway. If there’s a faster way, I’d like to
know about it.

Although I don’t know if it’s good practice, if you pass the dstrect as a nil
value, It will fill the whole surface. I don’t know if that’s faster though.

Hope this helps

JasonOn Saturday 08 June 2002 1:49 pm, anders wrote:

–Anders Folkesson


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hi!
What is the fastest way to clear a surface e.g the screen?

SDL_FillRect() Does the trick.

Mike S. Codename: Freak901010_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com

Hi!
What is the fastest way to clear a surface e.g the screen?

There may be a faster way, but I think SDL_FillRect will do the trick.

That’s how I clear the screen anyway. If there’s a faster way, I’d like to
know about it.

Although I don’t know if it’s good practice, if you pass the dstrect as a nil
value, It will fill the whole surface. I don’t know if that’s faster though.

if you’re using OpenGL, then glClear(GL_COLOR_BUFFER_BIT) is supposed to
be faster. i seem to remember reading that some graphics cards are
optimised for setting large chunks of memory with a constant value. if
you’re using a good OpenGL implementation and your hardware supports
this kind of feature, then this should be the fastest way of doing this.

have a look here, on page 31 (Chapter 2, A Drawing survival kit,
Clearing the Window):
http://www.gamedev.net/download/redbook.pdf

i don’t know… i thought it might help

billOn Sat, 8 Jun 2002, Jason Farmer wrote:

On Saturday 08 June 2002 1:49 pm, anders wrote: