SDL_Setvideomode

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?

Thanks for any help.

Regards
Steve

you could draw to a memory buffer ( a surface you create yourself) and
then blit this to the main surface when you create it or you could
delay SDL_SetVideoMode until you are going to draw.On 11/16/05, Steve King (dev) <steve.king at ecmsys.co.uk> 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?

Thanks for any help.

Regards
Steve


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

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,
obviously.

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.nethttp://www.reologica.se —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?