Resizing Window Causes Flicker

In Battle for Wesnoth, we allow the player to resize the window, by using the SDL_RESIZABLE flag. While this works well, it seems that SDL automatically redraws the entire window in black and updates it immediately after a resize. This means that even though we capture the SDL_VIDEORESIZE event and redraw the screen on it, it flickers black as the user is resizing.

Is there any way to allow resizing of the window without this flicker?

Cheers,

David White
Lead Developer, Battle for Wesnoth (http://www.wesnoth.org)

I suspect this is due to there being a delay in the
drawing code?

I might suggest copying the old screen contents to
another surface, doing the call to SDL_SetVideoMode,
then immediately blit back (and swap buffers, if
double buffered) the surface.

I’m not sure if this will eliminate flicker, but it
should reduce it.

— David White wrote:> In Battle for Wesnoth, we allow the player to resize

the window, by using the SDL_RESIZABLE flag. While
this works well, it seems that SDL automatically
redraws the entire window in black and updates it
immediately after a resize. This means that even
though we capture the SDL_VIDEORESIZE event and
redraw the screen on it, it flickers black as the
user is resizing.

Is there any way to allow resizing of the window
without this flicker?

Cheers,

David White
Lead Developer, Battle for Wesnoth
(http://www.wesnoth.org)


Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

In Battle for Wesnoth, we allow the player to resize the window, by using the SDL_RESIZABLE flag. While this works well, it seems that SDL automatically redraws the entire window in black and updates it immediately after a resize. This means that even though we capture the SDL_VIDEORESIZE event and redraw the screen on it, it flickers black as the user is resizing.

Is there any way to allow resizing of the window without this flicker?

What platform are you seeing this on?

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment