LWJGL
May 20, 2013, 12:43:50 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.9.0 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: [CLOSED] VSync doesn't work when minimized - Windows  (Read 1361 times)
oskar
Newbie
*
Posts: 11


« on: August 02, 2012, 10: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.

Code:
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
           
Logged
Fool Running
Nerdus Imperius
*****
Posts: 742


« Reply #1 on: August 07, 2012, 05: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.
Logged

Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option Grin
oskar
Newbie
*
Posts: 11


« Reply #2 on: August 07, 2012, 05:58:42 »

I did expect it to work. Is it then not a bug? Thanks for the suggested fix.
Logged
princec
Nerdus Imperius
*****
Posts: 1868



WWW
« Reply #3 on: August 07, 2012, 11:58:27 »

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

Cas Smiley
Logged

oskar
Newbie
*
Posts: 11


« Reply #4 on: August 07, 2012, 12:16:43 »

Oops. Sorry Caspian.  Sad
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!