OpenGL: turning off and on vsync

Advanced game related topics
DarkDragon
Addict
Addict
Posts: 2348
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

OpenGL: turning off and on vsync

Post by DarkDragon »

Hello,

I heard, that you can turn off and on vsync with OpenGL. Do somebody know how I can do this?
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

If you own a Nvidia board get Rivatuner, there is an option to disable Vsync for OpenGl and DirectX.

This is done inside the registry, but i don't know where.
DarkDragon
Addict
Addict
Posts: 2348
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

Thanks, but I want to do this in the OpenGL-application.
Blade
Enthusiast
Enthusiast
Posts: 362
Joined: Wed Aug 06, 2003 2:49 pm
Location: Venice - Italy, Japan when possible.
Contact:

Post by Blade »

Standard OpenGL hasn't such feature.
Perhaps some hardware-specific extension has, but don't expect to work in many video cards...
DarkDragon
Addict
Addict
Posts: 2348
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

ohh, thx.
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

or maybe this... The same thing really...
Use this extension if available:
wglSwapControl = (PFNWGLEXTSWAPCONTROLPROC) wglGetProcAddress("wglSwapIntervalEXT");
and this to set the retrace to 1, 0 disables vsync.

wglSwapControl(1);
From this forum,

http://www.opengl.org/discussion_boards ... 00178.html
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
DarkDragon
Addict
Addict
Posts: 2348
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

thx, but I don't know what (PFNWGLEXTSWAPCONTROLPROC) is. I think it is a structure, but how is the structure build?
I mean:

Code: Select all

Structure
  Value1.l
  Value2.f
Endstructure
and why can't I use the command wglSwapControl() ???
dmoc
Enthusiast
Enthusiast
Posts: 739
Joined: Sat Apr 26, 2003 12:40 am

Post by dmoc »

"pfn..." pointer-to-function. It's an address returned by wglGetProcAddress() or something similar. Check out win sdk for "wgl" functions.
Post Reply