Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (491)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (555)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  VSync problem after upgrading  (Read 3221 times)
0 Members and 1 Guest are viewing this topic.
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Posted 2007-08-16 21:30:25 »

I recently upgraded LWJGL from 0.99 to 1.1.1 in JEmu2.
Everything seems to work fine, except vsync seems to be very dodgy now. It occasionally works, but most of the time it doesn't and the games run way too fast. Using 0.99 it worked just fine.
Anything changed that I need to be aware of?

Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #1 - Posted 2007-08-16 21:48:19 »

If vsync is set to always off on the driver side you cannot enable it. Always back it up with a capping method (such as Display.sync).

弾幕 ☆ @mahonnaiseblog
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #2 - Posted 2007-08-16 22:03:47 »

It's not turned off in the driver. Like I said, vsync works fine using LWJGL 0.99, it just doesn't work for me anymore in 1.1.1
There's throttling too in JEmu2, but that's not the point; I want to use vsync to prevent tearing.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #3 - Posted 2007-08-17 04:45:50 »

yeah, regardless of driver settings - it worked in .99 - I am not sure what changed tho... I 'll try and talk to elias to see if he has a clue

Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #4 - Posted 2007-08-17 09:46:56 »

>yeah, regardless of driver settings - it worked in .99

Naaah. Usually there is:
-always off
-off by default
-on by default
-always on

Only with "off by default" and "on by default" you can change it from the program side. Setting the swap interval is only some kind of hint... nothing more... nothing less.

弾幕 ☆ @mahonnaiseblog
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #5 - Posted 2007-08-17 10:03:44 »

>yeah, regardless of driver settings - it worked in .99

Naaah. Usually there is:
-always off
-off by default
-on by default
-always on

Only with "off by default" and "on by default" you can change it from the program side. Setting the swap interval is only some kind of hint... nothing more... nothing less.

Oh sure, but I think you're missing the point.
The thing is, that hint doesn't seem to work anymore since 1.1.1, at least on my machine  Smiley
Unless the driver is set to 'always off', I should be able to get vsync. Until 0.99 this worked fine. Since I upgraded to 1.1.1, it doesn't.

Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #6 - Posted 2007-08-17 11:41:40 »

>Oh sure, but I think you're missing the point.

He said "regardless of driver setting". I know that you meant something different. Wink

弾幕 ☆ @mahonnaiseblog
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #7 - Posted 2007-08-17 12:09:01 »

heh, I actually meant what eric said.  Roll Eyes
if it worked in 99 and doesn't work in 1.1 - with the same drivers/settings, then there is an issue!

Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #8 - Posted 2007-08-17 12:51:14 »

Do you want me to create a small test case?

Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #9 - Posted 2007-08-17 18:36:55 »

I just tried the org.lwjgl.test.input.MouseTest and vsync on/off worked fine. So I am not sure what the issue is  Huh

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #10 - Posted 2007-08-17 22:33:01 »

Hm, I just tried it on another PC and there it works just fine...
I also tried it at again on my laptop (with Intel gfx) with both 0.99 and 1.1.1, and 0.99 works without problems but in 1.1.1 vsync doesn't work.

So I guess there must have been some change in vsync handling between LWJGL 0.99 and 1.1.1, which doesn't work with my (perhaps crappy) video drivers.

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 77
Projects: 15


★★★★★


« Reply #11 - Posted 2007-08-17 22:45:22 »

you could maybe try a few other releases between 0.99 and 1.1.1, would help to find in which release the problem appeared, and help narrow down which changes to the lwjgl code bring about this problem on your card.
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #12 - Posted 2007-08-17 23:04:58 »

Yes, that's exactly what I just did  Smiley
The problem appeared in 1.0 rc-1

EDIT: The .dll of beta 4 and rc-1 are exactly the same size, so a wild guess would be that it's in the java part. I'll check to see what's changed there.

Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #13 - Posted 2007-08-17 23:48:07 »

Not sure what exactly is going on yet, but there is a difference in setting vsync.

In the JNI code in beta 4:
1  
2  
3  
4  
5  
6  
7  
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nSetSwapInterval
  (JNIEnv *env, jclass clazz, jobject context_handle, jint value) {
   WindowsContext *context_info = (WindowsContext *)(*env)->GetDirectBufferAddress(env, context_handle);
   if (context_info->extensions.WGL_EXT_swap_control) {
      context_info->extensions.wglSwapIntervalEXT(value);
   }
}


in rc-1:
1  
2  
3  
4  
5  
6  
7  
8  
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nSetSwapInterval
  (JNIEnv *env, jclass clazz, jobject context_handle, jint value) {
   WGLExtensions extensions;
   extgl_InitWGL(&extensions);
   if (extensions.WGL_EXT_swap_control) {
      extensions.wglSwapIntervalEXT(value);
   }
}

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Nickropheliac (15 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (29 views)
2014-08-22 19:31:30

atombrot (41 views)
2014-08-19 09:29:53

Tekkerue (38 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (24 views)
2014-08-16 06:20:21

Tekkerue (34 views)
2014-08-16 06:12:11

Rayexar (72 views)
2014-08-11 02:49:23

BurntPizza (48 views)
2014-08-09 21:09:32
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!