The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
How to prevent initial white window contents
Andreas Falkenhahn
Guest

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:

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
How to prevent initial white window contents
Sik


Joined: 26 Nov 2011
Posts: 905
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.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
How to prevent initial white window contents
Sanette
Guest

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 :
Quote:
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

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
How to prevent initial white window contents
Andreas Falkenhahn
Guest

Thanks, this seems to do the trick.

On 15.08.2014 at 13:55 Sanette wrote:

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


Quote:
Le 15/08/2014 13:32, Andreas Falkenhahn a écrit :
Quote:
Hi,

Quote:
Quote:
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?


Quote:
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org



--
Best regards,
Andreas Falkenhahn mailto:

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org