We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Turning on OpenGL Vert Sync from the sketch
Page Index Toggle Pages: 1
Turning on OpenGL Vert Sync from the sketch (Read 367 times)
Turning on OpenGL Vert Sync from the sketch
Jul 18th, 2006, 1:55pm
 
Does anybody know how to enable Vert Sync from the sketch?

I need it to avoid the flickering that happens with some graphics cards that have the vertical sync disabled by default.  And I want to avoid having to ask the users to turn it on manually.

I know that in some OpenGL frameworks it's something like setSwapInterval(int) but I couldn't find this one in the jogl API, maybe I didn't look well enough.  Anyway I wouldn't know what number to set.  Any help would be great.

Thanks to all!
Re: Turning on OpenGL Vert Sync from the sketch
Reply #1 - Jul 18th, 2006, 2:01pm
 
Found it!

Sorry for the post.  There actually is a function setSwapInterval(int) and it's called like this:

((PGraphicsGL)g).gl.setSwapInterval(1);

I put it in try catch statement just in case it's not supported (I think it's an optional OpenGL extension) or not in OpenGL render mode.

Now I'll just do a bit more research to see what value to pass to it in order to avoid the tearing effect.

thanks anyway
Page Index Toggle Pages: 1