[SDL] SDL_Setvideomode

David Olofson david at olofson.net
Wed Nov 16 07:21:48 PST 2005

On Wednesday 16 November 2005 11.50, Steve King (dev) wrote:
> Hi,
> I have an SDL program that works wonderfully but at startup after
> calling SDL_Setvideomode I get a blank screen before I draw anything
> to it, how can this be avoided, is it possible to draw before this
> call?

Well, you can (*) create a s/w surface and prepare some stuff in it, 
but you still have to blit that to the display surface *after* 
creating it with SDL_SetVideoMode()... Might cut down the time the 
user has to look at a blank screen/window, but unless what takes time 
is actually your rendering, it won't make much of a difference, 

What platform and target is this on?

I haven't really reflected over it, as my SDL applications usually 
start full screen, and/or "boot" with a black screen anyway. On this 
machine (AMD64 3400+, Gentoo/AMD64, Xorg 6.8.2, some factory 
overclocked 512 MB 6800 Ultra, nVidia OpenGL driver 71.74), I can 
hardly see any delay in SDL applications, unless they're doing some 
serious work before rendering the first frame.

What does annoy me a bit is that windows flicker hysterically whan you 
resize them, as they're completely blacked out whenever you resize 
the SDL display surface. (Ok; so resizable windows, and basically 
anything not full screen, is almost beyond the scope of SDL, and this 
is no showstopper issue, but anyway...)

(*) This is, AFAIK, not officially supported, and may not even
    work on some platforms. I've used SDL without a display
    surface for simple image processing tools without problems
    on Linux, but I'm not sure it's a good idea to do it in
    production code...

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
|  Free/Open Source audio engine for games and multimedia.  |
| MIDI, modular synthesis, real time effects, scripting,... |
`-----------------------------------> http://audiality.org -'
   --- http://olofson.net --- http://www.reologica.se ---

More information about the SDL mailing list