How to prevent initial white window contents

Hi,

when opening an SDL window for the first time its background is completely white.
My game, however, starts with a black background so there is a brief yet noticeable
change from a white to black background at my game’s startup. This might sound like
nitpicking but for aesthetic reasons I’d prefer to avoid this change, i.e. I’d like
SDL to open a black window instead of white. So is there a way to customize the initial
window background? Ideally, I’d like to be able to provide a surface/DIB that SDL uses
to initialize its window background… is that possible is there no way around the
default white?–
Best regards,
Andreas Falkenhahn mailto:@Andreas_Falkenhahn

Try rendering something to it before calling SDL_ShowWindow, I never
had any “default” color show up in my game, either on Windows or
Linux.

You could create your window with the SDL_WINDOW_HIDDEN flag,
set your black background and then SDL_ShowWindow

Le 15/08/2014 13:32, Andreas Falkenhahn a ?crit :> Hi,

when opening an SDL window for the first time its background is completely white.
My game, however, starts with a black background so there is a brief yet noticeable
change from a white to black background at my game’s startup. This might sound like
nitpicking but for aesthetic reasons I’d prefer to avoid this change, i.e. I’d like
SDL to open a black window instead of white. So is there a way to customize the initial
window background? Ideally, I’d like to be able to provide a surface/DIB that SDL uses
to initialize its window background… is that possible is there no way around the
default white?

Thanks, this seems to do the trick.On 15.08.2014 at 13:55 Sanette wrote:

You could create your window with the SDL_WINDOW_HIDDEN flag,
set your black background and then SDL_ShowWindow

Le 15/08/2014 13:32, Andreas Falkenhahn a ?crit :

Hi,

when opening an SDL window for the first time its background is completely white.
My game, however, starts with a black background so there is a brief yet noticeable
change from a white to black background at my game’s startup. This might sound like
nitpicking but for aesthetic reasons I’d prefer to avoid this change, i.e. I’d like
SDL to open a black window instead of white. So is there a way to customize the initial
window background? Ideally, I’d like to be able to provide a surface/DIB that SDL uses
to initialize its window background… is that possible is there no way around the
default white?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Best regards,
Andreas Falkenhahn mailto:@Andreas_Falkenhahn