• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

White flicker when resizing window ?

DaveInDev

Member
Hi there,

I made a feature to allow the user to resize manually my borderless game window, by clicking in the bottom right corner of the room and dragging.
It works, and the window content is stretched as GMS usually does it.
BUT...
I noticed that during the dragging of the corner, especially when increasing the size of the window, the window randomly flickers to white.
I tried to move the window_set_size call to various places (pre, post, draw or gui), but nothing changes.
I also tried disabling application_surface drawing during the resizing -> same problem.
So I made a simple test to show it.
Here it is :

Do you also see this white flicker ?
Do you know how to correct it, because it's not very nice when the user is trying to resize the window...

basically, here is what I put in the step event :
GML:
a += 0.01;

w = 1000+500*sin(a);
h = 500+250*sin(a);

window_set_size(w,h);
 
Last edited:
No idea how to remove or if possible, but I definitely get this white screen all the time when I allow manual window resize.
Does it also when switching fullscreen-windowed, but not when resizing window in code.
 

DaveInDev

Member
No idea how to remove or if possible, but I definitely get this white screen all the time when I allow manual window resize.
Does it also when switching fullscreen-windowed, but not when resizing window in code.
Strange, I do not have a steady white window as you do, but only white flashs. But it happens also if I resize it by code, like in the example I posted.
I would prefer to have a steady white window as you do ;)

And I just noticed that it does not happen if I unleash game speed with game_set_speed(1000, gamespeed_fps) for example : then no more problem, but my game is not regular anymore :(

Question : in the video, when you click on "windowed", does it switch to true fullscreen, or faked windowed fullscreen ? And if it is the second answer, how do you do to get rid of the borders ?
 

gkri

Member
Is this the white flicker you are talking about?

In this specific case, without being sure, it give me the feeling that it is the default behavior.
 
Strange, I do not have a steady white window as you do, but only white flashs. But it happens also if I resize it by code, like in the example I posted.
I would prefer to have a steady white window as you do ;)

And I just noticed that it does not happen if I unleash game speed with game_set_speed(1000, gamespeed_fps) for example : then no more problem, but my game is not regular anymore :(

Question : in the video, when you click on "windowed", does it switch to true fullscreen, or faked windowed fullscreen ? And if it is the second answer, how do you do to get rid of the borders ?
When the little dot besides "Windowed" is green, it's a window of the selected size (normally I dont allow manual resize, it was just for the screen capture).
When it's unchecked, it's true fullscreen.
I use a global struct in my "game_manager" persistent object at game creation/load preferences that gets the user native display size, and go from there.
That way, I can just adjust the width of the camera if the user chooses something else than a 16:9 ratio and it won't give you borders.

My basic struct goes like this, but you adjust with what you need
GML:
function get_machine_display() constructor {
    width = display_get_width();
    height = display_get_height();
    ratio = width/height;
    fullscreen = true;
    win_width = window_get_width();
    win_height = window_get_height();
    scanlines = false;
}


//On game init, I call
global.display = new get_machine_display();
 

DaveInDev

Member
Is this the white flicker you are talking about?

In this specific case, without being sure, it give me the feeling that it is the default behavior.
No it seems that you have the same behavior as @Slow Fingers : a steady white window during the resize.
But I do not use the "window" resize : I have a borderless window, and I resize it from code.
If you can, please download the example Test30 resize flicker.yyz I posted, and run it : during the resizing, I really see the content of the window resized progressively, but sometimes I have some white flashs.

 
Last edited:
it requires permission to download
Maybe borderless window is the problem, I never used it so can't really tell from experience what are the differences in behavior, if any, when resizing.
I know I can't manually resize a borderless window, tho, so yeah, makes sense you do it in code.
Have you quadrupled-check if you had any duplicate instances that run the same resize code? Having multiples calls of it maybe would explain it.
 
Last edited:

gkri

Member
If you can, please download the example Test30 resize flicker.yyz I posted, and run it : during the resizing, I really see the content of the window resized progressively, but sometimes I have some white flashs.

I 've already tried to download it but, access is denied. Switch the link permissions to "available to everyone that has the link" (or something like this)..
 

DaveInDev

Member
it requires permission to download
Maybe borderless window is the problem, I never used it so can't really tell from experience what are the differences in behavior, if any, when resizing.
I know I can't manually resize a borderless window, tho, so yeah, makes sense you do it in code.
Have you quadrupled-check if you had any duplicate instances that run the same resize code? Having multiples calls of it maybe would explain it.
sorry, I'm clumsy : I changed the permissions

Press escape to exit the moving window.

About multiple instances, you will see, the example is really simple with 1 instance ;)
 
Wait what?!? You are resizing the window every step! Why on earth would you do that?!? Now I understand why you think it's buggy!
And on my end, it does flicker only when upscaling, and not when downscaling (maybe once in a while, but not near as bad)
 

DaveInDev

Member
Wait what?!? You are resizing the window every step! Why on earth would you do that?!? Now I understand why you think it's buggy!
And on my end, it does flicker only when upscaling, and not when downscaling (maybe once in a while, but not near as bad)
:) yes on every step : that's what I finally need to do if I want to let the user resize manually a borderless window : he would grab the "inside" corner of the room and drag it, so the window should be resized with every movement of the mouse.... That's exactly what happened when you resize from Windows (except that in that case, it seems that GMS creates a steady white window during the progression)

Anyway, you have the exact same behaviour as I have. At least it's not my config...
 
Anyway, you have the exact same behaviour as I have. At least it's not my config...
Yup, and I have a plutonium-powered computer, so it's not a "machine can't keep up with it" thing either.

Maybe try in the "Resize Window" Draw eventdisplay_my_damn_game(true);
 

DaveInDev

Member
Maybe try in the "Resize Window" Draw eventdisplay_my_damn_game(true);
I once tried this event (just adding a show_debug_message("resize");, but it seems that it is never called....
The doc says that it is only on UWP platform. I do not know about this UWP, but it does not seem to be basic windows apps...
 
Top