Hi MS? Xam?

I have some code for you that I used some time ago, but I don't know the details anymore. Hopefully it gives you some pointers in the right direction.

bool SetVSync(bool enabled) {
 if(!wglewIsSupported("WGL_EXT_swap_control")) {
   std::cout << "VSync is not supported\n";
   return false;
 }

 int swapInterval = wglGetSwapIntervalEXT();
 std::cout << "Current swap interval: " << swapInterval << std::endl;

 if(enabled) {
   // assuming display with 1 frame per swap
   wglSwapIntervalEXT(1);
 }
 else {
   // value of 0 = buffer swaps are not synchronized to a video frame
   wglSwapIntervalEXT(0);
 }

 return true;
}

Hope this helps.

Regards
Raymond


Xam wrote:
Is there any way to disable VSYNC inside OSG?

I need a way to enable and disable vsync on my program with out using the nvidia driver override or environmental variables. The Nvidia Driver settings for Vsync should be set to "Use the 3D application setting" I seem to remember that i was able to do that in previous versions of OSG when i was still using producer, I remember getting fps in the hundreds, but now i only get what ever my screen refresh rate is. After the removal of producer, i lost the ability to have vsync control.
Any help would be appreciated,

MS

------------------
Read this topic online here:
http://osgforum.tevs.eu/viewtopic.php?p=4528#4528





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to