[CLOSED] VSync doesn't work when minimized - Windows

Started by oskar, August 02, 2012, 17:26:49

Previous topic - Next topic

oskar

Problem

When I minimize the LWJGL display, the frame rate is no longer capped to 60 frames-per-second with VSync enabled.

How To Reproduce

I wrote the following code that should trigger the bug.

Display.setVSyncEnabled(true);           
try {                                    
    Display.create();                    
} catch (LWJGLException e) {             
    e.printStackTrace();  
}                                        
while (!Display.isCloseRequested()) {    
    Display.update();                    
}                                        
Display.destroy();     
 

Environment

Java Version: 1.7.0_02
Operating System: Windows 7 x64
LWJGL Version: 2.8.4
           

Fool Running

I'm surprised you would expect that to work. The thing you probably want to do is to check Display.isActive() and if it returns false, just sleep for 30ms or something.
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

oskar

I did expect it to work. Is it then not a bug? Thanks for the suggested fix.

princec

It is indeed not a bug - if the window is minimised there's no display to vsync to.

Cas :)