WGL_EXT_swap_control

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?

Diapolo

Hello

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.

Bob

Yes, your code is correct. But you must call the function too. Just place this in your code:
wglSwapIntervalEXT(1);
(i guess you want vsync)

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)!

Diapolo

[This message has been edited by Diapolo (edited 04-12-2000).]

Yes, 0 disables vsync, but i have no idea why you get negative numbers back …

Where do I have to place the wglSwapIntervalEXT(value); command, so that it takes effect?

Perhaps I used it in the wrong place!

Diapolo

Just call it somewhere

" 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. "

WGL_EXT_swap_control

[This message has been edited by Serge K (edited 04-15-2000).]