Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WGL_EXT_swap_control

88 views
Skip to first unread message

Parapraxis

unread,
Oct 2, 1999, 3:00:00 AM10/2/99
to
Does anyone know where I can get the extension specfor
WGL_EXT_swap_control??? I looked on opengl.org, but it isn't in the
.zip file of extension specs. What does this extension do? Can it be
used to do VSync?

Thanks,
Parapraxis

Ryan Haksi

unread,
Oct 3, 1999, 3:00:00 AM10/3/99
to

In a nutshell it controls whether swapbuffers is synched to the retrace
interval or not.

You'd use it somewhat like so:

if (OpenGLCheckExtension("WGL_EXT_swap_control"))
wglSwapIntervalEXT(WAIT_ON_VSYNCH);

where WAIT_ON_VSYNCH is a constant in my code defined to be 0 or 1.

You can find the full source code on my site.


l8r
Ryan

--
-+-+--+-+-> http://members.home.com/borealis/ryan.html <-+-+--+-+-

Ryan Haksi "Hah, that makes six shots I counted!"
cry...@infoserve.net -famous last words
"I re-loaded..." -the rebuttal

Phil Frisbie, Jr.

unread,
Oct 4, 1999, 3:00:00 AM10/4/99
to
Parapraxis wrote:
>
> Does anyone know where I can get the extension specfor
> WGL_EXT_swap_control??? I looked on opengl.org, but it isn't in the
> .zip file of extension specs. What does this extension do? Can it be
> used to do VSync?

Yes, it can give you control of the vsync WHEN IN FULL SCREEN MODE.

Use wglSwapIntervalEXT(0) to disable vsync.
Use wglSwapIntervalEXT(1) to enable vsync.

Here is an old copy of the spec:

Name

EXT_swap_control

Name Strings

WGL_EXT_swap_control

Version

Date: 10/20/1998 Revision: 1.2

Number

???

Dependencies

None

Overview

This extension allows an application to specify a minimum
periodicity
of color buffer swaps, measured in video frame periods.

New Procedures and Functions

BOOL wglSwapIntervalEXT(int interval)

int wglGetSwapIntervalEXT(void)

New Tokens

None

Additions to Chapter 2 of the GL Specification (OpenGL Operation)

None

Additions to Chapter 3 of the GL Specification (Rasterization)

None

Additions to Chapter 4 of the GL Specification (Per-Fragment Operations
and the Framebuffer)

None

Additions to Chapter 5 of the GL Specification (Special Functions)

None

Additions to Chapter 6 of the GL Specification (State and State
Requests)

None

Additions to the WGL Specification

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.

The parameter 'interval' specifies the minimum number of video
frames
that are displayed before a buffer swap will occur.

A video frame period is the time required by the monitor to display
a
full frame of video data. In the case of an interlaced monitor,
this is typically the time required to display both the even and odd
fields of a frame of video data. An interval set to a vlaue of 2
means that the color buffers will be swapped at most every other
video
frame.

If 'interval' is set to a value of 0, buffer swaps are not synchron-
ized to a video frame. The 'interval' value is silently clamped to
the maximum implementation-dependent value supported before being
stored.

The swap interval is not part of the render context state. It
cannot
be pushed or popped. The current swap interval for the window
associated with the current context can be obtained by calling
wglGetSwapIntervalEXT. The default swap interval is 1.

Because there is no way to extend wgl, this call is defined in the
ICD
and can be called by obtaining the address with wglGetProcAddress.
Because this is not a GL extension, it is not included in the
GL_EXTENSIONS string.

Errors

If the function succeeds, the return value is TRUE. If the function
fails, the return value is FALSE. To get extended error
information,
call GetLastError.

ERROR_INVALID_DATA The 'interval' parameter is negative.

New State

None

New Implementation Dependent State

None


Phil Frisbie, Jr.
Hawk Software
http://www.hawksoft.com

0 new messages