VSync?

Aaaargh - please help.

I cannot remember how I could achieve that rendering is synchronized with vsync.

Unfortunately, I do not think there is a programmatic way to to this in Java.
We always manually set the driver’s vsync options. All nVidia drivers have a vsync option for OpenGL.

Found it.

I overloaded Canvas3D#paint()

public void paint( Graphics g ) 
{
    super.paint( g );
    Toolkit.getDefaultToolkit().sync();
}

I just tried exactly the code you put up, in a derived Canvas3D class, no dice.
What else are you doing to make it sync?

I just searched the Java3D mailing and got allot about vsyncing with the driver options, but nothing that can be done programmatically.

In fact, several post asking how to to do it programmatically came up!

Please explain you technique for posterity!

FROM THE JAVA 3D MAILING LIST:

[i]That’s a totaly different thing ! Toolkit.sync() is flushing the underlying
operating system graphic events queue, so that everything that you have
asked to be displayed is actually displayed. It’s not synchronizing with the
monitor vsync signal. It’s usefull when mixing lightweight and heavyweight
components, like when using Canvas3D in a swing app. See
http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Toolkit.html#sync()

Cheers,

Florin
[/i]

Yes, I’m sorry, I had it in my code but couldn’t remember where it was and what it did.

In fact, it isn’t helpful at all.

It was just bc. my app got stuck to 75FPS although I asked the OGL driver not to vsync. So I suspected I was syncing myself somewhere. Actually I didn’t. With DirectX, I get my higher framerates with the same app.