glAddSwapHintRectWIN  1VQL5S3

[New - Windows 95, OEM Service Release 2]

The glAddSwapHintRectWIN function specifies a set of rectangles that are to be copied by SwapBuffersPJ7QT0.

void glAddSwapHintRectWIN(

    GLint x,

 

    GLint y,

 

    GLsizei width,

 

    GLsizei height

 

   );

 

 

Parameters

x

The x-coordinate (in window coordinates) of the lower-left corner of the hint region rectangle.

y

The y-coordinate (in window coordinates) of the lower-left corner of the hint region rectangle.

width

The width of the hint region rectangle.

height

The height of the hint region rectangle.

 

Remarks

The glAddSwapHintRectWIN function speeds up animation by reducing the amount of repainting between frames. With glAddSwapHintRectWIN, you specify a set of rectangular areas that you want copied when you call SwapBuffersPJ7QT0. When you do not specify any rectangles with glAddSwapHintRectWIN before calling SwapBuffers, the entire frame buffer is swapped. Using glAddSwapHintRectWIN to copy only parts of the buffer that changed can significantly increase the performance of SwapBuffers, especially when SwapBuffers is implemented in software.

The glAddSwapHintRectWIN function adds a rectangle to the hint region. When the PFD_SWAP_COPY flag of the PIXELFORMATDESCRIPTOR99A54N pixel format structure is set, SwapBuffers uses this region to clip the copying of the back buffer to the front buffer. You don t specify PFD_SWAP_COPY; it is set by capable hardware. The hint region is cleared after each call to SwapBuffers. With some hardware configurations, SwapBuffers can ignore the hint region and exchange the entire buffer. SwapBuffers is implemented by the system, not by the application.

OpenGL maintains a separate hint region for each window. When you call glAddSwapHintRectWIN on any rendering contexts associated with a window, the hint rectangles are combined into a single region.

Call glAddSwapHintRectWIN with a bounding rectangle for each object drawn for a frame and for each rectangle cleared to erase previous frame objects.

 

Note  The glAddSwapHintRectWIN function is an extension function that is not part of the standard OpenGL library but is part of the GL_WIN_swap_hint extension. To check whether your implementation of OpenGL supports glAddSwapHintRectWIN, call glGetString(GL_EXTENSIONS). If it returns GL_WIN_swap_hint, glAddSwapHintRectWIN is supported. To obtain the address of an extension function, call wglGetProcAddress.

 

See Also

glGetString, PIXELFORMATDESCRIPTOR, SwapBuffers, wglGetProcAddress