LWJGL Forum

Archive => Resolved Bugs/RFE => Topic started by: oskar on August 02, 2012, 17:26:49

Title: [CLOSED] VSync doesn't work when minimized - Windows
Post by: oskar on August 02, 2012, 17:26:49
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
           
Title: Re: [BUG] VSync doesn't work when minimized - Windows
Post by: Fool Running on August 07, 2012, 12:57:18
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.
Title: Re: [BUG] VSync doesn't work when minimized - Windows
Post by: oskar on August 07, 2012, 12:58:42
I did expect it to work. Is it then not a bug? Thanks for the suggested fix.
Title: Re: [BUG] VSync doesn't work when minimized - Windows
Post by: princec on August 07, 2012, 18:58:27
It is indeed not a bug - if the window is minimised there's no display to vsync to.

Cas :)
Title: Re: [CLOSED] VSync doesn't work when minimized - Windows
Post by: oskar on August 07, 2012, 19:16:43
Oops. Sorry Caspian.  :(