Hello Guest

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

  • 4 Replies
  • 5040 Views
*

Offline oskar

  • *
  • 11
[CLOSED] VSync doesn't work when minimized - Windows
« 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.

Code: [Select]
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
           

Re: [BUG] VSync doesn't work when minimized - Windows
« Reply #1 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.
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

*

Offline oskar

  • *
  • 11
Re: [BUG] VSync doesn't work when minimized - Windows
« Reply #2 on: August 07, 2012, 12:58:42 »
I did expect it to work. Is it then not a bug? Thanks for the suggested fix.

*

Offline princec

  • *****
  • 1933
    • Puppygames
Re: [BUG] VSync doesn't work when minimized - Windows
« Reply #3 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 :)

*

Offline oskar

  • *
  • 11
Re: [CLOSED] VSync doesn't work when minimized - Windows
« Reply #4 on: August 07, 2012, 19:16:43 »
Oops. Sorry Caspian.  :(