SAMPLE: GLEXT: Demo of GL_WIN_swap_hint & GL_EXT_vertex_arrayLast reviewed: June 6, 1996Article ID: Q139967 |
The information in this article applies to:
SUMMARYThe GLEXT sample illustrates how to use the GL_WIN_swap_hint extension to speed up animation by reducing the amount of repainting between frames and how to use GL_EXT_vertex_array extension to provide fast rendering of multiple geometric primitives with one glDrawArraysEXT call. It also shows how to use glPixelZoom and glDrawPixels to display an OpenGL bitmap. Download GLEXT.EXE, a self-extracting file, from the Microsoft Software Library (MSL) on the following services:
MORE INFORMATIONWindows NT 3.51 and Windows 95 OpenGL supports OpenGL GL_WIN_swap_hint and GL_EXT_vertex_array extensions. To use GL_WIN_swap_hint extension, you need to use these functions:
glAddSwapHintRectWIN SwapBuffers glGetString wglGetProcAddressThe glAddSwapHintRectWIN function lets you specify a set of rectangular areas that you want to copy when you call SwapBuffers function. When no rectangles are specified with glAddSwapHintRectWIN before calling SwapBuffers, the entire frame buffer is swapped. If you only want to animate part of your scene, using glAddSwapHintRectWIN function will significantly speed up your animation. To check whether your implementation of OpenGL supports glAddSwapHintRectWIN, call glGetString(GL_EXTENSIONS). If it returns GL_WIN_swap_hint, glAddWsapHintRectWIN is supported. To obtain the address of the glAddSwapHintRectWIN function, call wglGetProcAddress. To use GL_EXT_vertex_array extension, you need to use these functions:
glDrawArraysEXT glGetString wglGetProcAddressThe glDrawArraysEXT function enables you to specify multiple geometric primitives to render. Instead of calling separate OpenGL functions to pass each individual vertex, normal, or color, you can specify separate arrays of vertexes, normals, and colors to define a sequence of primitives of the same kind, and just use one glDrawArraysEXT call to render them. To check whether your implementation of OpenGL supports glDrawArraysEXT, call glGetString(GL_EXTENSIONS). If it returns GL_EXT_vertex_array, glDrawArraysEXT is supported. To obtain the address of the glDrawArraysEXT function, call wglGetProcAddress. You can use the following functions to define the data array for your primitives:
glVertexPointerEXT glNormalPointerEXT glColorPointerEXT glTexCoordPointerEXT glEdgeFlagPointerEXT glArrayElementEXT glGetPointervEXT glIndexPointerEXTSee the SDK references for information on these functions.
|
Additional reference words: 3.51 4.00 glext.exe opengl extension
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |