View Full Version : WGL_EXT_swap_control
04-12-2000, 06:11 AM
I have got a problem with WGL_EXT_swap_control:
How do I have to use PF .... PROC for this Extension?
I tried it like this:
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = NULL;
PFNWGLGETSWAPINTERVALEXTPROC wglGetSwapIntervalEXT = NULL;
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress("wglSwapIntervalEXT");
wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)wglGetProcAddress("wglGetSwapIntervalEXT");
Is something wrong with my code?
And then another question *grin* ... how can I use the extension?
Not sure how to use extensions on Win32 platforms, but I think this is the way to do it. However, you have to check if your functions actually get a value from wglGetProcAddress(), because if you specify an invalid extension, it will return NULL and you cant use the function.
For a complete (?) list of all extesions in OpenGL, have a look at http://oss.sgi.com/projects/ogl-sample/registry/ . All documents contains information on how, why and when to use them.
04-12-2000, 08:23 AM
Yes, your code is correct. But you must call the function too. Just place this in your code:
(i guess you want vsync)
04-12-2000, 08:30 AM
Yes, I want the user to decide if VSync is on or off. Let me guess, for VSync off I use wglSwapIntervalEXT(0);?
I have got another question if I try to get the current state of the SwapInterval I allways get a negative number (-1 or -2), what does that mean? And what are the numbers for the states?
I use a TNT with 2.40 drivers (which are best for TNT)!
[This message has been edited by Diapolo (edited 04-12-2000).]
04-12-2000, 11:33 AM
Yes, 0 disables vsync, but i have no idea why you get negative numbers back ...
04-14-2000, 06:11 AM
Where do I have to place the wglSwapIntervalEXT(value); command, so that it takes effect?
Perhaps I used it in the wrong place!
04-14-2000, 11:13 PM
Just call it somewhere http://www.opengl.org/discussion_boards/ubb/smile.gif
" wglSwapIntervalEXT specifies the minimum number of video frame periods per buffer swap for the window associated with the current context.
The interval takes effect when SwapBuffers or wglSwapLayerBuffer is first called subsequent to the wglSwapIntervalEXT call. "
[This message has been edited by Serge K (edited 04-15-2000).]
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.