═══ 1. OpenGL WWW Pages Intro ═══ OpenGL man pages The OpenGL WWW Pages (Version 1.0) The OpenGL man pages for OpenGL version 1.0 have been reformatted into HTML for your reference. At this time it is not part of our Open3D product, but merely a convenience for our customers. (And web surfers.) These man pages represent the following versions of the OpenGL standards: Specification Version ------------- ------- OpenGL 1.0 GLX 1.1 GLU 1.2 HTML does not have a good way to write mathematic equations. I have done my best to represent the various formulas in the man pages into something readable on character-based readers. I have used one ISO Latin-1 one character, the raised dot (╖, hex b7), to indicate multiplication. If this is a problem for people I can change it to `*'. Superscripts are placed on the line above and subscripts are placed on the line below their referent. Fortunately I didn't run across any instances of subscripts on one line followed by superscripts on the line below. My primary goals are 1. Make the man pages readable and correct. 2. Make sure the formulas, equations and tables are readable and correct. 3. Keep all information visible for character based readers. Making everything look pretty is not as important. If you find any errors or if you have any suggestions, please send mail to andy.vesper@eng.pko.dec.com or andy.vesper@pko.mts.dec.com. I will try to fix them up as I find time. Unfortunately this is a volunteer effort and I so I cannot spend much time on it. To start, choose either the alphabetic order page or specification order page. There is also an introductory page located at glXIntro. The GLU tesselator has changed in GLU version 1.2; here are some notes on the new GLU tesselator ──────────────────────────────────────────────────────────────────────────────── Due to popular demand, I have added a tar file and a zip file, each of which contains all the .html sources. Note that the names are long names with the extension .html, and so are not appropriate to being placed on a FAT-formatted disk. ──────────────────────────────────────────────────────────────────────────────── For more OpenGL information, I suggest starting at The OpenGL WWW Center. ──────────────────────────────────────────────────────────────────────────────── You can also read the hypertext version of The OpenGL Graphics System: A Specification (Version 1.1). In this document all formulae are given as images, so they look much better than my ASCII art. However, this is Version 1.1, not Version 1.0. SGI does not seem to have kept the 1.0 version around. ──────────────────────────────────────────────────────────────────────────────── Last Edited: Wed Feb 5 10:37:39 EST 1997 by AFV Look here for legal stuff: Legal ═══ 2. Andrew Frank Vesper, Business Card ═══ OpenGL man pages ──────────────────────────────────────────────────────────────────────────────── Andrew Frank Vesper 3D Graphics Group Alpha Personal Systems Internet: andy.vesper@eng.pko.dec.com or: andy.vesper@pko.mts.dec.com Digital Equipment Corporation PKO3-1 / N30 129 Parker Street, Maynard, MA 01754-2198 Telephone : 508-493-6315 FAX : 508-493-1227 -- Please call or send mail to alert me ──────────────────────────────────────────────────────────────────────────────── Last Edited: Fri Dec 6 11:18:03 EST 1996 ═══ 3. OpenGL Index of routines in Alphabetic Order ═══ OpenGL man pages Contents glA glB glC glD glE glF glG glH glI glL glM glN glO glP glR glS glT glV glX glu OpenGL Index in Alphabetic Order glA... glAccum glAlphaFunc glArrayElementEXT glB... glBegin glBitmap glBlendFunc glC... glCallList glCallLists glClear glClearAccum glClearColor glClearDepth glClearIndex glClearStencil glClipPlane glColor3b, glColor3bv, glColor3d, glColor3dv, glColor3f, glColor3fv, glColor3i, glColor3iv, glColor3s, glColor3sv, glColor3ub, glColor3ubv, glColor3ui, glColor3uiv, glColor3us, glColor3usv, glColor4b, glColor4bv, glColor4d, glColor4dv, glColor4f, glColor4fv, glColor4i, glColor4iv, glColor4s, glColor4sv, glColor4ub, glColor4ubv, glColor4ui, glColor4uiv, glColor4us, glColor4usv glColorMask glColorMaterial glColorPointerEXT glCopyPixels glCullFace glD... glDeleteLists glDepthFunc glDepthMask glDepthRange glDisable glDrawArraysEXT glDrawBuffer glDrawPixels glE... glEdgeFlag glEdgeFlagPointerEXT glEdgeFlagv glEnable glEnd glEndList glEvalCoord1d, glEvalCoord1dv, glEvalCoord1f, glEvalCoord1fv, glEvalCoord2d, glEvalCoord2dv, glEvalCoord2f, glEvalCoord2fv glEvalMesh1, glEvalMesh2 glEvalPoint1, glEvalPoint2 glF... glFeedbackBuffer glFinish glFlush glFogf, glFogfv, glFogi, glFogiv glFrontFace glFrustum glG... glGenLists glGetBooleanv glGetClipPlane glGetDoublev glGetError glGetFloatv, glGetIntegerv glGetLightfv, glGetLightiv glGetMapdv, glGetMapfv, glGetMapiv glGetMaterialfv, glGetMaterialiv glGetPixelMapfv, glGetPixelMapuiv, glGetPixelMapusv glGetPointervEXT glGetPolygonStipple glGetString glGetTexEnvfv, glGetTexEnviv glGetTexGendv, glGetTexGenfv, glGetTexGeniv glGetTexImage glGetTexLevelParameterfv, glGetTexLevelParameteriv glGetTexParameterfv, glGetTexParameteriv glH... glHint glI... glIndexMask glIndexPointerEXT glIndexd, glIndexdv, glIndexf, glIndexfv, glIndexi, glIndexiv, glIndexs, glIndexsv glInitNames glIsEnabled glIsList glL... glLightModelf, glLightModelfv, glLightModeli, glLightModeliv glLightf, glLightfv, glLighti, glLightiv glLineStipple glLineWidth glListBase glLoadIdentity glLoadMatrixd, glLoadMatrixf glLoadName glLogicOp glM... glMap1d, glMap1f glMap2d, glMap2f glMapGrid1d, glMapGrid1f, glMapGrid2d, glMapGrid2f glMaterialf, glMaterialfv, glMateriali, glMaterialiv glMatrixMode glMultMatrixd, glMultMatrixf glN... glNewList glNormal3b, glNormal3bv, glNormal3d, glNormal3dv, glNormal3f, glNormal3fv, glNormal3i, glNormal3iv, glNormal3s, glNormal3sv glNormalPointerEXT glO... glOrtho glP... glPassThrough glPixelMapfv, glPixelMapuiv, glPixelMapusv glPixelStoref, glPixelStorei glPixelTransferf, glPixelTransferi glPixelZoom glPointSize glPolygonMode glPolygonStipple glPopAttrib glPopMatrix glPopName glPushAttrib glPushMatrix glPushName glR... glRasterPos2d, glRasterPos2dv, glRasterPos2f, glRasterPos2fv, glRasterPos2i, glRasterPos2iv, glRasterPos2s, glRasterPos2sv, glRasterPos3d, glRasterPos3dv, glRasterPos3f, glRasterPos3fv, glRasterPos3i, glRasterPos3iv, glRasterPos3s, glRasterPos3sv, glRasterPos4d, glRasterPos4dv, glRasterPos4f, glRasterPos4fv, glRasterPos4i, glRasterPos4iv, glRasterPos4s, glRasterPos4sv glReadBuffer glReadPixels glRectd, glRectdv, glRectf, glRectfv, glRecti, glRectiv, glRects, glRectsv glRenderMode glRotated glRotatef glS... glScaled, glScalef glScissor glSelectBuffer glShadeModel glStencilFunc glStencilMask glStencilOp glT... glTexCoord1d, glTexCoord1dv, glTexCoord1f, glTexCoord1fv, glTexCoord1i, glTexCoord1iv, glTexCoord1s, glTexCoord1sv, glTexCoord2d, glTexCoord2dv, glTexCoord2f, glTexCoord2fv, glTexCoord2i, glTexCoord2iv, glTexCoord2s, glTexCoord2sv, glTexCoord3d, glTexCoord3dv, glTexCoord3f, glTexCoord3fv, glTexCoord3i, glTexCoord3iv, glTexCoord3s, glTexCoord3sv, glTexCoord4d, glTexCoord4dv, glTexCoord4f, glTexCoord4fv, glTexCoord4i, glTexCoord4iv, glTexCoord4s, glTexCoord4sv glTexCoordPointerEXT, glTexEnvf, glTexEnvfv, glTexEnvi, glTexEnviv, glTexGend, glTexGendv, glTexGenf, glTexGenfv, glTexGeni, glTexGeniv glTexImage1D glTexImage2D glTexParameterf, glTexParameterfv, glTexParameteri, glTexParameteriv glTranslated, glTranslatef glV... glVertex2d, glVertex2dv, glVertex2f, glVertex2fv, glVertex2i, glVertex2iv, glVertex2s, glVertex2sv, glVertex3d, glVertex3dv, glVertex3f, glVertex3fv, glVertex3i, glVertex3iv, glVertex3s, glVertex3sv, glVertex4d, glVertex4dv, glVertex4f, glVertex4fv, glVertex4i, glVertex4iv, glVertex4s, glVertex4sv glVertexPointerEXT glViewport glX... glXChooseVisual glXCopyContext glXCreateContext glXCreateGLXPixmap glXDestroyContext glXDestroyGLXPixmap glXGetConfig glXGetCurrentContext glXGetCurrentDrawable glXIsDirect glXMakeCurrent glXQueryExtension glXQueryVersion glXSwapBuffers glXUseXFont glXWaitGL glXWaitX glu... See notes on the new GLU tesselator gluBeginCurve gluBeginPolygon (GLU versions 1.0 and 1.1) gluBeginPolygon (GLU version 1.2 and later) gluBeginSurface gluBeginTrim gluBuild1DMipmaps gluBuild2DMipmaps gluCylinder gluDeleteNurbsRenderer gluDeleteQuadric gluDeleteTess (GLU versions 1.0 and 1.1) gluDeleteTess (GLU version 1.2 and later) gluDisk gluEndCurve gluEndPolygon (GLU versions 1.0 and 1.1) gluEndPolygon (GLU version 1.2 and later) gluEndSurface gluEndTrim gluErrorString gluGetNurbsProperty gluGetTessProperty (GLU version 1.2 and later) gluLoadSamplingMatrices gluLookAt gluNewNurbsRenderer gluNewQuadric gluNewTess (GLU versions 1.0 and 1.1) gluNewTess (GLU version 1.2 and later) gluNextContour (GLU versions 1.0 and 1.1) gluNextContour (GLU version 1.2 and later) gluNurbsCallback gluNurbsCurve gluNurbsProperty gluNurbsSurface gluOrtho2D gluPartialDisk gluPerspective gluPickMatrix gluProject gluPwlCurve gluQuadricCallback gluQuadricDrawStyle gluQuadricNormals gluQuadricOrientation gluQuadricTexture gluScaleImage gluSphere gluTessBeginContour (GLU version 1.2 and later) gluTessBeginPolygon (GLU version 1.2 and later) gluTessCallback (GLU versions 1.0 and 1.1) gluTessCallback (GLU version 1.2 and later) gluTessEndContour (GLU version 1.2 and later) gluTessEndPolygon (GLU version 1.2 and later) gluTessNormal (GLU version 1.2 and later) gluTessProperty (GLU version 1.2 and later) gluTessVertex (GLU versions 1.0 and 1.1) gluTessVertex (GLU version 1.2 and later) gluUnProject ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.1. glAccum ═══ OpenGL man pages glAccum Name glAccum - operate on the accumulation buffer C Specification void glAccum( GLenum op, GLfloat value ) Parameters op Specifies the accumulation buffer operation. Symbolic constants GL_ACCUM, GL_LOAD, GL_ADD, GL_MULT, and GL_RETURN are accepted. value Specifies a floating-point value used in the accumulation buffer operation. op determines how value is used. Description The accumulation buffer is an extended-range color buffer. Images are not rendered into it. Rather, images rendered into one of the color buffers are added to the contents of the accumulation buffer after rendering. Effects such as antialiasing (of points, lines, and polygons), motion blur, and depth of field can be created by accumulating images generated with different transformation matrices. Each pixel in the accumulation buffer consists of red, green, blue, and alpha values. The number of bits per component in the accumulation buffer depends on the implementation. You can examine this number by calling glGetIntegerv four times, with arguments GL_ACCUM_RED_BITS, GL_ACCUM_GREEN_BITS, GL_ACCUM_BLUE_BITS, and GL_ACCUM_ALPHA_BITS, respectively. Regardless of the number of bits per component, however, the range of values stored by each component is [-1, 1]. The accumulation buffer pixels are mapped one-to-one with frame buffer pixels. glAccum operates on the accumulation buffer. The first argument, op, is a symbolic constant that selects an accumulation buffer operation. The second argument, value, is a floating-point value to be used in that operation. Five operations are specified: GL_ACCUM, GL_LOAD, GL_ADD, GL_MULT, and GL_RETURN. All accumulation buffer operations are limited to the area of the current scissor box and are applied identically to the red, green, blue, and alpha components of each pixel. The contents of an accumulation buffer pixel component are undefined if the glAccum operation results in a value outside the range [-1,1]. The operations are as follows: GL_ACCUM Obtains R, G, B, and A values from the buffer currently selected for reading (see glReadBuffer). Each component value is divided by 2n-1, where n is the number of bits allocated to each color component in the currently selected buffer. The result is a floating-point value in the range [0,1], which is multiplied by value and added to the corresponding pixel component in the accumulation buffer, thereby updating the accumulation buffer. GL_LOAD Similar to GL_ACCUM, except that the current value in the accumulation buffer is not used in the calculation of the new value. That is, the R, G, B, and A values from the currently selected buffer are divided by 2n-1, multiplied by value, and then stored in the corresponding accumulation buffer cell, overwriting the current value. GL_ADD Adds value to each R, G, B, and A in the accumulation buffer. GL_MULT Multiplies each R, G, B, and A in the accumulation buffer by value and returns the scaled component to its corresponding accumulation buffer location. GL_RETURN Transfers accumulation buffer values to the color buffer or buffers currently selected for writing. Each R, G, B, and A component is multiplied by value, then multiplied by 2n-1, clamped to the range [0,2n-1], and stored in the corresponding display buffer cell. The only fragment operations that are applied to this transfer are pixel ownership, scissor, dithering, and color writemasks. The accumulation buffer is cleared by specifying R, G, B, and A values to set it to with the glClearAccum directive, and issuing a glClear command with the accumulation buffer enabled. Notes Only those pixels within the current scissor box are updated by any glAccum operation. Errors GL_INVALID_ENUM is generated if op is not an accepted value. GL_INVALID_OPERATION is generated if there is no accumulation buffer. GL_INVALID_OPERATION is generated if glAccum is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_ACCUM_RED_BITS glGet with argument GL_ACCUM_GREEN_BITS glGet with argument GL_ACCUM_BLUE_BITS glGet with argument GL_ACCUM_ALPHA_BITS See Also glBlendFunc, glClear, glClearAccum, glCopyPixels, glGet, glLogicOp, glPixelStore, glPixelTransfer, glReadPixels, glReadBuffer, glScissor, glStencilOp ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.2. glAlphaFunc ═══ OpenGL man pages glAlphaFunc Name glAlphaFunc - specify the alpha test function C Specification void glAlphaFunc( GLenum func, GLclampf ref ) Parameters func Specifies the alpha comparison function. Symbolic constants GL_NEVER, GL_LESS, GL_EQUAL, GL_LEQUAL, GL_GREATER, GL_NOTEQUAL, GL_GEQUAL, and GL_ALWAYS are accepted. The default function is GL_ALWAYS. ref Specifies the reference value that incoming alpha values are compared to. This value is clamped to the range 0 through 1, where 0 represents the lowest possible alpha value and 1 the highest possible value. The default reference is 0. Description The alpha test discards fragments depending on the outcome of a comparison between the incoming fragment's alpha value and a constant reference value. glAlphaFunc specifies the reference and comparison function. The comparison is performed only if alpha testing is enabled. (See glEnable and glDisable of GL_ALPHA_TEST.) func and ref specify the conditions under which the pixel is drawn. The incoming alpha value is compared to ref using the function specified by func. If the comparison passes, the incoming fragment is drawn, conditional on subsequent stencil and depth buffer tests. If the comparison fails, no change is made to the frame buffer at that pixel location. The comparison functions are as follows: GL_NEVER Never passes. GL_LESS Passes if the incoming alpha value is less than the reference value. GL_EQUAL Passes if the incoming alpha value is equal to the reference value. GL_LEQUAL Passes if the incoming alpha value is less than or equal to the reference value. GL_GREATER Passes if the incoming alpha value is greater than the reference value. GL_NOTEQUAL Passes if the incoming alpha value is not equal to the reference value. GL_GEQUAL Passes if the incoming alpha value is greater than or equal to the reference value. GL_ALWAYS Always passes. glAlphaFunc operates on all pixel writes, including those resulting from the scan conversion of points, lines, polygons, and bitmaps, and from pixel draw and copy operations. glAlphaFunc does not affect screen clear operations. Notes Alpha testing is done only in RGBA mode. Errors GL_INVALID_ENUM is generated if func is not an accepted value. GL_INVALID_OPERATION is generated if glAlphaFunc is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_ALPHA_TEST_FUNC glGet with argument GL_ALPHA_TEST_REF glIsEnabled with argument GL_ALPHA_TEST See Also glBlendFunc, glClear, glDepthFunc, glEnable, glStencilFunc ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.3. glArrayElementEXT ═══ OpenGL man pages glArrayElementEXT Name glArrayElementEXT - specify the array elements used to render a vertex C Specification void glArrayElementEXT( GLint i ) Parameters i Specifies an index in the enabled arrays. Description glArrayElementEXT commands are used within glBegin/glEnd pairs to specify vertex and attribute data for point, line and polygon primitives. When glArrayElementEXT is called, a single vertex is drawn, using vertex and attribute data taken from location i of the enabled arrays. Use glArrayElementEXT to construct primitives by indexing vertex data, rather than by streaming through arrays of data in first-to-last order. Because each call specifies only a single vertex, it is possible to explicitly specify per-primitive attributes, such as a single normal per individual triangle. Notes glArrayElementEXT may be included in display lists. If glArrayElementEXT is entered into a display list, the necessary array data (determined by the array pointers and enables) is also entered into the display list. Because the array pointers and enables are client side state, their values affect display lists when the lists are created, not when the lists are executed. Static array data may be read and cached by the implementation at any time. If static array elements are modified and the arrays are not respecified, the results of any subsequent calls to glArrayElementEXT are undefined. glArrayElementEXT executes even if GL_VERTEX_ARRAY_EXT is not enabled. No drawing occurs in this case, but the attributes corresponding to enabled arrays are modified. Although it is not an error to respecify an array between the execution of glBegin and the corresponding execution of glEnd, the result of such respecification is undefined. glArrayElementEXT is part of the EXT_vertex_array extension, not part of the core GL command set. If "GL_EXT_vertex_array" is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension EXT_vertex_array is supported. See Also glColorPointerEXT, glDrawArraysEXT, glEdgeFlagPointerEXT, glGetPointervEXT, glIndexPointerEXT, glNormalPointerEXT, glTexCoordPointerEXT, glVertexPointerEXT ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.4. glBegin ═══ OpenGL man pages glBegin Name glBegin, glEnd - delimit the vertices of a primitive or a group of like primitives C Specification void glBegin( GLenum mode ) Parameters mode Specifies the primitive or primitives that will be created from vertices presented between glBegin and the subsequent glEnd. Ten symbolic constants are accepted: GL_POINTS, GL_LINES, GL_LINE_STRIP, GL_LINE_LOOP, GL_TRIANGLES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_QUADS, GL_QUAD_STRIP, and GL_POLYGON. C Specification void glEnd( void ) Description glBegin and glEnd delimit the vertices that define a primitive or a group of like primitives. glBegin accepts a single argument that specifies which of ten ways the vertices are interpreted. Taking n as an integer count starting at one, and N as the total number of vertices specified, the interpretations are as follows: GL_POINTS Treats each vertex as a single point. Vertex n defines point n. N points are drawn. GL_LINES Treates each pair of vertices as an independent line segment. Vertices 2n-1 and 2n define line n. N/2 lines are drawn. GL_LINE_STRIP Draws a connected group of line segments from the first vertex to the last. Vertices n and n+1 define line n. N-1 lines are drawn. GL_LINE_LOOP Draws a connected group of line segments from the first vertex to the last, then back to the first. Vertices n and n+1 define line n. The last line, however, is defined by vertices N and 1. N lines are drawn. GL_TRIANGLES Treates each triplet of vertices as an independent triangle. Vertices 3n-2, 3n-1, and 3n define triangle n. N/3 triangles are drawn. GL_TRIANGLE_STRIP Draws a connected group of triangles. One triangle is defined for each vertex presented after the first two vertices. For odd n, vertices n, n+1, and n+2 define triangle n. For even n, vertices n+1, n, and n+2 define triangle n. N-2 triangles are drawn. GL_TRIANGLE_FAN Draws a connected group of triangles. One triangle is defined for each vertex presented after the first two vertices. Vertices 1, n+1, and n+2 define triangle n. N-2 triangles are drawn. GL_QUADS Treats each group of four vertices as an independent quadrilateral. Vertices 4n-3, 4n-2, 4n-1, and 4n define quadrilateral n. N/4 quadrilaterals are drawn. GL_QUAD_STRIP Draws a connected group of quadrilaterals. One quadrilateral is defined for each pair of vertices presented after the first pair. Vertices 2n-1, 2n, 2n+2, and 2n+1 define quadrilateral n. N/2-1 quadrilaterals are drawn. Note that the order in which vertices are used to construct a quadrilateral from strip data is different from that used with independent data. GL_POLYGON Draws a single, convex polygon. Vertices 1 through N define this polygon. Only a subset of GL commands can be used between glBegin and glEnd. The commands are glVertex, glColor, glIndex, glNormal, glTexCoord, glEvalCoord, glEvalPoint, glMaterial, and glEdgeFlag. Also, it is acceptable to use glCallList or glCallLists to execute display lists that include only the preceding commands. If any other GL command is executed between glBegin and glEnd, the error flag is set and the command is ignored. Regardless of the value chosen for mode, there is no limit to the number of vertices that can be defined between glBegin and glEnd. Lines, triangles, quadrilaterals, and polygons that are incompletely specified are not drawn. Incomplete specification results when either too few vertices are provided to specify even a single primitive or when an incorrect multiple of vertices is specified. The incomplete primitive is ignored; the rest are drawn. The minimum specification of vertices for each primitive is as follows: 1 for a point, 2 for a line, 3 for a triangle, 4 for a quadrilateral, and 3 for a polygon. Modes that require a certain multiple of vertices are GL_LINES (2), GL_TRIANGLES (3), GL_QUADS (4), and GL_QUAD_STRIP (2). Errors GL_INVALID_ENUM is generated if mode is set to an unaccepted value. GL_INVALID_OPERATION is generated if a command other than glVertex, glColor, glIndex, glNormal, glTexCoord, glEvalCoord, glEvalPoint, glMaterial, glEdgeFlag, glCallList, or glCallLists is executed between glBegin and the corresponding glEnd. GL_INVALID_OPERATION is generated if a glBegin is executed between a glBegin and the corresponding execution of glEnd. GL_INVALID_OPERATION is generated if glEnd is executed without being preceded by a glBegin. See Also glCallList, glCallLists, glColor, glEdgeFlag, glEvalCoord, glEvalPoint, glIndex, glMaterial, glNormal, glTexCoord, glVertex ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.5. glBitmap ═══ OpenGL man pages glBitmap Name glBitmap - draw a bitmap C Specification void glBitmap( GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap ) Parameters width, height Specify the pixel width and height of the bitmap image. xorig, yorig Specify the location of the origin in the bitmap image. The origin is measured from the lower left corner of the bitmap, with right and up being the positive axes. xmove, ymove Specify the x and y offsets to be added to the current raster position after the bitmap is drawn. bitmap Specifies the address of the bitmap image. Description A bitmap is a binary image. When drawn, the bitmap is positioned relative to the current raster position, and frame buffer pixels corresponding to ones in the bitmap are written using the current raster color or index. Frame buffer pixels corresponding to zeros in the bitmap are not modified. glBitmap takes seven arguments. The first pair specify the width and height of the bitmap image. The second pair specify the location of the bitmap origin relative to the lower left corner of the bitmap image. The third pair of arguments specify x and y offsets to be added to the current raster position after the bitmap has been drawn. The final argument is a pointer to the bitmap image itself. The bitmap image is interpreted like image data for the glDrawPixels command, with width and height corresponding to the width and height arguments of that command, and with type set to GL_BITMAP and format set to GL_COLOR_INDEX. Modes specified using glPixelStore affect the interpretation of bitmap image data; modes specified using glPixelTransfer do not. If the current raster position is invalid, glBitmap is ignored. Otherwise, the lower left corner of the bitmap image is positioned at the window coordinates x = floor (x - x ) w r o y = floor (y - y ) w r o where (x ,y ) is the raster position and (x ,y ) is the bitmap origin. r r o o Fragments are then generated for each pixel corresponding to a one in the bitmap image. These fragments are generated using the current raster z coordinate, color or color index, and current raster texture coordinates. They are then treated just as if they had been generated by a point, line, or polygon, including texture mapping, fogging, and all per-fragment operations such as alpha and depth testing. After the bitmap has been drawn, the x and y coordinates of the current raster position are offset by xmove and ymove. No change is made to the z coordinate of the current raster position, or to the current raster color, index, or texture coordinates. Errors GL_INVALID_VALUE is generated if width or height is negative. GL_INVALID_OPERATION is generated if glBitmap is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_CURRENT_RASTER_POSITION glGet with argument GL_CURRENT_RASTER_COLOR glGet with argument GL_CURRENT_RASTER_INDEX glGet with argument GL_CURRENT_RASTER_TEXTURE_COORDS glGet with argument GL_CURRENT_RASTER_POSITION_VALID See Also glDrawPixels, glRasterPos, glPixelStore, glPixelTransfer ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.6. glBlendFunc ═══ OpenGL man pages glBlendFunc Name glBlendFunc - specify pixel arithmetic C Specification void glBlendFunc( GLenum sfactor, GLenum dfactor ) Parameters sfactor Specifies how the red, green, blue, and alpha source blending factors are computed. Nine symbolic constants are accepted: GL_ZERO, GL_ONE, GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, and GL_SRC_ALPHA_SATURATE. dfactor Specifies how the red, green, blue, and alpha destination blending factors are computed. Eight symbolic constants are accepted: GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, and GL_ONE_MINUS_DST_ALPHA. Description In RGB mode, pixels can be drawn using a function that blends the incoming (source) RGBA values with the RGBA values that are already in the frame buffer (the destination values). By default, blending is disabled. Use glEnable and glDisable with argument GL_BLEND to enable and disable blending. glBlendFunc defines the operation of blending when it is enabled. sfactor specifies which of nine methods is used to scale the source color components. dfactor specifies which of eight methods is used to scale the destination color components. The eleven possible methods are described in the table below. Each method defines four scale factors, one each for red, green, blue, and alpha. In the table and in subsequent equations, source and destination color components are referred to as (R ,G ,B ,A ) and (R ,G ,B ,A ). They are s s s s d d d d understood to have integer values between zero and (k ,k ,k ,k ), where R G B A mc k = 2 - 1 c and (mR,mG,mB,mA) is the number of red, green, blue, and alpha bitplanes. Source and destination scale factors are referred to as (s ,s ,s ,s ) and R G B A (d ,d ,d ,d ). The scale factors described in the table, denoted R G B A (f ,f ,f ,f ), represent either source or destination factors. All scale R G B A factors have range [0,1]. ----------------------------------------------------------------------- | parameter | (f , f , f , f ) | | | R G B A | ----------------------------------------------------------------------- | | | | GL_ZERO | (0, 0, 0, 0) | | | | | GL_ONE | (1, 1, 1, 1) | | | | | GL_SRC_COLOR | (R /k , G /k , B /k , A /k ) | | | s R s G s B s A | | | | |GL_ONE_MINUS_SRC_COLOR | (1, 1, 1, 1) - (R /k , G /k , B /k , A /k ) | | | s R s G s B s A | | | | | GL_DST_COLOR | (R /k , G /k , B /k , A /k ) | | | d R d G d B d A | | | | |GL_ONE_MINUS_DST_COLOR | (1, 1, 1, 1) - (R /k , G /k , B /k , A /k ) | | | d R d G d B d A | | | | | GL_SRC_ALPHA | (A /k , A /k , A /k , A /k ) | | | s R s G s B s A | | | | | | | |GL_ONE_MINUS_SRC_ALPHA | (1, 1, 1, 1) - (A /k , A /k , A /k , A /k ) | | | s R s G s B s A | | | | | | | | GL_DST_ALPHA | (A /k , A /k , A /k , A /k ) | | | d R d G d B d A | | | | |GL_ONE_MINUS_DST_ALPHA | (1, 1, 1, 1) - (A /k , A /k , A /k , A /k ) | | | d R d G d B d A | | | | | | | |GL_SRC_ALPHA_SATURATE | (i, i, i, 1) | | | | ----------------------------------------------------------------------- In the table, i = min(A , k -A ) / k s A d A To determine the blended RGBA values of a pixel when drawing in RGB mode, the system uses the following equations: R = min(k , R s +R d ) d R s R d R G = min(k , G s +G d ) d G s G d G B = min(k , B s +B d ) d B s B d B A = min(k , A s +A d ) d A s A d A Despite the apparent precision of the above equations, blending arithmetic is not exactly specified, because blending operates with imprecise integer color values. However, a blend factor that should be equal to one is guaranteed not to modify its multiplicand, and a blend factor equal to zero reduces its multiplicand to zero. Thus, for example, when sfactor is GL_SRC_ALPHA, dfactor is GL_ONE_MINUS_SRC_ALPHA, and A is equal to k the s A equations reduce to simple replacement: R = R d s G = G d s B = B d s A = A d s Examples Transparency is best implemented using blend function (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) with primitives sorted from farthest to nearest. Note that this transparency calculation does not require the presence of alpha bitplanes in the frame buffer. Blend function (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) is also useful for rendering antialiased points and lines in arbitrary order. Polygon antialiasing is optimized using blend function (GL_SRC_ALPHA_SATURATE, GL_ONE) with polygons sorted from nearest to farthest. (See the glEnable, glDisable reference page and the GL_POLYGON_SMOOTH argument for information on polygon antialiasing.) Destination alpha bitplanes, which must be present for this blend function to operate correctly, store the accumulated coverage. Notes Incoming (source) alpha is correctly thought of as a material opacity, ranging from 1.0 (K ), representing complete opacity, to 0.0 (0), A representing complete transparency. When more than one color buffer is enabled for drawing, blending is done separately for each enabled buffer, using for destination color the contents of that buffer. (See glDrawBuffer.) Blending affects only RGB rendering. It is ignored by color index renderers. Errors GL_INVALID_ENUM is generated if either sfactor or dfactor is not an accepted value. GL_INVALID_OPERATION is generated if glBlendFunc is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_BLEND_SRC glGet with argument GL_BLEND_DST glIsEnabled with argument GL_BLEND See Also glAlphaFunc, glClear, glDrawBuffer, glEnable, glLogicOp, glStencilFunc ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.7. glCallList ═══ OpenGL man pages glCallList Name glCallList - execute a display list C Specification void glCallList( GLuint list ) Parameters list Specifies the integer name of the display list to be executed. Description glCallList causes the named display list to be executed. The commands saved in the display list are executed in order, just as if they were called without using a display list. If list has not been defined as a display list, glCallList is ignored. glCallList can appear inside a display list. To avoid the possibility of infinite recursion resulting from display lists calling one another, a limit is placed on the nesting level of display lists during display-list execution. This limit is at least 64, and it depends on the implementation. GL state is not saved and restored across a call to glCallList. Thus, changes made to GL state during the execution of a display list remain after execution of the display list is completed. Use glPushAttrib, glPopAttrib, glPushMatrix, and glPopMatrix to preserve GL state across glCallList calls. Notes Display lists can be executed between a call to glBegin and the corresponding call to glEnd, as long as the display list includes only commands that are allowed in this interval. Associated Gets glGet with argument GL_MAX_LIST_NESTING glIsList See Also glCallLists, glDeleteLists, glGenLists, glNewList, glPushAttrib, glPushMatrix ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.8. glCallLists ═══ OpenGL man pages glCallLists Name glCallLists - execute a list of display lists C Specification void glCallLists( GLsizei n, GLenum type, const GLvoid *lists ) Parameters n Specifies the number of display lists to be executed. type Specifies the type of values in lists. Symbolic constants GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT, GL_2_BYTES, GL_3_BYTES, and GL_4_BYTES are accepted. lists Specifies the address of an array of name offsets in the display list. The pointer type is void because the offsets can be bytes, shorts, ints, or floats, depending on the value of type. Description glCallLists causes each display list in the list of names passed as lists to be executed. As a result, the commands saved in each display list are executed in order, just as if they were called without using a display list. Names of display lists that have not been defined are ignored. glCallLists provides an efficient means for executing display lists. type allows lists with various name formats to be accepted. The formats are as follows: GL_BYTE lists is treated as an array of signed bytes, each in the range -128 through 127. GL_UNSIGNED_BYTE lists is treated as an array of unsigned bytes, each in the range 0 through 255. GL_SHORT lists is treated as an array of signed two-byte integers, each in the range -32768 through 32767. GL_UNSIGNED_SHORT lists is treated as an array of unsigned two-byte integers, each in the range 0 through 65535. GL_INT lists is treated as an array of signed four-byte integers. GL_UNSIGNED_INT lists is treated as an array of unsigned four-byte integers. GL_FLOAT lists is treated as an array of four-byte floating-point values. GL_2_BYTES lists is treated as an array of unsigned bytes. Each pair of bytes specifies a single display-list name. The value of the pair is computed as 256 times the unsigned value of the first byte plus the unsigned value of the second byte. GL_3_BYTES lists is treated as an array of unsigned bytes. Each triplet of bytes specifies a single display- list name. The value of the triplet is computed as 65536 times the unsigned value of the first byte, plus 256 times the unsigned value of the second byte, plus the unsigned value of the third byte. GL_4_BYTES lists is treated as an array of unsigned bytes. Each quadruplet of bytes specifies a single display-list name. The value of the quadruplet is computed as 16777216 times the unsigned value of the first byte, plus 65536 times the unsigned value of the second byte, plus 256 times the unsigned value of the third byte, plus the unsigned value of the fourth byte. The list of display list names is not null-terminated. Rather, n specifies how many names are to be taken from lists. An additional level of indirection is made available with the glListBase command, which specifies an unsigned offset that is added to each display- list name specified in lists before that display list is executed. glCallLists can appear inside a display list. To avoid the possibility of infinite recursion resulting from display lists calling one another, a limit is placed on the nesting level of display lists during display-list execution. This limit must be at least 64, and it depends on the implementation. GL state is not saved and restored across a call to glCallLists. Thus, changes made to GL state during the execution of the display lists remain after execution is completed. Use glPushAttrib, glPopAttrib, glPushMatrix, and glPopMatrix to preserve GL state across glCallLists calls. Notes Display lists can be executed between a call to glBegin and the corresponding call to glEnd, as long as the display list includes only commands that are allowed in this interval. Errors GL_INVALID_VALUE is generated if n is negative. GL_INVALID_ENUM is generated if type is not one of GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT, GL_2_BYTES, GL_3_BYTES, GL_4_BYTES. Associated Gets glGet with argument GL_LIST_BASE glGet with argument GL_MAX_LIST_NESTING glIsList See Also glCallList, glDeleteLists, glGenLists, glListBase, glNewList, glPushAttrib, glPushMatrix ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.9. glClear ═══ OpenGL man pages glClear Name glClear - clear buffers to preset values C Specification void glClear( GLbitfield mask ) Parameters mask Bitwise OR of masks that indicate the buffers to be cleared. The four masks are GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_ACCUM_BUFFER_BIT, and GL_STENCIL_BUFFER_BIT. Description glClear sets the bitplane area of the window to values previously selected by glClearColor, glClearIndex, glClearDepth, glClearStencil, and glClearAccum. Multiple color buffers can be cleared simultaneously by selecting more than one buffer at a time using glDrawBuffer. The pixel ownership test, the scissor test, dithering, and the buffer writemasks affect the operation of glClear. The scissor box bounds the cleared region. Alpha function, blend function, logical operation, stenciling, texture mapping, and z-buffering are ignored by glClear. glClear takes a single argument that is the bitwise OR of several values indicating which buffer is to be cleared. The values are as follows: GL_COLOR_BUFFER_BIT Indicates the buffers currently enabled for color writing. GL_DEPTH_BUFFER_BIT Indicates the depth buffer. GL_ACCUM_BUFFER_BIT Indicates the accumulation buffer. GL_STENCIL_BUFFER_BIT Indicates the stencil buffer. The value to which each buffer is cleared depends on the setting of the clear value for that buffer. Notes If a buffer is not present, then a glClear directed at that buffer has no effect. Errors GL_INVALID_VALUE is generated if any bit other than the four defined bits is set in mask. GL_INVALID_OPERATION is generated if glClear is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_ACCUM_CLEAR_VALUE glGet with argument GL_DEPTH_CLEAR_VALUE glGet with argument GL_INDEX_CLEAR_VALUE glGet with argument GL_COLOR_CLEAR_VALUE glGet with argument GL_STENCIL_CLEAR_VALUE See Also glClearAccum, glClearColor, glClearDepth, glClearIndex, glClearStencil, glDrawBuffer, glScissor ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.10. glClearAccum ═══ OpenGL man pages glClearAccum Name glClearAccum - specify clear values for the accumulation buffer C Specification void glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) Parameters red, green, blue, alpha Specify the red, green, blue, and alpha values used when the accumulation buffer is cleared. The default values are all zero. Description glClearAccum specifies the red, green, blue, and alpha values used by glClear to clear the accumulation buffer. Values specified by glClearAccum are clamped to the range [-1,1]. Errors GL_INVALID_OPERATION is generated if glClearAccum is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_ACCUM_CLEAR_VALUE See Also glClear ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.11. glClearColor ═══ OpenGL man pages glClearColor Name glClearColor - specify clear values for the color buffers C Specification void glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) Parameters red, green, blue, alpha Specify the red, green, blue, and alpha values used when the color buffers are cleared. The default values are all zero. Description glClearColor specifies the red, green, blue, and alpha values used by glClear to clear the color buffers. Values specified by glClearColor are clamped to the range [0,1]. Errors GL_INVALID_OPERATION is generated if glClearColor is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_COLOR_CLEAR_VALUE See Also glClear ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.12. glClearDepth ═══ OpenGL man pages glClearDepth Name glClearDepth - specify the clear value for the depth buffer C Specification void glClearDepth( GLclampd depth ) Parameters depth Specifies the depth value used when the depth buffer is cleared. Description glClearDepth specifies the depth value used by glClear to clear the depth buffer. Values specified by glClearDepth are clamped to the range [0,1]. Errors GL_INVALID_OPERATION is generated if glClearDepth is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_DEPTH_CLEAR_VALUE See Also glClear ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.13. glClearIndex ═══ OpenGL man pages glClearIndex Name glClearIndex - specify the clear value for the color index buffers C Specification void glClearIndex( GLfloat c ) Parameters c Specifies the index used when the color index buffers are cleared. The default value is zero. Description glClearIndex specifies the index used by glClear to clear the color index buffers. c is not clamped. Rather, c is converted to a fixed-point value with unspecified precision to the right of the binary point. The integer part of this value is then masked with 2m-1, where m is the number of bits in a color index stored in the frame buffer. Errors GL_INVALID_OPERATION is generated if glClearIndex is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_INDEX_CLEAR_VALUE glGet with argument GL_INDEX_BITS See Also glClear ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.14. glClearStencil ═══ OpenGL man pages glClearStencil Name glClearStencil - specify the clear value for the stencil buffer C Specification void glClearStencil( GLint s ) Parameters s Specifies the index used when the stencil buffer is cleared. The default value is zero. Description glClearStencil specifies the index used by glClear to clear the stencil buffer. s is masked with 2m-1, where m is the number of bits in the stencil buffer. Errors GL_INVALID_OPERATION is generated if glClearStencil is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_STENCIL_CLEAR_VALUE glGet with argument GL_STENCIL_BITS See Also glClear ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.15. glClipPlane ═══ OpenGL man pages glClipPlane Name glClipPlane - specify a plane against which all geometry is clipped C Specification void glClipPlane( GLenum plane, const GLdouble *equation ) Parameters plane Specifies which clipping plane is being positioned. Symbolic names of the form GL_CLIP_PLANEi, where i is an integer between 0 and GL_MAX_CLIP_PLANES -1, are accepted. equation Specifies the address of an array of four double-precision floating-point values. These values are interpreted as a plane equation. Description Geometry is always clipped against the boundaries of a six-plane frustum in x, y, and z. glClipPlane allows the specification of additional planes, not necessarily perpendicular to the x, y, or z axis, against which all geometry is clipped. Up to GL_MAX_CLIP_PLANES planes can be specified, where GL_MAX_CLIP_PLANES is at least six in all implementations. Because the resulting clipping region is the intersection of the defined half- spaces, it is always convex. glClipPlane specifies a half-space using a four-component plane equation. When glClipPlane is called, equation is transformed by the inverse of the modelview matrix and stored in the resulting eye coordinates. Subsequent changes to the modelview matrix have no effect on the stored plane-equation components. If the dot product of the eye coordinates of a vertex with the stored plane equation components is positive or zero, the vertex is in with respect to that clipping plane. Otherwise, it is out. Clipping planes are enabled and disabled with glEnable and glDisable, and called with the argument GL_CLIP_PLANEi, where i is the plane number. By default, all clipping planes are defined as (0,0,0,0) in eye coordinates and are disabled. Notes It is always the case that GL_CLIP_PLANEi = GL_CLIP_PLANE0 + i. Errors GL_INVALID_ENUM is generated if plane is not an accepted value. GL_INVALID_OPERATION is generated if glClipPlane is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGetClipPlane glIsEnabled with argument GL_CLIP_PLANEi See Also glEnable ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.16. glColor ═══ OpenGL man pages glColor Name glColor3b, glColor3d, glColor3f, glColor3i, glColor3s, glColor3ub, glColor3ui, glColor3us, glColor4b, glColor4d, glColor4f, glColor4i, glColor4s, glColor4ub, glColor4ui, glColor4us, glColor3bv, glColor3dv, glColor3fv, glColor3iv, glColor3sv, glColor3ubv, glColor3uiv, glColor3usv, glColor4bv, glColor4dv, glColor4fv, glColor4iv, glColor4sv, glColor4ubv, glColor4uiv, glColor4usv - set the current color C Specification void glColor3b( GLbyte red, GLbyte green, GLbyte blue ) void glColor3d( GLdouble red, GLdouble green, GLdouble blue ) void glColor3f( GLfloat red, GLfloat green, GLfloat blue ) void glColor3i( GLint red, GLint green, GLint blue ) void glColor3s( GLshort red, GLshort green, GLshort blue ) void glColor3ub( GLubyte red, GLubyte green, GLubyte blue ) void glColor3ui( GLuint red, GLuint green, GLuint blue ) void glColor3us( GLushort red, GLushort green, GLushort blue ) void glColor4b( GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha ) void glColor4d( GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha ) void glColor4f( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) void glColor4i( GLint red, GLint green, GLint blue, GLint alpha ) void glColor4s( GLshort red, GLshort green, GLshort blue, GLshort alpha ) void glColor4ub( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) void glColor4ui( GLuint red, GLuint green, GLuint blue, GLuint alpha ) void glColor4us( GLushort red, GLushort green, GLushort blue, GLushort alpha ) Parameters red, green, blue Specify new red, green, and blue values for the current color. alpha Specifies a new alpha value for the current color. Included only in the four-argument glColor4 command. C Specification void glColor3bv( const GLbyte *v ) void glColor3dv( const GLdouble *v ) void glColor3fv( const GLfloat *v ) void glColor3iv( const GLint *v ) void glColor3sv( const GLshort *v ) void glColor3ubv( const GLubyte *v ) void glColor3uiv( const GLuint *v ) void glColor3usv( const GLushort *v ) void glColor4bv( const GLbyte *v ) void glColor4dv( const GLdouble *v ) void glColor4fv( const GLfloat *v ) void glColor4iv( const GLint *v ) void glColor4sv( const GLshort *v ) void glColor4ubv( const GLubyte *v ) void glColor4uiv( const GLuint *v ) void glColor4usv( const GLushort *v ) Parameters v Specifies a pointer to an array that contains red, green, blue, and (sometimes) alpha values. Description The GL stores both a current single-valued color index and a current four- valued RGBA color. glColor sets a new four-valued RGBA color. glColor has two major variants: glColor3 and glColor4. glColor3 variants specify new red, green, and blue values explicitly, and set the current alpha value to 1.0 implicitly. glColor4 variants specify all four color components explicitly. glColor3b, glColor4b, glColor3s, glColor4s, glColor3i, and glColor4i take three or four signed byte, short, or long integers as arguments. When v is appended to the name, the color commands can take a pointer to an array of such values. Current color values are stored in floating-point format, with unspecified mantissa and exponent sizes. Unsigned integer color components, when specified, are linearly mapped to floating-point values such that the largest representable value maps to 1.0 (full intensity), and zero maps to 0.0 (zero intensity). Signed integer color components, when specified, are linearly mapped to floating-point values such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0. Floating-point values are mapped directly. Neither floating-point nor signed integer values are clamped to the range [0,1] before updating the current color. However, color components are clamped to this range before they are interpolated or written into a color buffer. Notes The current color can be updated at any time. In particular, glColor can be called between a call to glBegin and the corresponding call to glEnd. Associated Gets glGet with argument GL_CURRENT_COLOR glGet with argument GL_RGBA_MODE See Also glIndex ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.17. glColorMask ═══ OpenGL man pages glColorMask Name glColorMask - enable and disable writing of frame buffer color components C Specification void glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) Parameters red, green, blue, alpha Specify whether red, green, blue, and alpha can or cannot be written into the frame buffer. The default values are all GL_TRUE, indicating that the color components can be written. Description glColorMask specifies whether the individual color components in the frame buffer can or cannot be written. If red is GL_FALSE, for example, no change is made to the red component of any pixel in any of the color buffers, regardless of the drawing operation attempted. Changes to individual bits of components cannot be controlled. Rather, changes are either enabled or disabled for entire color components. Errors GL_INVALID_OPERATION is generated if glColorMask is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_COLOR_WRITEMASK glGet with argument GL_RGBA_MODE See Also glColor, glIndex, glIndexMask, glDepthMask, glStencilMask ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.18. glColorMaterial ═══ OpenGL man pages glColorMaterial Name glColorMaterial - cause a material color to track the current color C Specification void glColorMaterial( GLenum face, GLenum mode ) Parameters face Specifies whether front, back, or both front and back material parameters should track the current color. Accepted values are GL_FRONT, GL_BACK, and GL_FRONT_AND_BACK. The default value is GL_FRONT_AND_BACK. mode Specifies which of several material parameters track the current color. Accepted values are GL_EMISSION, GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, and GL_AMBIENT_AND_DIFFUSE. The default value is GL_AMBIENT_AND_DIFFUSE. Description glColorMaterial specifies which material parameters track the current color. When GL_COLOR_MATERIAL is enabled, the material parameter or parameters specified by mode, of the material or materials specified by face, track the current color at all times. GL_COLOR_MATERIAL is enabled and disabled using the commands glEnable and glDisable, called with GL_COLOR_MATERIAL as their argument. By default, it is disabled. Notes glColorMaterial allows a subset of material parameters to be changed for each vertex using only the glColor command, without calling glMaterial. If only such a subset of parameters is to be specified for each vertex, glColorMaterial is preferred over calling glMaterial. Call glColorMaterial before enabling the GL_COLOR_MATERIAL. Errors GL_INVALID_ENUM is generated if face or mode is not an accepted value. GL_INVALID_OPERATION is generated if glColorMaterial is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glIsEnabled with argument GL_COLOR_MATERIAL glGet with argument GL_COLOR_MATERIAL_PARAMETER glGet with argument GL_COLOR_MATERIAL_FACE See Also glColor, glEnable, glLight, glLightModel, glMaterial ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.19. glColorPointerEXT ═══ OpenGL man pages glColorPointerEXT Name glColorPointerEXT - define a array of colors C Specification void glColorPointerEXT( GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer ) Parameters size Specifies the number of components per color. It must be 3 or 4. type Specifies the data type of each color component in the array. Symbolic constants GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT, or GL_DOUBLE_EXT, are accepted. stride Specifies the byte offset between consecutive colors. If stride is zero the colors are understood to be tightly packed in the array. count Specifies the number of colors, counting from the first, that are static. pointer Specifies a pointer to the first component of the first color element in the array. Description glColorPointerEXT specifies the location and data format of an array of color components to use when rendering using the vertex array extension. size specifies the number of components per color, and must be 3 or 4. type specifies the data type of each color component and stride gives the byte stride from one color to the next allowing vertexes and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations.) count indicates the number of array elements (counting from the first) that are static. Static elements may be modified by the application, but once they are modified, the application must explicitly respecify the array before using it for any rendering. When a color array is specified, size, type, stride, count and pointer are saved as client-side state, and static array elements may be cached by the implementation. The color array is enabled and disabled using glEnable and glDisable with the argument GL_COLOR_ARRAY_EXT. If enabled, the color array is used when glDrawArraysEXT or glArrayElementEXT is called. Use glDrawArraysEXT to define a sequence of primitives (all of the same type) from pre-specified vertex and vertex attribute arrays. Use glArrayElementEXT to specify primitives by indexing vertexes and vertex attributes. Notes Non-static array elements are not accessed until glArrayElementEXT or glDrawArraysEXT is executed. By default the color array is disabled and it won't be accessed when glArrayElementEXT or glDrawArraysEXT is called. Although it is not an error to call glColorPointerEXT between the execution of glBegin and the corresponding execution of glEnd, the results are undefined. glColorPointerEXT will typically be implemented on the client side with no protocol. Since the color array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. glColorPointerEXT commands are not entered into display lists. glColorPointerEXT is part of the EXT_vertex_array extension, not part of the core GL command set. If "GL_EXT_vertex_array" is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension EXT_vertex_array is supported. Errors GL_INVALID_VALUE is generated if size is not 3 or 4. GL_INVALID_ENUM is generated if type is not an accepted value. GL_INVALID_VALUE is generated if stride or count is negative. Associated Gets glIsEnabled with argument GL_COLOR_ARRAY_EXT glGet with argument GL_COLOR_ARRAY_SIZE_EXT glGet with argument GL_COLOR_ARRAY_TYPE_EXT glGet with argument GL_COLOR_ARRAY_STRIDE_EXT glGet with argument GL_COLOR_ARRAY_COUNT_EXT glGetPointervEXT with argument GL_COLOR_ARRAY_POINTER_EXT See Also glArrayElementEXT, glDrawArraysEXT, glEdgeFlagPointerEXT, glGetPointervEXT, glIndexPointerEXT, glNormalPointerEXT, glTexCoordPointerEXT, glVertexPointerEXT, glEnable ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.20. glCopyPixels ═══ OpenGL man pages glCopyPixels Name glCopyPixels - copy pixels in the frame buffer C Specification void glCopyPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum type ) Parameters x, y Specify the window coordinates of the lower left corner of the rectangular region of pixels to be copied. width, height Specify the dimensions of the rectangular region of pixels to be copied. Both must be nonnegative. type Specifies whether color values, depth values, or stencil values are to be copied. Symbolic constants GL_COLOR, GL_DEPTH, and GL_STENCIL are accepted. Description glCopyPixels copies a screen-aligned rectangle of pixels from the specified frame buffer location to a region relative to the current raster position. Its operation is well defined only if the entire pixel source region is within the exposed portion of the window. Results of copies from outside the window, or from regions of the window that are not exposed, are hardware dependent and undefined. x and y specify the window coordinates of the lower left corner of the rectangular region to be copied. width and height specify the dimensions of the rectangular region to be copied. Both width and height must not be negative. Several parameters control the processing of the pixel data while it is being copied. These parameters are set with three commands: glPixelTransfer, glPixelMap, and glPixelZoom. This reference page describes the effects on glCopyPixels of most, but not all, of the parameters specified by these three commands. glCopyPixels copies values from each pixel with the lower left-hand corner at (x + i, y + j) for 0<=i= |dy|, i pixels are filled in each column that is rasterized, where i is the rounded value of width. Otherwise, i pixels are filled in each row that is rasterized. If antialiasing is enabled, line rasterization produces a fragment for each pixel square that intersects the region lying within the rectangle having width equal to the current line width, length equal to the actual length of the line, and centered on the mathematical line segment. The coverage value for each fragment is the window coordinate area of the intersection of the rectangular region with the corresponding pixel square. This value is saved and used in the final rasterization step. Not all widths can be supported when line antialiasing is enabled. If an unsupported width is requested, the nearest supported width is used. Only width 1.0 is guaranteed to be supported; others depend on the implementation. The range of supported widths and the size difference between supported widths within the range can be queried by calling glGet with arguments GL_LINE_WIDTH_RANGE and GL_LINE_WIDTH_GRANULARITY. Notes The line width specified by glLineWidth is always returned when GL_LINE_WIDTH is queried. Clamping and rounding for aliased and antialiased lines have no effect on the specified value. Non-antialiased line width may be clamped to an implementation-dependent maximum. Although this maximum cannot be queried, it must be no less than the maximum value for antialiased lines, rounded to the nearest integer value. Errors GL_INVALID_VALUE is generated if width is less than or equal to zero. GL_INVALID_OPERATION is generated if glLineWidth is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_LINE_WIDTH glGet with argument GL_LINE_WIDTH_RANGE glGet with argument GL_LINE_WIDTH_GRANULARITY glIsEnabled with argument GL_LINE_SMOOTH See Also glEnable, glLineSmooth ═══ 3.68. glListBase ═══ OpenGL man pages glListBase Name glListBase - set the display-list base for glCallLists C Specification void glListBase( GLuint base ) Parameters base Specifies an integer offset that will be added to glCallLists offsets to generate display-list names. Initial value is zero. Description glCallLists specifies an array of offsets. Display-list names are generated by adding base to each offset. Names that reference valid display lists are executed; the others are ignored. Errors GL_INVALID_OPERATION is generated if glListBase is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_LIST_BASE See Also glCallLists ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.69. glLoadIdentity ═══ OpenGL man pages glLoadIdentity Name glLoadIdentity - replace the current matrix with the identity matrix C Specification void glLoadIdentity( void ) Description glLoadIdentity replaces the current matrix with the identity matrix. It is semantically equivalent to calling glLoadMatrix with the identity matrix | 1 0 0 0 | | | | 0 1 0 0 | | 0 0 1 0 | | | | 0 0 0 1 | but in some cases it is more efficient. Errors GL_INVALID_OPERATION is generated if glLoadIdentity is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_MATRIX_MODE glGet with argument GL_MODELVIEW_MATRIX glGet with argument GL_PROJECTION_MATRIX glGet with argument GL_TEXTURE_MATRIX See Also glLoadMatrix, glMatrixMode, glMultMatrix, glPushMatrix ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.70. glLoadMatrix ═══ OpenGL man pages glLoadMatrix Name glLoadMatrixd, glLoadMatrixf - replace the current matrix with an arbitrary matrix C Specification void glLoadMatrixd( const GLdouble *m ) void glLoadMatrixf( const GLfloat *m ) Parameters m Specifies a pointer to a 4x4 matrix stored in column-major order as sixteen consecutive values. Description glLoadMatrix replaces the current matrix with the one specified in m. The current matrix is the projection matrix, modelview matrix, or texture matrix, determined by the current matrix mode (see glMatrixMode). m points to a 4x4 matrix of single- or double-precision floating-point values stored in column-major order. That is, the matrix is stored as follows: |a0 a4 a8 a12| | | |a1 a5 a9 a13| | | |a2 a6 a10 a14| | | |a3 a7 a11 a15| | | Errors GL_INVALID_OPERATION is generated if glLoadMatrix is called between a call to glBegin and the corresponding call to glEnd. Associated Gets glGet with argument GL_MATRIX_MODE glGet with argument GL_MODELVIEW_MATRIX glGet with argument GL_PROJECTION_MATRIX glGet with argument GL_TEXTURE_MATRIX See Also glLoadIdentity, glMatrixMode, glMultMatrix, glPushMatrix ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.71. glLoadName ═══ OpenGL man pages glLoadName Name glLoadName - load a name onto the name stack C Specification void glLoadName( GLuint name ) Parameters name Specifies a name that will replace the top value on the name stack. Description The name stack is used during selection mode to allow sets of rendering commands to be uniquely identified. It consists of an ordered set of unsigned integers. glLoadName causes name to replace the value on the top of the name stack, which is initially empty. The name stack is always empty while the render mode is not GL_SELECT. Calls to glLoadName while the render mode is not GL_SELECT are ignored. Errors GL_INVALID_OPERATION is generated if glLoadName is called while the name stack is empty. GL_INVALID_OPERATION is generated if glLoadName is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_NAME_STACK_DEPTH glGet with argument GL_MAX_NAME_STACK_DEPTH See Also glInitNames, glPushName, glRenderMode, glSelectBuffer ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.72. glLogicOp ═══ OpenGL man pages glLogicOp Name glLogicOp - specify a logical pixel operation for color index rendering C Specification void glLogicOp( GLenum opcode ) Parameters opcode Specifies a symbolic constant that selects a logical operation. The following symbols are accepted: GL_CLEAR, GL_SET, GL_COPY, GL_COPY_INVERTED, GL_NOOP, GL_INVERT, GL_AND, GL_NAND, GL_OR, GL_NOR, GL_XOR, GL_EQUIV, GL_AND_REVERSE, GL_AND_INVERTED, GL_OR_REVERSE, and GL_OR_INVERTED. Description glLogicOp specifies a logical operation that, when enabled, is applied between the incoming color index and the color index at the corresponding location in the frame buffer. The logical operation is enabled or disabled with glEnable and glDisable using the symbolic constant GL_LOGIC_OP. opcode is a symbolic constant chosen from the list below. In the explanation of the logical operations, s represents the incoming color index and d represents the index in the frame buffer. Standard C-language operators are used. As these bitwise operators suggest, the logical operation is applied independently to each bit pair of the source and destination indices. ------------------------------------ | opcode | resulting value | ------------------------------------ | GL_CLEAR | 0 | | GL_SET | 1 | | GL_COPY | s | |GL_COPY_INVERTED | !s | | GL_NOOP | d | | GL_INVERT | !d | | GL_AND | s & d | | GL_NAND | !(s & d) | | GL_OR | s | d | | GL_NOR | !(s | d) | | GL_XOR | s ^ d | | GL_EQUIV | !(s ^ d) | | GL_AND_REVERSE | s & !d | |GL_AND_INVERTED | !s & d | | GL_OR_REVERSE | s | !d | | GL_OR_INVERTED | !s | d | ------------------------------------ Notes Logical pixel operations are not applied to RGBA color buffers. When more than one color index buffer is enabled for drawing, logical operations are done separately for each enabled buffer, using for the destination index the contents of that buffer (see glDrawBuffer). opcode must be one of the sixteen accepted values. Other values result in an error. Errors GL_INVALID_ENUM is generated if opcode is not an accepted value. GL_INVALID_OPERATION is generated if glLogicOp is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_LOGIC_OP_MODE glIsEnabled with argument GL_LOGIC_OP See Also glAlphaFunc, glBlendFunc, glDrawBuffer, glEnable, glStencilOp ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.73. glMap1 ═══ OpenGL man pages glMap1 Name glMap1d, glMap1f - define a one-dimensional evaluator C Specification void glMap1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points ) void glMap1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points ) Parameters target Specifies the kind of values that are generated by the evaluator. Symbolic constants GL_MAP1_VERTEX_3, GL_MAP1_VERTEX_4, GL_MAP1_INDEX, GL_MAP1_COLOR_4, GL_MAP1_NORMAL, GL_MAP1_TEXTURE_COORD_1, GL_MAP1_TEXTURE_COORD_2, GL_MAP1_TEXTURE_COORD_3, and GL_MAP1_TEXTURE_COORD_4 are accepted. u1, u2 Specify a linear mapping of u, as presented to glEvalCoord1, to u, the variable that is evaluated by the equations specified by this command. stride Specifies the number of floats or doubles between the beginning of one control point and the beginning of the next one in the data structure referenced in points. This allows control points to be embedded in arbitrary data structures. The only constraint is that the values for a particular control point must occupy contiguous memory locations. order Specifies the number of control points. Must be positive. points Specifies a pointer to the array of control points. Description Evaluators provide a way to use polynomial or rational polynomial mapping to produce vertices, normals, texture coordinates, and colors. The values produced by an evaluator are sent to further stages of GL processing just as if they had been presented using glVertex, glNormal, glTexCoord, and glColor commands, except that the generated values do not update the current normal, texture coordinates, or color. All polynomial or rational polynomial splines of any degree (up to the maximum degree supported by the GL implementation) can be described using evaluators. These include almost all splines used in computer graphics, including B-splines, Bezier curves, Hermite splines, and so on. Evaluators define curves based on Bernstein polynomials. Define p(u) as n --- \ n p(u) = \ B (u)R / i i / --- i=0 n where R is a control point and B (u) is the ith Bernstein polynomial of i i degree n (order = n+1): n |n| i n-i B (u) = | | u (1-u) i |i| Recall that 0 |n| 0 = 1 and | | = 1 |0| glMap1 is used to define the basis and to specify what kind of values are produced. Once defined, a map can be enabled and disabled by calling glEnable and glDisable with the map name, one of the nine predefined values for target described below. glEvalCoord1 evaluates the one-dimensional maps that are enabled. When glEvalCoord1 presents a value u, the Bernstein functions are evaluated using u, where u - u1 u = ------- u2 - u1 target is a symbolic constant that indicates what kind of control points are provided in points, and what output is generated when the map is evaluated. It can assume one of nine predefined values: GL_MAP1_VERTEX_3 Each control point is three floating-point values representing x, y, and z. Internal glVertex3 commands are generated when the map is evaluated. GL_MAP1_VERTEX_4 Each control point is four floating-point values representing x, y, z, and w. Internal glVertex4 commands are generated when the map is evaluated. GL_MAP1_INDEX Each control point is a single floating-point value representing a color index. Internal glIndex commands are generated when the map is evaluated. The current index is not updated with the value of these glIndex commands, however. GL_MAP1_COLOR_4 Each control point is four floating-point values representing red, green, blue, and alpha. Internal glColor4 commands are generated when the map is evaluated. The current color is not updated with the value of these glColor4 commands, however. GL_MAP1_NORMAL Each control point is three floating-point values representing the x, y, and z components of a normal vector. Internal glNormal commands are generated when the map is evaluated. The current normal is not updated with the value of these glNormal commands, however. GL_MAP1_TEXTURE_COORD_1 Each control point is a single floating-point value representing the s texture coordinate. Internal glTexCoord1 commands are generated when the map is evaluated. The current texture coordinates are not updated with the value of these glTexCoord commands, however. GL_MAP1_TEXTURE_COORD_2 Each control point is two floating-point values representing the s and t texture coordinates. Internal glTexCoord2 commands are generated when the map is evaluated. The current texture coordinates are not updated with the value of these glTexCoord commands, however. GL_MAP1_TEXTURE_COORD_3 Each control point is three floating-point values representing the s, t, and r texture coordinates. Internal glTexCoord3 commands are generated when the map is evaluated. The current texture coordinates are not updated with the value of these glTexCoord commands, however. GL_MAP1_TEXTURE_COORD_4 Each control point is four floating-point values representing the s, t, r, and q texture coordinates. Internal glTexCoord4 commands are generated when the map is evaluated. The current texture coordinates are not updated with the value of these glTexCoord commands, however. stride, order, and points define the array addressing for accessing the control points. points is the location of the first control point, which occupies one, two, three, or four contiguous memory locations, depending on which map is being defined. order is the number of control points in the array. stride tells how many float or double locations to advance the internal memory pointer to reach the next control point. Notes As is the case with all GL commands that accept pointers to data, it is as if the contents of points were copied by glMap1 before it returned. Changes to the contents of points have no effect after glMap1 is called. Errors GL_INVALID_ENUM is generated if target is not an accepted value. GL_INVALID_VALUE is generated if u1 is equal to u2. GL_INVALID_VALUE is generated if stride is less than the number of values in a control point. GL_INVALID_VALUE is generated if order is less than one or greater than GL_MAX_EVAL_ORDER. GL_INVALID_OPERATION is generated if glMap1 is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGetMap glGet with argument GL_MAX_EVAL_ORDER glIsEnabled with argument GL_MAP1_VERTEX_3 glIsEnabled with argument GL_MAP1_VERTEX_4 glIsEnabled with argument GL_MAP1_INDEX glIsEnabled with argument GL_MAP1_COLOR_4 glIsEnabled with argument GL_MAP1_NORMAL glIsEnabled with argument GL_MAP1_TEXTURE_COORD_1 glIsEnabled with argument GL_MAP1_TEXTURE_COORD_2 glIsEnabled with argument GL_MAP1_TEXTURE_COORD_3 glIsEnabled with argument GL_MAP1_TEXTURE_COORD_4 See Also glBegin, glColor, glEnable, glEvalCoord, glEvalMesh, glEvalPoint, glMap2, glMapGrid, glNormal, glTexCoord, glVertex ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.74. glMap2 ═══ OpenGL man pages glMap2 Name glMap2d, glMap2f - define a two-dimensional evaluator C Specification void glMap2d( GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points ) void glMap2f( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points ) Parameters target Specifies the kind of values that are generated by the evaluator. Symbolic constants GL_MAP2_VERTEX_3, GL_MAP2_VERTEX_4, GL_MAP2_INDEX, GL_MAP2_COLOR_4, GL_MAP2_NORMAL, GL_MAP2_TEXTURE_COORD_1, GL_MAP2_TEXTURE_COORD_2, GL_MAP2_TEXTURE_COORD_3, and GL_MAP2_TEXTURE_COORD_4 are accepted. u1, u2 Specify a linear mapping of u, as presented to glEvalCoord2, to u, one of the two variables that is evaluated by the equations specified by this command. ustride Specifies the number of floats or doubles between the beginning of control point R and the beginning of control point R , ij (i+1) j where i and j are the u and v control point indices, respectively. This allows control points to be embedded in arbitrary data structures. The only constraint is that the values for a particular control point must occupy contiguous memory locations. uorder Specifies the dimension of the control point array in the u axis. Must be positive. v1, v2 Specify a linear mapping of v, as presented to glEvalCoord2, to v, one of the two variables that is evaluated by the equations specified by this command. vstride Specifies the number of floats or doubles between the beginning of control point R and the beginning of control point R , ij (i+1) j where i and j are the u and v control point indices, respectively. This allows control points to be embedded in arbitrary data structures. The only constraint is that the values for a particular control point must occupy contiguous memory locations. vorder Specifies the dimension of the control point array in the v axis. Must be positive. points Specifies a pointer to the array of control points. Description Evaluators provide a way to use polynomial or rational polynomial mapping to produce vertices, normals, texture coordinates, and colors. The values produced by an evaluator are sent on to further stages of GL processing just as if they had been presented using glVertex, glNormal, glTexCoord, and glColor commands, except that the generated values do not update the current normal, texture coordinates, or color. All polynomial or rational polynomial splines of any degree (up to the maximum degree supported by the GL implementation) can be described using evaluators. These include almost all surfaces used in computer graphics, including B-spline surfaces, NURBS surfaces, Bezier surfaces, and so on. Evaluators define surfaces based on bivariate Bernstein polynomials. Define p(u,v) as n m --- --- \ \ n m p(u,v) = \ \ B (u)B (v) R / / i j ij / / --- --- i=0 j=0 n where R is a control point, B (u) is the ith Bernstein polynomial of ij i degree n (uorder = n+1) n |n| i n-i B (u) = | |u (1-u) i |i| m and B (v') is the jth Bernstein polynomial of degree m (vorder = m+1) j m |m| j m-j B (v) = | |v (1-v) j |j| Recall that 0 |n| 0 = 1 and | | = 1 |0| glMap2 is used to define the basis and to specify what kind of values are produced. Once defined, a map can be enabled and disabled by calling glEnable and glDisable with the map name, one of the nine predefined values for target, described below. When glEvalCoord2 presents values u and v, the bivariate Bernstein polynomials are evaluated using u and v, where u - u1 u = ------- u2 - u1 v - v1 v = ------- v2 - v1 target is a symbolic constant that indicates what kind of control points are provided in points, and what output is generated when the map is evaluated. It can assume one of nine predefined values: GL_MAP2_VERTEX_3 Each control point is three floating-point values representing x, y, and z. Internal glVertex3 commands are generated when the map is evaluated. GL_MAP2_VERTEX_4 Each control point is four floating-point values representing x, y, z, and w. Internal glVertex4 commands are generated when the map is evaluated. GL_MAP2_INDEX Each control point is a single floating-point value representing a color index. Internal glIndex commands are generated when the map is evaluated. The current index is not updated with the value of these glIndex commands, however. GL_MAP2_COLOR_4 Each control point is four floating-point values representing red, green, blue, and alpha. Internal glColor4 commands are generated when the map is evaluated. The current color is not updated with the value of these glColor4 commands, however. GL_MAP2_NORMAL Each control point is three floating-point values representing the x, y, and z components of a normal vector. Internal glNormal commands are generated when the map is evaluated. The current normal is not updated with the value of these glNormal commands, however. GL_MAP2_TEXTURE_COORD_1 Each control point is a single floating-point value representing the s texture coordinate. Internal glTexCoord1 commands are generated when the map is evaluated. The current texture coordinates are not updated with the value of these glTexCoord commands, however. GL_MAP2_TEXTURE_COORD_2 Each control point is two floating-point values representing the s and t texture coordinates. Internal glTexCoord2 commands are generated when the map is evaluated. The current texture coordinates are not updated with the value of these glTexCoord commands, however. GL_MAP2_TEXTURE_COORD_3 Each control point is three floating-point values representing the s, t, and r texture coordinates. Internal glTexCoord3 commands are generated when the map is evaluated. The current texture coordinates are not updated with the value of these glTexCoord commands, however. GL_MAP2_TEXTURE_COORD_4 Each control point is four floating-point values representing the s, t, r, and q texture coordinates. Internal glTexCoord4 commands are generated when the map is evaluated. The current texture coordinates are not updated with the value of these glTexCoord commands, however. ustride, uorder, vstride, vorder, and points define the array addressing for accessing the control points. points is the location of the first control point, which occupies one, two, three, or four contiguous memory locations, depending on which map is being defined. There are uorderxvorder control points in the array. ustride tells how many float or double locations are skipped to advance the internal memory pointer from control point R to control point R . vstride tells how many float ij (i+1)j or double locations are skipped to advance the internal memory pointer from control point R to control point R . ij i(j+1) Notes As is the case with all GL commands that accept pointers to data, it is as if the contents of points were copied by glMap2 before it returned. Changes to the contents of points have no effect after glMap2 is called. Errors GL_INVALID_ENUM is generated if target is not an accepted value. GL_INVALID_VALUE is generated if u1 is equal to u2, or if v1 is equal to v2. GL_INVALID_VALUE is generated if either ustride or vstride is less than the number of values in a control point. GL_INVALID_VALUE is generated if either uorder or vorder is less than one or greater than GL_MAX_EVAL_ORDER. GL_INVALID_OPERATION is generated if glMap2 is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGetMap glGet with argument GL_MAX_EVAL_ORDER glIsEnabled with argument GL_MAP2_VERTEX_3 glIsEnabled with argument GL_MAP2_VERTEX_4 glIsEnabled with argument GL_MAP2_INDEX glIsEnabled with argument GL_MAP2_COLOR_4 glIsEnabled with argument GL_MAP2_NORMAL glIsEnabled with argument GL_MAP2_TEXTURE_COORD_1 glIsEnabled with argument GL_MAP2_TEXTURE_COORD_2 glIsEnabled with argument GL_MAP2_TEXTURE_COORD_3 glIsEnabled with argument GL_MAP2_TEXTURE_COORD_4 See Also glBegin, glColor, glEnable, glEvalCoord, glEvalMesh, glEvalPoint, glMap1, glMapGrid, glNormal, glTexCoord, glVertex ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.75. glMapGrid ═══ OpenGL man pages glMapGrid Name glMapGrid1d, glMapGrid1f, glMapGrid2d, glMapGrid2f - define a one- or two- dimensional mesh C Specification void glMapGrid1d( GLint un, GLdouble u1, GLdouble u2 ) void glMapGrid1f( GLint un, GLfloat u1, GLfloat u2 ) void glMapGrid2d( GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2 ) void glMapGrid2f( GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2 ) Parameters un Specifies the number of partitions in the grid range interval [u1, u2]. Must be positive. u1, u2 Specify the mappings for integer grid domain values i=0 and i=un. vn Specifies the number of partitions in the grid range interval [v1, v2] (glMapGrid2 only). v1, v2 Specify the mappings for integer grid domain values j=0 and j=vn (glMapGrid2 only). Description glMapGrid and glEvalMesh are used in tandem to efficiently generate and evaluate a series of evenly spaced map domain values. glEvalMesh steps through the integer domain of a one- or two-dimensional grid, whose range is the domain of the evaluation maps specified by glMap1 and glMap2. glMapGrid1 and glMapGrid2 specify the linear grid mappings between the i (or i and j) integer grid coordinates, to the u (or u and v) floating-point evaluation map coordinates. See glMap1 and glMap2 for details of how u and v coordinates are evaluated. glMapGrid1 specifies a single linear mapping such that integer grid coordinate 0 maps exactly to u1, and integer grid coordinate un maps exactly to u2. All other integer grid coordinates i are mapped such that u = i(u2-u1)/un + u1 glMapGrid2 specifies two such linear mappings. One maps integer grid coordinate i=0 exactly to u1, and integer grid coordinate i=un exactly to u2. The other maps integer grid coordinate j=0 exactly to v1, and integer grid coordinate j=vn exactly to v2. Other integer grid coordinates i and j are mapped such that u = i(u2-u1)/un + u1 v = j(v2-v1)/vn + v1 The mappings specified by glMapGrid are used identically by glEvalMesh and glEvalPoint. Errors GL_INVALID_VALUE is generated if either un or vn is not positive. GL_INVALID_OPERATION is generated if glMapGrid is called between a call to glBegin and the corresponding call to glEnd. Associated Gets glGet with argument GL_MAP1_GRID_DOMAIN glGet with argument GL_MAP2_GRID_DOMAIN glGet with argument GL_MAP1_GRID_SEGMENTS glGet with argument GL_MAP2_GRID_SEGMENTS See Also glEvalCoord, glEvalMesh, glEvalPoint, glMap1, glMap2 ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.76. glMaterial ═══ OpenGL man pages glMaterial Name glMaterialf, glMateriali, glMaterialfv, glMaterialiv - specify material parameters for the lighting model C Specification void glMaterialf( GLenum face, GLenum pname, GLfloat param ) void glMateriali( GLenum face, GLenum pname, GLint param ) Parameters face Specifies which face or faces are being updated. Must be one of GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK. pname Specifies the single-valued material parameter of the face or faces that is being updated. Must be GL_SHININESS. param Specifies the value that parameter GL_SHININESS will be set to. C Specification void glMaterialfv( GLenum face, GLenum pname, const GLfloat *params ) void glMaterialiv( GLenum face, GLenum pname, const GLint *params ) Parameters face Specifies which face or faces are being updated. Must be one of GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK. pname Specifies the material parameter of the face or faces that is being updated. Must be one of GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION, GL_SHININESS, GL_AMBIENT_AND_DIFFUSE, or GL_COLOR_INDEXES. params Specifies a pointer to the value or values that pname will be set to. Description glMaterial assigns values to material parameters. There are two matched sets of material parameters. One, the front-facing set, is used to shade points, lines, bitmaps, and all polygons (when two-sided lighting is disabled), or just front-facing polygons (when two-sided lighting is enabled). The other set, back-facing, is used to shade back-facing polygons only when two-sided lighting is enabled. Refer to the glLightModel reference page for details concerning one- and two-sided lighting calculations. glMaterial takes three arguments. The first, face, specifies whether the GL_FRONT materials, the GL_BACK materials, or both GL_FRONT_AND_BACK materials will be modified. The second, pname, specifies which of several parameters in one or both sets will be modified. The third, params, specifies what value or values will be assigned to the specified parameter. Material parameters are used in the lighting equation that is optionally applied to each vertex. The equation is discussed in the glLightModel reference page. The parameters that can be specified using glMaterial, and their interpretations by the lighting equation, are as follows: GL_AMBIENT params contains four integer or floating-point values that specify the ambient RGBA reflectance of the material. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0. Floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The default ambient reflectance for both front- and back- facing materials is (0.2, 0.2, 0.2, 1.0). GL_DIFFUSE params contains four integer or floating-point values that specify the diffuse RGBA reflectance of the material. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0. Floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The default diffuse reflectance for both front- and back- facing materials is (0.8, 0.8, 0.8, 1.0). GL_SPECULAR params contains four integer or floating-point values that specify the specular RGBA reflectance of the material. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0. Floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The default specular reflectance for both front- and back- facing materials is (0.0, 0.0, 0.0, 1.0). GL_EMISSION params contains four integer or floating-point values that specify the RGBA emitted light intensity of the material. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0. Floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The default emission intensity for both front- and back- facing materials is (0.0, 0.0, 0.0, 1.0). GL_SHININESS params is a single integer or floating-point value that specifies the RGBA specular exponent of the material. Integer and floating-point values are mapped directly. Only values in the range [0,128] are accepted. The default specular exponent for both front- and back- facing materials is 0. GL_AMBIENT_AND_DIFFUSE Equivalent to calling glMaterial twice with the same parameter values, once with GL_AMBIENT and once with GL_DIFFUSE. GL_COLOR_INDEXES params contains three integer or floating-point values specifying the color indices for ambient, diffuse, and specular lighting. These three values, and GL_SHININESS, are the only material values used by the color index mode lighting equation. Refer to the glLightModel reference page for a discussion of color index lighting. Notes The material parameters can be updated at any time. In particular, glMaterial can be called between a call to glBegin and the corresponding call to glEnd. If only a single material parameter is to be changed per vertex, however, glColorMaterial is preferred over glMaterial (see glColorMaterial). Errors GL_INVALID_ENUM is generated if either face or pname is not an accepted value. GL_INVALID_VALUE is generated if a specular exponent outside the range [0,128] is specified. Associated Gets glGetMaterial See Also glColorMaterial, glLight, glLightModel ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.77. glMatrixMode ═══ OpenGL man pages glMatrixMode Name glMatrixMode - specify which matrix is the current matrix C Specification void glMatrixMode( GLenum mode ) Parameters mode Specifies which matrix stack is the target for subsequent matrix operations. Three values are accepted: GL_MODELVIEW, GL_PROJECTION, and GL_TEXTURE. The default value is GL_MODELVIEW. Description glMatrixMode sets the current matrix mode. mode can assume one of three values: GL_MODELVIEW Applies subsequent matrix operations to the modelview matrix stack. GL_PROJECTION Applies subsequent matrix operations to the projection matrix stack. GL_TEXTURE Applies subsequent matrix operations to the texture matrix stack. Errors GL_INVALID_ENUM is generated if mode is not an accepted value. GL_INVALID_OPERATION is generated if glMatrixMode is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_MATRIX_MODE See Also glLoadMatrix, glPushMatrix ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.78. glMultMatrix ═══ OpenGL man pages glMultMatrix Name glMultMatrixd, glMultMatrixf - multiply the current matrix by an arbitrary matrix C Specification void glMultMatrixd( const GLdouble *m ) void glMultMatrixf( const GLfloat *m ) Parameters m Specifies a pointer a to 4x4 matrix stored in column-major order as sixteen consecutive values. Description glMultMatrix multiplies the current matrix with the one specified in m. That is, if M is the current matrix and T is the matrix passed to glMultMatrix, then M is replaced with M ╖ T. The current matrix is the projection matrix, modelview matrix, or texture matrix, determined by the current matrix mode (see glMatrixMode). m points to a 4x4 matrix of single- or double-precision floating-point values stored in column-major order. That is, the matrix is stored as |a0 a4 a8 a12| | | |a1 a5 a9 a13| | | |a2 a6 a10 a14| | | |a3 a7 a11 a15| Errors GL_INVALID_OPERATION is generated if glMultMatrix is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_MATRIX_MODE glGet with argument GL_MODELVIEW_MATRIX glGet with argument GL_PROJECTION_MATRIX glGet with argument GL_TEXTURE_MATRIX See Also glMatrixMode, glLoadIdentity, glLoadMatrix, glPushMatrix ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.79. glNewList ═══ OpenGL man pages glNewList Name glNewList, glEndList - create or replace a display list C Specification void glNewList( GLuint list, GLenum mode ) Parameters list Specifies the display list name. mode Specifies the compilation mode, which can be GL_COMPILE or GL_COMPILE_AND_EXECUTE. C Specification void glEndList( void ) Description Display lists are groups of GL commands that have been stored for subsequent execution. The display lists are created with glNewList. All subsequent commands are placed in the display list, in the order issued, until glEndList is called. glNewList has two arguments. The first argument, list, is a positive integer that becomes the unique name for the display list. Names can be created and reserved with glGenLists and tested for uniqueness with glIsList. The second argument, mode, is a symbolic constant that can assume one of two values: GL_COMPILE Commands are merely compiled. GL_COMPILE_AND_EXECUTE Commands are executed as they are compiled into the display list. Certain commands are not compiled into the display list, but are executed immediately, regardless of the display-list mode. These commands are glIsList, glGenLists, glDeleteLists, glFeedbackBuffer, glSelectBuffer, glRenderMode, glReadPixels, glPixelStore, glFlush, glFinish, glIsEnabled, and all of the glGet routines. When glEndList is encountered, the display-list definition is completed by associating the list with the unique name list (specified in the glNewList command). If a display list with name list already exists, it is replaced only when glEndList is called. Notes glCallList and glCallLists can be entered into display lists. The commands in the display list or lists executed by glCallList or glCallLists are not included in the display list being created, even if the list creation mode is GL_COMPILE_AND_EXECUTE. A display list is just a group of commands and arguments, so errors generated by commands in a display list must be generated when the list is executed. If the list is created in GL_COMPILE mode, errors are not generated until the list is executed. Errors GL_INVALID_VALUE is generated if list is zero. GL_INVALID_ENUM is generated if mode is not an accepted value. GL_INVALID_OPERATION is generated if glEndList is called without a preceding glNewList, or if glNewList is called while a display list is being defined. GL_INVALID_OPERATION is generated if glNewList or glEndList is executed between the execution of glBegin and the corresponding execution of glEnd. GL_OUT_OF_MEMORY is generated if there is insufficient memory to compile the display list. Associated Gets glIsList See Also glCallList, glCallLists, glDeleteLists, glGenLists ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.80. glNormal ═══ OpenGL man pages glNormal Name glNormal3b, glNormal3d, glNormal3f, glNormal3i, glNormal3s, glNormal3bv, glNormal3dv, glNormal3fv, glNormal3iv, glNormal3sv - set the current normal vector C Specification void glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz ) void glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz ) void glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz ) void glNormal3i( GLint nx, GLint ny, GLint nz ) void glNormal3s( GLshort nx, GLshort ny, GLshort nz ) Parameters nx, ny, nz Specify the x, y, and z coordinates of the new current normal. The initial value of the current normal is (0,0,1). C Specification void glNormal3bv( const GLbyte *v ) void glNormal3dv( const GLdouble *v ) void glNormal3fv( const GLfloat *v ) void glNormal3iv( const GLint *v ) void glNormal3sv( const GLshort *v ) Parameters v Specifies a pointer to an array of three elements: the x, y, and z coordinates of the new current normal. Description The current normal is set to the given coordinates whenever glNormal is issued. Byte, short, or integer arguments are converted to floating-point format with a linear mapping that maps the most positive representable integer value to 1.0, and the most negative representable integer value to -1.0. Normals specified with glNormal need not have unit length. If normalization is enabled, then normals specified with glNormal are normalized after transformation. Normalization is controlled using glEnable and glDisable with the argument GL_NORMALIZE. By default, normalization is disabled. Notes The current normal can be updated at any time. In particular, glNormal can be called between a call to glBegin and the corresponding call to glEnd. Associated Gets glGet with argument GL_CURRENT_NORMAL glIsEnable with argument GL_NORMALIZE See Also glBegin, glColor, glIndex, glTexCoord, glVertex ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.81. glNormalPointerEXT ═══ OpenGL man pages glNormalPointerEXT Name glNormalPointerEXT - define a array of normals C Specification void glNormalPointerEXT( GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer ) Parameters type Specifies the the data type of each coordinate in the array. Symbolic constants GL_BYTE, GL_SHORT, GL_INT, GL_FLOAT, or GL_DOUBLE_EXT are accepted. stride Specifies the byte offset between consecutive normals. count Specifies the number of normals, counting from the first, that are static. pointer Specifies a pointer to the first coordinate of the first normal in the array. Description glNormalPointerEXT specifies the location and data format of an array of normals to use when rendering using the vertex array extension. type specifies the data type of the normal coordinates and stride gives the byte stride from one normal to the next allowing vertexes and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations.) count indicates the number of array elements (counting from the first) that are static. Static elements may be modified by the application, but once they are modified, the application must explicitly respecify the array before using it for any rendering. When a normal array is specified, type, stride, count and pointer are saved as client-side state, and static array elements may be cached by the implementation. The normal array is enabled and disabled using glEnable and glDisable with the argument GL_NORMAL_ARRAY_EXT. If enabled, the normal array is used when glDrawArraysEXT or glArrayElementEXT is called. Use glDrawArraysEXT to define a sequence of primitives (all of the same type) from pre-specified vertex and vertex attribute arrays. Use glArrayElementEXT to specify primitives by indexing vertexes and vertex attributes. Notes Non-static array elements are not accessed until glArrayElementEXT or glDrawArraysEXT is executed. By default the normal array is disabled and it won't be accessed when glArrayElementEXT or glDrawArraysEXT is called. Although it is not an error to call glNormalPointerEXT between the execution of glBegin and the corresponding execution of glEnd, the results are undefined. glNormalPointerEXT will typically be implemented on the client side with no protocol. Since the normal array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. glNormalPointerEXT commands are not entered into display lists. glNormalPointerEXT is part of the EXT_vertex_array extension, not part of the core GL command set. If "GL_EXT_vertex_array" is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension EXT_vertex_array is supported. Errors GL_INVALID_ENUM is generated if type is not an accepted value. GL_INVALID_VALUE is generated if stride or count is negative. Associated Gets glIsEnabled with argument GL_NORMAL_ARRAY_EXT glGet with argument GL_NORMAL_ARRAY_TYPE_EXT glGet with argument GL_NORMAL_ARRAY_STRIDE_EXT glGet with argument GL_NORMAL_ARRAY_COUNT_EXT glGetPointervEXT with argument GL_NORMAL_ARRAY_POINTER_EXT See Also glArrayElementEXT, glColorPointerEXT, glDrawArraysEXT, glEdgeFlagPointerEXT, glGetPointervEXT, glIndexPointerEXT, glTexCoordPointerEXT, glVertexPointerEXT, glEnable ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.82. glOrtho ═══ OpenGL man pages glOrtho Name glOrtho - multiply the current matrix by an orthographic matrix C Specification void glOrtho( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far ) Parameters left, right Specify the coordinates for the left and right vertical clipping planes. bottom, top Specify the coordinates for the bottom and top horizontal clipping planes. near, far Specify the distances to the nearer and farther depth clipping planes. These distances are negative if the plane is to be behind the viewer. Description glOrtho describes a perspective matrix that produces a parallel projection. (left, bottom, -near) and (right, top, -near) specify the points on the near clipping plane that are mapped to the lower left and upper right corners of the window, respectively, assuming that the eye is located at (0, 0, 0). -far specifies the location of the far clipping plane. Both near and far can be either positive or negative. The corresponding matrix is | 2 | |---------- 0 0 t | |right-left x | | | | 2 | | 0 ---------- 0 t | | top-bottom y | | | | | | 0 0 -2 | | -------- t | | far-near z | | | | 0 0 0 1 | where right+left t = - ---------- x right-left top+bottom t = - ---------- y top-bottom far+near t = - -------- z far-near The current matrix is multiplied by this matrix with the result replacing the current matrix. That is, if M is the current matrix and O is the ortho matrix, then M is replaced with M ╖ O. Use glPushMatrix and glPopMatrix to save and restore the current matrix stack. Errors GL_INVALID_OPERATION is generated if glOrtho is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_MATRIX_MODE glGet with argument GL_MODELVIEW_MATRIX glGet with argument GL_PROJECTION_MATRIX glGet with argument GL_TEXTURE_MATRIX See Also glFrustum, glMatrixMode, glMultMatrix, glPushMatrix, glViewport ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.83. glPassThrough ═══ OpenGL man pages glPassThrough Name glPassThrough - place a marker in the feedback buffer C Specification void glPassThrough( GLfloat token ) Parameters token Specifies a marker value to be placed in the feedback buffer following a GL_PASS_THROUGH_TOKEN. Description Feedback is a GL render mode. The mode is selected by calling glRenderMode with GL_FEEDBACK. When the GL is in feedback mode, no pixels are produced by rasterization. Instead, information about primitives that would have been rasterized is fed back to the application using the GL. See glFeedbackBuffer for a description of the feedback buffer and the values in it. glPassThrough inserts a user-defined marker in the feedback buffer when it is executed in feedback mode. token is returned as if it were a primitive; it is indicated with its own unique identifying value: GL_PASS_THROUGH_TOKEN. The order of glPassThrough commands with respect to the specification of graphics primitives is maintained. Notes glPassThrough is ignored if the GL is not in feedback mode. Errors GL_INVALID_OPERATION is generated if glPassThrough is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_RENDER_MODE See Also glFeedbackBuffer, glRenderMode ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.84. glPixelMap ═══ OpenGL man pages glPixelMap Name glPixelMapfv, glPixelMapuiv, glPixelMapusv - set up pixel transfer maps C Specification void glPixelMapfv( GLenum map, GLint mapsize, const GLfloat *values ) void glPixelMapuiv( GLenum map, GLint mapsize, const GLuint *values ) void glPixelMapusv( GLenum map, GLint mapsize, const GLushort *values ) Parameters map Specifies a symbolic map name. Must be one of the following: GL_PIXEL_MAP_I_TO_I, GL_PIXEL_MAP_S_TO_S, GL_PIXEL_MAP_I_TO_R, GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B, GL_PIXEL_MAP_I_TO_A, GL_PIXEL_MAP_R_TO_R, GL_PIXEL_MAP_G_TO_G, GL_PIXEL_MAP_B_TO_B, or GL_PIXEL_MAP_A_TO_A. mapsize Specifies the size of the map being defined. values Specifies an array of mapsize values. Description glPixelMap sets up translation tables, or maps, used by glDrawPixels, glReadPixels, glCopyPixels, glTexImage1D, and glTexImage2D. Use of these maps is described completely in the glPixelTransfer reference page, and partly in the reference pages for the pixel and texture image commands. Only the specification of the maps is described in this reference page. map is a symbolic map name, indicating one of ten maps to set. mapsize specifies the number of entries in the map, and values is a pointer to an array of mapsize map values. The ten maps are as follows: GL_PIXEL_MAP_I_TO_I Maps color indices to color indices. GL_PIXEL_MAP_S_TO_S Maps stencil indices to stencil indices. GL_PIXEL_MAP_I_TO_R Maps color indices to red components. GL_PIXEL_MAP_I_TO_G Maps color indices to green components. GL_PIXEL_MAP_I_TO_B Maps color indices to blue components. GL_PIXEL_MAP_I_TO_A Maps color indices to alpha components. GL_PIXEL_MAP_R_TO_R Maps red components to red components. GL_PIXEL_MAP_G_TO_G Maps green components to green components. GL_PIXEL_MAP_B_TO_B Maps blue components to blue components. GL_PIXEL_MAP_A_TO_A Maps alpha components to alpha components. The entries in a map can be specified as single-precision floating-point numbers, unsigned short integers, or unsigned long integers. Maps that store color component values (all but GL_PIXEL_MAP_I_TO_I and GL_PIXEL_MAP_S_TO_S) retain their values in floating-point format, with unspecified mantissa and exponent sizes. Floating-point values specified by glPixelMapfv are converted directly to the internal floating-point format of these maps, then clamped to the range [0,1]. Unsigned integer values specified by glPixelMapusv and glPixelMapuiv are converted linearly such that the largest representable integer maps to 1.0, and zero maps to 0.0. Maps that store indices, GL_PIXEL_MAP_I_TO_I and GL_PIXEL_MAP_S_TO_S, retain their values in fixed-point format, with an unspecified number of bits to the right of the binary point. Floating-point values specified by glPixelMapfv are converted directly to the internal fixed-point format of these maps. Unsigned integer values specified by glPixelMapusv and glPixelMapuiv specify integer values, with all zeros to the right of the binary point. The table below shows the initial sizes and values for each of the maps. Maps that are indexed by either color or stencil indices must have mapsize = 2n for some n or results are undefined. The maximum allowable size for each map depends on the implementation and can be determined by calling glGet with argument GL_MAX_PIXEL_MAP_TABLE. The single maximum applies to all maps, and it is at least 32. -------------------------------------------------------------------------------------- | map | lookup index | lookup value | initial size | initial value | -------------------------------------------------------------------------------------- |GL_PIXEL_MAP_I_TO_I | color index | color index | 1 | 0.0 | |GL_PIXEL_MAP_S_TO_S | stencil index | stencil index | 1 | 0 | |GL_PIXEL_MAP_I_TO_R | color index | R | 1 | 0.0 | |GL_PIXEL_MAP_I_TO_G | color index | G | 1 | 0.0 | |GL_PIXEL_MAP_I_TO_B | color index | B | 1 | 0.0 | |GL_PIXEL_MAP_I_TO_A | color index | A | 1 | 0.0 | |GL_PIXEL_MAP_R_TO_R | R | R | 1 | 0.0 | |GL_PIXEL_MAP_G_TO_G | G | G | 1 | 0.0 | |GL_PIXEL_MAP_B_TO_B | B | B | 1 | 0.0 | |GL_PIXEL_MAP_A_TO_A | A | A | 1 | 0.0 | -------------------------------------------------------------------------------------- Errors GL_INVALID_ENUM is generated if map is not an accepted value. GL_INVALID_VALUE is generated if mapsize is negative or larger than GL_MAX_PIXEL_MAP_TABLE. GL_INVALID_VALUE is generated if map is GL_PIXEL_MAP_I_TO_I, GL_PIXEL_MAP_S_TO_S, GL_PIXEL_MAP_I_TO_R, GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B, or GL_PIXEL_MAP_I_TO_A, and mapsize is not a power of two. GL_INVALID_OPERATION is generated if glPixelMap is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGetPixelMap glGet with argument GL_PIXEL_MAP_I_TO_I_SIZE glGet with argument GL_PIXEL_MAP_S_TO_S_SIZE glGet with argument GL_PIXEL_MAP_I_TO_R_SIZE glGet with argument GL_PIXEL_MAP_I_TO_G_SIZE glGet with argument GL_PIXEL_MAP_I_TO_B_SIZE glGet with argument GL_PIXEL_MAP_I_TO_A_SIZE glGet with argument GL_PIXEL_MAP_R_TO_R_SIZE glGet with argument GL_PIXEL_MAP_G_TO_G_SIZE glGet with argument GL_PIXEL_MAP_B_TO_B_SIZE glGet with argument GL_PIXEL_MAP_A_TO_A_SIZE glGet with argument GL_MAX_PIXEL_MAP_TABLE See Also glCopyPixels, glDrawPixels, glPixelStore, glPixelTransfer, glReadPixels, glTexImage1D, glTexImage2D ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.85. glPixelStore ═══ OpenGL man pages glPixelStore Name glPixelStoref, glPixelStorei - set pixel storage modes C Specification void glPixelStoref( GLenum pname, GLfloat param ) void glPixelStorei( GLenum pname, GLint param ) Parameters pname Specifies the symbolic name of the parameter to be set. Six values affect the packing of pixel data into memory: GL_PACK_SWAP_BYTES, GL_PACK_LSB_FIRST, GL_PACK_ROW_LENGTH, GL_PACK_SKIP_PIXELS, GL_PACK_SKIP_ROWS, and GL_PACK_ALIGNMENT. Six more affect the unpacking of pixel data from memory: GL_UNPACK_SWAP_BYTES, GL_UNPACK_LSB_FIRST, GL_UNPACK_ROW_LENGTH, GL_UNPACK_SKIP_PIXELS, GL_UNPACK_SKIP_ROWS, and GL_UNPACK_ALIGNMENT. param Specifies the value that pname is set to. Description glPixelStore sets pixel storage modes that affect the operation of subsequent glDrawPixels and glReadPixels as well as the unpacking of polygon stipple patterns (see glPolygonStipple), bitmaps (see glBitmap), and texture patterns (see glTexImage1D and glTexImage2D). pname is a symbolic constant indicating the parameter to be set, and param is the new value. Six of the twelve storage parameters affect how pixel data is returned to client memory, and are therefore significant only for glReadPixels commands. They are as follows: GL_PACK_SWAP_BYTES If true, byte ordering for multibyte color components, depth components, color indices, or stencil indices is reversed. That is, if a four-byte component is made up of bytes b , b , b , b , 0 1 2 3 it is stored in memory as b , b , b , b if GL_PACK_SWAP_BYTES is 3 2 1 0 true. GL_PACK_SWAP_BYTES has no effect on the memory order of components within a pixel, only on the order of bytes within components or indices. For example, the three components of a GL_RGB format pixel are always stored with red first, green second, and blue third, regardless of the value of GL_PACK_SWAP_BYTES. GL_PACK_LSB_FIRST If true, bits are ordered within a byte from least significant to most significant; otherwise, the first bit in each byte is the most significant one. This parameter is significant for bitmap data only. GL_PACK_ROW_LENGTH If greater than zero, GL_PACK_ROW_LENGTH defines the number of pixels in a row. If the first pixel of a row is placed at location p in memory, then the location of the first pixel of the next row is obtained by skipping k = nl if s >= a snl k = a/s╖ceil( --- ) if s < a a components or indices, where n is the number of components or indices in a pixel, l is the number of pixels in a row (GL_PACK_ROW_LENGTH if it is greater than zero, the width argument to the pixel routine otherwise), a is the value of GL_PACK_ALIGNMENT, and s is the size, in bytes, of a single component (if a= a snl k = a/s╖ceil( --- ) if s < a a components or indices, where n is the number of components or indices in a pixel, l is the number of pixels in a row (GL_UNPACK_ROW_LENGTH if it is greater than zero, the width argument to the pixel routine otherwise), a is the value of GL_UNPACK_ALIGNMENT, and s is the size, in bytes, of a single component (if a ( stencil & mask ). GL_GEQUAL Passes if ( ref & mask ) >= ( stencil & mask ). GL_EQUAL Passes if ( ref & mask ) = ( stencil & mask ). GL_NOTEQUAL Passes if ( ref & mask ) != ( stencil & mask ). GL_ALWAYS Always passes. Notes Initially, the stencil test is disabled. If there is no stencil buffer, no stencil modification can occur and it is as if the stencil test always passes. Errors GL_INVALID_ENUM is generated if func is not one of the eight accepted values. GL_INVALID_OPERATION is generated if glStencilFunc is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_STENCIL_FUNC glGet with argument GL_STENCIL_VALUE_MASK glGet with argument GL_STENCIL_REF glGet with argument GL_STENCIL_BITS glIsEnabled with argument GL_STENCIL_TEST See Also glAlphaFunc, glBlendFunc, glDepthFunc, glEnable, glIsEnabled, glLogicOp, glStencilOp ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.105. glStencilMask ═══ OpenGL man pages glStencilMask Name glStencilMask - control the writing of individual bits in the stencil planes C Specification void glStencilMask( GLuint mask ) Parameters mask Specifies a bit mask to enable and disable writing of individual bits in the stencil planes. Initially, the mask is all ones. Description glStencilMask controls the writing of individual bits in the stencil planes. The least significant n bits of mask, where n is the number of bits in the stencil buffer, specify a mask. Wherever a one appears in the mask, the corresponding bit in the stencil buffer is made writable. Where a zero appears, the bit is write-protected. Initially, all bits are enabled for writing. Errors GL_INVALID_OPERATION is generated if glStencilMask is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_STENCIL_WRITEMASK glGet with argument GL_STENCIL_BITS See Also glColorMask, glDepthMask, glIndexMask, glStencilFunc, glStencilOp ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.106. glStencilOp ═══ OpenGL man pages glStencilOp Name glStencilOp - set stencil test actions C Specification void glStencilOp( GLenum fail, GLenum zfail, GLenum zpass ) Parameters fail Specifies the action to take when the stencil test fails. Six symbolic constants are accepted: GL_KEEP, GL_ZERO, GL_REPLACE, GL_INCR, GL_DECR, and GL_INVERT. zfail Specifies stencil action when the stencil test passes, but the depth test fails. zfail accepts the same symbolic constants as fail. zpass Specifies stencil action when both the stencil test and the depth test pass, or when the stencil test passes and either there is no depth buffer or depth testing is not enabled. zpass accepts the same symbolic constants as fail. Description Stenciling, like z-buffering, enables and disables drawing on a per-pixel basis. You draw into the stencil planes using GL drawing primitives, then render geometry and images, using the stencil planes to mask out portions of the screen. Stenciling is typically used in multipass rendering algorithms to achieve special effects, such as decals, outlining, and constructive solid geometry rendering. The stencil test conditionally eliminates a pixel based on the outcome of a comparison between the value in the stencil buffer and a reference value. The test is enabled with glEnable and glDisable calls with argument GL_STENCIL_TEST, and controlled with glStencilFunc. glStencilOp takes three arguments that indicate what happens to the stored stencil value while stenciling is enabled. If the stencil test fails, no change is made to the pixel's color or depth buffers, and fail specifies what happens to the stencil buffer contents. The six possible actions are as follows: GL_KEEP Keeps the current value. GL_ZERO Sets the stencil buffer value to zero. GL_REPLACE Sets the stencil buffer value to ref, as specified by glStencilFunc. GL_INCR Increments the current stencil buffer value. Clamps to the maximum representable unsigned value. GL_DECR Decrements the current stencil buffer value. Clamps to zero. GL_INVERT Bitwise inverts the current stencil buffer value. Stencil buffer values are treated as unsigned integers. When incremented and decremented, values are clamped to 0 and 2n-1, where n is the value returned by querying GL_STENCIL_BITS. The other two arguments to glStencilOp specify stencil buffer actions should subsequent depth buffer tests succeed (zpass) or fail (zfail). (See glDepthFunc.) They are specified using the same six symbolic constants as fail. Note that zfail is ignored when there is no depth buffer, or when the depth buffer is not enabled. In these cases, fail and zpass specify stencil action when the stencil test fails and passes, respectively. Notes Initially the stencil test is disabled. If there is no stencil buffer, no stencil modification can occur and it is as if the stencil tests always pass, regardless of any call to glStencilOp. Errors GL_INVALID_ENUM is generated if fail, zfail, or zpass is any value other than the six defined constant values. GL_INVALID_OPERATION is generated if glStencilOp is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_STENCIL_FAIL glGet with argument GL_STENCIL_PASS_DEPTH_PASS glGet with argument GL_STENCIL_PASS_DEPTH_FAIL glGet with argument GL_STENCIL_BITS glIsEnabled with argument GL_STENCIL_TEST See Also glAlphaFunc, glBlendFunc, glDepthFunc, glEnable, glLogicOp, glStencilFunc ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.107. glTexCoord ═══ OpenGL man pages glTexCoord Name glTexCoord1d, glTexCoord1f, glTexCoord1i, glTexCoord1s, glTexCoord2d, glTexCoord2f, glTexCoord2i, glTexCoord2s, glTexCoord3d, glTexCoord3f, glTexCoord3i, glTexCoord3s, glTexCoord4d, glTexCoord4f, glTexCoord4i, glTexCoord4s, glTexCoord1dv, glTexCoord1fv, glTexCoord1iv, glTexCoord1sv, glTexCoord2dv, glTexCoord2fv, glTexCoord2iv, glTexCoord2sv, glTexCoord3dv, glTexCoord3fv, glTexCoord3iv, glTexCoord3sv, glTexCoord4dv, glTexCoord4fv, glTexCoord4iv, glTexCoord4sv - set the current texture coordinates C Specification void glTexCoord1d( GLdouble s ) void glTexCoord1f( GLfloat s ) void glTexCoord1i( GLint s ) void glTexCoord1s( GLshort s ) void glTexCoord2d( GLdouble s, GLdouble t ) void glTexCoord2f( GLfloat s, GLfloat t ) void glTexCoord2i( GLint s, GLint t ) void glTexCoord2s( GLshort s, GLshort t ) void glTexCoord3d( GLdouble s, GLdouble t, GLdouble r ) void glTexCoord3f( GLfloat s, GLfloat t, GLfloat r ) void glTexCoord3i( GLint s, GLint t, GLint r ) void glTexCoord3s( GLshort s, GLshort t, GLshort r ) void glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q ) void glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q ) void glTexCoord4i( GLint s, GLint t, GLint r, GLint q ) void glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q ) Parameters s, t, r, q Specify s, t, r, and q texture coordinates. Not all parameters are present in all forms of the command. C Specification void glTexCoord1dv( const GLdouble *v ) void glTexCoord1fv( const GLfloat *v ) void glTexCoord1iv( const GLint *v ) void glTexCoord1sv( const GLshort *v ) void glTexCoord2dv( const GLdouble *v ) void glTexCoord2fv( const GLfloat *v ) void glTexCoord2iv( const GLint *v ) void glTexCoord2sv( const GLshort *v ) void glTexCoord3dv( const GLdouble *v ) void glTexCoord3fv( const GLfloat *v ) void glTexCoord3iv( const GLint *v ) void glTexCoord3sv( const GLshort *v ) void glTexCoord4dv( const GLdouble *v ) void glTexCoord4fv( const GLfloat *v ) void glTexCoord4iv( const GLint *v ) void glTexCoord4sv( const GLshort *v ) Parameters v Specifies a pointer to an array of one, two, three, or four elements, which in turn specify the s, t, r, and q texture coordinates. Description The current texture coordinates are part of the data that is associated with each vertex and with the current raster position. They are set with glTexCoord. glTexCoord specifies texture coordinates in one, two, three, or four dimensions. glTexCoord1 sets the current texture coordinates to (s, 0, 0, 1); a call to glTexCoord2 sets them to (s, t, 0, 1). Similarly, glTexCoord3 specifies the texture coordinates as (s, t, r, 1), and glTexCoord4 defines all four components explicitly as (s, t, r, q). Notes The current texture coordinates can be updated at any time. In particular, glTexCoord can be called between a call to glBegin and the corresponding call to glEnd. Associated Gets glGet with argument GL_CURRENT_TEXTURE_COORDS See Also glVertex ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.108. glTexCoordPointerEXT ═══ OpenGL man pages glTexCoordPointerEXT Name glTexCoordPointerEXT - define an array of texture coordinates C Specification void glTexCoordPointerEXT( GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer ) Parameters size Specifies the number of coordinates per array element. It must be 1, 2, 3 or 4. type Specifies the data type of each texture coordinate. Symbolic constants GL_SHORT, GL_INT, GL_FLOAT, or GL_DOUBLE_EXT, are accepted. stride Specifies the byte offset between consecutive array elements. If stride is zero the array elements are understood to be tightly packed. count Specifies the number of array elements, counting from the first, that are static. pointer Specifies a pointer to the first coordinate of the first element in the array. Description glTexCoordPointerEXT specifies the location and data format of an array of texture coordinates to use when rendering using the vertex array extension. size specifies the number of coordinates per element, and must be 1, 2, 3, or 4. type specifies the data type of each texture coordinate and stride gives the byte stride from one array element to the next allowing vertexes and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations.) count indicates the number of array elements (counting from the first) that are static. Static elements may be modified by the application, but once they are modified, the application must explicitly respecify the array before using it for any rendering. When a texture coordinate array is specified, size, type, stride, count, and pointer are saved as client-side state, and static array elements may be cached by the implementation. The texture coordinate array is enabled and disabled using glEnable and glDisable with the argument GL_TEXTURE_COORD_ARRAY_EXT. If enabled, the texture coordinate array is used when glDrawArraysEXT or glArrayElementEXT is called. Use glDrawArraysEXT to define a sequence of primitives (all of the same type) from pre-specified vertex and vertex attribute arrays. Use glArrayElementEXT to specify primitives by indexing vertexes and vertex attributes. Notes Non-static array elements are not accessed until glArrayElementEXT or glDrawArraysEXT is executed. By default the texture coordinate array is disabled and it won't be accessed when glArrayElementEXT or glDrawArraysEXT is called. Although it is not an error to call glTexCoordPointerEXT between the execution of glBegin and the corresponding execution of glEnd, the results are undefined. glTexCoordPointerEXT will typically be implemented on the client side with no protocol. Since the texture coordinate array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. glTexCoordPointerEXT commands are not entered into display lists. glTexCoordPointerEXT is part of the EXT_vertex_array extension, not part of the core GL command set. If "GL_EXT_vertex_array" is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension EXT_vertex_array is supported. Errors GL_INVALID_VALUE is generated if size is not 1, 2, 3, or 4. GL_INVALID_ENUM is generated if type is not an accepted value. GL_INVALID_VALUE is generated if stride or count is negative Associated Gets glIsEnabled with argument GL_TEXTURE_COORD_ARRAY_EXT glGet with argument GL_TEXTURE_COORD_ARRAY_SIZE_EXT glGet with argument GL_TEXTURE_COORD_ARRAY_TYPE_EXT glGet with argument GL_TEXTURE_COORD_ARRAY_STRIDE_EXT glGet with argument GL_TEXTURE_COORD_ARRAY_COUNT_EXT glGetPointervEXT with argument GL_TEXTURE_COORD_ARRAY_POINTER_EXT See Also glArrayElementEXT, glColorPointerEXT, glDrawArraysEXT, glEdgeFlagPointerEXT, glGetPointervEXT, glIndexPointerEXT, glNormalPointerEXT, glVertexPointerEXT, glEnable ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.109. glTexEnv ═══ OpenGL man pages glTexEnv Name glTexEnvf, glTexEnvi, glTexEnvfv, glTexEnviv - set texture environment parameters C Specification void glTexEnvf( GLenum target, GLenum pname, GLfloat param ) void glTexEnvi( GLenum target, GLenum pname, GLint param ) Parameters target Specifies a texture environment. Must be GL_TEXTURE_ENV. pname Specifies the symbolic name of a single-valued texture environment parameter. Must be GL_TEXTURE_ENV_MODE. param Specifies a single symbolic constant, one of GL_MODULATE, GL_DECAL, or GL_BLEND. C Specification void glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params ) void glTexEnviv( GLenum target, GLenum pname, const GLint *params ) Parameters target Specifies a texture environment. Must be GL_TEXTURE_ENV. pname Specifies the symbolic name of a texture environment parameter. Accepted values are GL_TEXTURE_ENV_MODE and GL_TEXTURE_ENV_COLOR. params Specifies a pointer to an array of parameters: either a single symbolic constant or an RGBA color. Description A texture environment specifies how texture values are interpreted when a fragment is textured. target must be GL_TEXTURE_ENV. pname can be either GL_TEXTURE_ENV_MODE or GL_TEXTURE_ENV_COLOR. If pname is GL_TEXTURE_ENV_MODE, then params is (or points to) the symbolic name of a texture function. Three texture functions are defined: GL_MODULATE, GL_DECAL, and GL_BLEND A texture function acts on the fragment to be textured using the texture image value that applies to the fragment (see glTexParameter) and produces an RGBA color for that fragment. The following table shows how the RGBA color is produced for each of the three texture functions that can be chosen. C is a triple of color values (RGB) and A is the associated alpha value. RGBA values extracted from a texture image are in the range [0,1]. The subscript f refers to the incoming fragment, the subscript t to the texture image, the subscript c to the texture environment color, and subscript v indicates a value produced by the texture function. A texture image can have up to four components per texture element (see glTexImage1D and glTexImage2D). In a one-component image, L indicates t that single component. A two-component image uses L and A . A three- t t component image has only a color value, C . A four-component image has t both a color value C and an alpha value A . t t ---------------------------------------------------------------- | number of || texture functions | |components || GL_MODULATE GL_DECAL GL_BLEND | ---------------------------------------------------------------- | || C =L C | | C =(1-L )C +L C | | 1 || v t f | undefined | v t f t c | | || A =A | | A =A | | || v f | | v f | |-----------||------------|------------------|------------------| | || C =L C | | C =(1-L )C +L C | | 2 || v t f | undefined | v t f t c | | || A =A A | | A =A A | | || v t f | | v t f | |-----------||------------|------------------|------------------| | || C =C C | C =C | | | 3 || v t f | v t | undefined | | || A =A | A =A | | | || v f | v f | | |-----------||------------|------------------|------------------| | || C =C C | C =(1-A )C +A C | | | 4 || v t f | v t f t t | undefined | | || A =A A | A =A | | | || v t f | v f | | ---------------------------------------------------------------- If pname is GL_TEXTURE_ENV_COLOR, params is a pointer to an array that holds an RGBA color consisting of four values. Integer color components are interpreted linearly such that the most positive integer maps to 1.0, and the most negative integer maps to -1.0. The values are clamped to the range [0,1] when they are specified. C takes these four values. c GL_TEXTURE_ENV_MODE defaults to GL_MODULATE and GL_TEXTURE_ENV_COLOR defaults to (0,0,0,0). Errors GL_INVALID_ENUM is generated when target or pname is not one of the accepted defined values, or when params should have a defined constant value (based on the value of pname) and does not. GL_INVALID_OPERATION is generated if glTexEnv is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGetTexEnv See Also glTexImage1D, glTexImage2D, glTexParameter ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.110. glTexGen ═══ OpenGL man pages glTexGen Name glTexGend, glTexGenf, glTexGeni, glTexGendv, glTexGenfv, glTexGeniv - control the generation of texture coordinates C Specification void glTexGend( GLenum coord, GLenum pname, GLdouble param ) void glTexGenf( GLenum coord, GLenum pname, GLfloat param ) void glTexGeni( GLenum coord, GLenum pname, GLint param ) Parameters coord Specifies a texture coordinate. Must be one of the following: GL_S, GL_T, GL_R, or GL_Q. pname Specifies the symbolic name of the texture-coordinate generation function. Must be GL_TEXTURE_GEN_MODE. param Specifies a single-valued texture generation parameter, one of GL_OBJECT_LINEAR, GL_EYE_LINEAR, or GL_SPHERE_MAP. C Specification void glTexGendv( GLenum coord, GLenum pname, const GLdouble *params ) void glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) void glTexGeniv( GLenum coord, GLenum pname, const GLint *params ) Parameters coord Specifies a texture coordinate. Must be one of the following: GL_S, GL_T, GL_R, or GL_Q. pname Specifies the symbolic name of the texture-coordinate generation function or function parameters. Must be GL_TEXTURE_GEN_MODE, GL_OBJECT_PLANE, or GL_EYE_PLANE. params Specifies a pointer to an array of texture generation parameters. If pname is GL_TEXTURE_GEN_MODE, then the array must contain a single symbolic constant, one of GL_OBJECT_LINEAR, GL_EYE_LINEAR, or GL_SPHERE_MAP. Otherwise, params holds the coefficients for the texture-coordinate generation function specified by pname. Description glTexGen selects a texture-coordinate generation function or supplies coefficients for one of the functions. coord names one of the (s,t,r,q) texture coordinates, and it must be one of these symbols: GL_S, GL_T, GL_R, or GL_Q. pname must be one of three symbolic constants: GL_TEXTURE_GEN_MODE, GL_OBJECT_PLANE, or GL_EYE_PLANE. If pname is GL_TEXTURE_GEN_MODE, then params chooses a mode, one of GL_OBJECT_LINEAR, GL_EYE_LINEAR, or GL_SPHERE_MAP. If pname is either GL_OBJECT_PLANE or GL_EYE_PLANE, params contains coefficients for the corresponding texture generation function. If the texture generation function is GL_OBJECT_LINEAR, the function g=p x +p y +p z +p w 1 o 2 o 3 o 4 o is used, where g is the value computed for the coordinate named in coord, p , p , p , and p are the four values supplied in params, and x , y , z , 1 2 3 4 o o o and w are the object coordinates of the vertex. This function can be used o to texture-map terrain using sea level as a reference plane (defined by p , 1 p , p , and p ). The altitude of a terrain vertex is computed by the 2 3 4 GL_OBJECT_LINEAR coordinate generation function as its distance from sea level; that altitude is used to index the texture image to map white snow onto peaks and green grass onto foothills, for example. If the texture generation function is GL_EYE_LINEAR, the function g=p'x' + p'y + p'z + p'w 1 e 2 e 3 e 4 e is used, where -1 (p' p' p' p') = (p p p p )╖M 1 2 3 4 1 2 3 4 and x , y , z , and w are the eye coordinates of the vertex, p , p , p , e e e e 1 2 3 and p are the values supplied in params, and M is the modelview matrix 4 when glTexGen is invoked. If M is poorly conditioned or singular, texture coordinates generated by the resulting function may be inaccurate or undefined. Note that the values in params define a reference plane in eye coordinates. The modelview matrix that is applied to them may not be the same one in effect when the polygon vertices are transformed. This function establishes a field of texture coordinates that can produce dynamic contour lines on moving objects. If pname is GL_SPHERE_MAP and coord is either GL_S or GL_T, s and t texture coordinates are generated as follows. Let u be the unit vector pointing from the origin to the polygon vertex (in eye coordinates). Let n' be the current normal, after transformation to eye coordinates. Let T f = (f f f ) be the reflection vector such that x y z T f = u - 2n'n' u _____________ | 2 2 2 Finally, let m = 2\|f +f +(f +1) . Then the values assigned to the s and x y z t texture coordinates are f x 1 s = --- + - m 2 f y 1 t = --- + - m 2 A texture-coordinate generation function is enabled or disabled using glEnable or glDisable with one of the symbolic texture-coordinate names (GL_TEXTURE_GEN_S, GL_TEXTURE_GEN_T, GL_TEXTURE_GEN_R, or GL_TEXTURE_GEN_Q) as the argument. When enabled, the specified texture coordinate is computed according to the generating function associated with that coordinate. When disabled, subsequent vertices take the specified texture coordinate from the current set of texture coordinates. Initially, all texture generation functions are set to GL_EYE_LINEAR and are disabled. Both s plane equations are (1,0,0,0), both t plane equations are (0,1,0,0), and all r and q plane equations are (0,0,0,0). Errors GL_INVALID_ENUM is generated when coord or pname is not an accepted defined value, or when pname is GL_TEXTURE_GEN_MODE and params is not an accepted defined value. GL_INVALID_ENUM is generated when pname is GL_TEXTURE_GEN_MODE, params is GL_SPHERE_MAP, and coord is either GL_R or GL_Q. GL_INVALID_OPERATION is generated if glTexGen is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGetTexGen glIsEnabled with argument GL_TEXTURE_GEN_S glIsEnabled with argument GL_TEXTURE_GEN_T glIsEnabled with argument GL_TEXTURE_GEN_R glIsEnabled with argument GL_TEXTURE_GEN_Q See Also glTexEnv, glTexImage1D, glTexImage2D, glTexParameter ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.111. glTexImage1D ═══ OpenGL man pages glTexImage1D Name glTexImage1D - specify a one-dimensional texture image C Specification void glTexImage1D( GLenum target, GLint level, GLint components, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) Parameters target Specifies the target texture. Must be GL_TEXTURE_1D. level Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. components Specifies the number of color components in the texture. Must be 1, 2, 3, or 4. n width Specifies the width of the texture image. Must be 2 +2(border) for some integer n. The height of the texture image is 1. border Specifies the width of the border. Must be either 0 or 1. format Specifies the format of the pixel data. The following symbolic values are accepted: GL_COLOR_INDEX, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_LUMINANCE, and GL_LUMINANCE_ALPHA. type Specifies the data type of the pixel data. The following symbolic values are accepted: GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, and GL_FLOAT. pixels Specifies a pointer to the image data in memory. Description Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. One-dimensional texturing is enabled and disabled using glEnable and glDisable with argument GL_TEXTURE_1D. Texture images are defined with glTexImage1D. The arguments describe the parameters of the texture image, such as width, width of the border, level-of-detail number (see glTexParameter), and number of color components provided. The last three arguments describe the way the image is represented in memory, and they are identical to the pixel formats used for glDrawPixels. Data is read from pixels as a sequence of signed or unsigned bytes, shorts, or longs, or single-precision floating-point values, depending on type. These values are grouped into sets of one, two, three, or four values, depending on format, to form elements. If type is GL_BITMAP, the data is considered as a string of unsigned bytes (and format must be GL_COLOR_INDEX). Each data byte is treated as eight 1-bit elements, with bit ordering determined by GL_UNPACK_LSB_FIRST (see glPixelStore). format determines the composition of each element in pixels. It can assume one of nine symbolic values: GL_COLOR_INDEX Each element is a single value, a color index. It is converted to fixed point (with an unspecified number of zero bits to the right of the binary point), shifted left or right depending on the value and sign of GL_INDEX_SHIFT, and added to GL_INDEX_OFFSET (see glPixelTransfer). The resulting index is converted to a set of color components using the GL_PIXEL_MAP_I_TO_R, GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B, and GL_PIXEL_MAP_I_TO_A tables, and clamped to the range [0,1]. GL_RED Each element is a single red component. It is converted to floating point and assembled into an RGBA element by attaching 0.0 for green and blue, and 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). GL_GREEN Each element is a single green component. It is converted to floating point and assembled into an RGBA element by attaching 0.0 for red and blue, and 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). GL_BLUE Each element is a single blue component. It is converted to floating point and assembled into an RGBA element by attaching 0.0 for red and green, and 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). GL_ALPHA Each element is a single alpha component. It is converted to floating point and assembled into an RGBA element by attaching 0.0 for red, green, and blue. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). GL_RGB Each element is an RGB triple. It is converted to floating point and assembled into an RGBA element by attaching 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). GL_RGBA Each element is a complete RGBA element. It is converted to floating point. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). GL_LUMINANCE Each element is a single luminance value. It is converted to floating point, then assembled into an RGBA element by replicating the luminance value three times for red, green, and blue and attaching 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). GL_LUMINANCE_ALPHA Each element is a luminance/alpha pair. It is converted to floating point, then assembled into an RGBA element by replicating the luminance value three times for red, green, and blue. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). A texture image can have up to four components per texture element, depending on components. A one-component texture image uses only the red component of the RGBA color extracted from pixels. A two-component image uses the R and A values. A three-component image uses the R, G, and B values. A four-component image uses all of the RGBA components. Notes Texturing has no effect in color index mode. The texture image can be represented by the same data formats as the pixels in a glDrawPixels command, except that GL_STENCIL_INDEX and GL_DEPTH_COMPONENT cannot be used. glPixelStore and glPixelTransfer modes affect texture images in exactly the way they affect glDrawPixels. A texture image with zero width indicates the null texture. If the null texture is specified for level-of-detail 0, it is as if texturing were disabled. Errors GL_INVALID_ENUM is generated when target is not GL_TEXTURE_1D. GL_INVALID_ENUM is generated when format is not an accepted format constant. Format constants other than GL_STENCIL_INDEX and GL_DEPTH_COMPONENT are accepted. GL_INVALID_ENUM is generated when type is not a type constant. GL_INVALID_ENUM is generated if type is GL_BITMAP and format is not GL_COLOR_INDEX. GL_INVALID_VALUE is generated if level is less than zero or greater than log max, where max is the returned value of GL_MAX_TEXTURE_SIZE. 2 GL_INVALID_VALUE is generated if components is not 1, 2, 3, or 4. GL_INVALID_VALUE is generated if width is less than zero or greater than n 2 + GL_MAX_TEXTURE_SIZE, or if it cannot be represented as 2 +2(border) for some integer value of n. GL_INVALID_VALUE is generated if border is not 0 or 1. GL_INVALID_OPERATION is generated if glTexImage1D is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGetTexImage glIsEnabled with argument GL_TEXTURE_1D See Also glDrawPixels, glFog, glPixelStore, glPixelTransfer, glTexEnv, glTexGen, glTexImage2D, glTexParameter ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.112. glTexImage2D ═══ OpenGL man pages glTexImage2D Name glTexImage2D - specify a two-dimensional texture image C Specification void glTexImage2D( GLenum target, GLint level, GLint components, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) Parameters target Specifies the target texture. Must be GL_TEXTURE_2D. level Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. components Specifies the number of color components in the texture. Must be 1, 2, 3, or 4. а n width Specifies the width of the texture image. Must be 2 +2(border) for some integer n. height Specifies the height of the texture image. Must be m 2 +2(border) for some integer m. border Specifies the width of the border. Must be either 0 or 1. format Specifies the format of the pixel data. The following symbolic values are accepted: GL_COLOR_INDEX, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_LUMINANCE, and GL_LUMINANCE_ALPHA. type Specifies the data type of the pixel data. The following symbolic values are accepted: GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, and GL_FLOAT. pixels Specifies a pointer to the image data in memory. Description Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. Two-dimensional texturing is enabled and disabled using glEnable and glDisable with argument GL_TEXTURE_2D. Texture images are defined with glTexImage2D. The arguments describe the parameters of the texture image, such as height, width, width of the border, level-of-detail number (see glTexParameter), and number of color components provided. The last three arguments describe the way the image is represented in memory, and they are identical to the pixel formats used for glDrawPixels. Data is read from pixels as a sequence of signed or unsigned bytes, shorts, or longs, or single-precision floating-point values, depending on type. These values are grouped into sets of one, two, three, or four values, depending on format, to form elements. If type is GL_BITMAP, the data is considered as a string of unsigned bytes (and format must be GL_COLOR_INDEX). Each data byte is treated as eight 1-bit elements, with bit ordering determined by GL_UNPACK_LSB_FIRST (see glPixelStore). format determines the composition of each element in pixels. It can assume one of nine symbolic values: GL_COLOR_INDEX Each element is a single value, a color index. It is converted to fixed point (with an unspecified number of zero bits to the right of the binary point), shifted left or right depending on the value and sign of GL_INDEX_SHIFT, and added to GL_INDEX_OFFSET (see glPixelTransfer). The resulting index is converted to a set of color components using the GL_PIXEL_MAP_I_TO_R, GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B, and GL_PIXEL_MAP_I_TO_A tables, and clamped to the range [0,1]. GL_RED Each element is a single red component. It is converted to floating point and assembled into an RGBA element by attaching 0.0 for green and blue, and 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). GL_GREEN Each element is a single green component. It is converted to floating point and assembled into an RGBA element by attaching 0.0 for red and blue, and 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). GL_BLUE Each element is a single blue component. It is converted to floating point and assembled into an RGBA element by attaching 0.0 for red and green, and 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). GL_ALPHA Each element is a single alpha component. It is converted to floating point and assembled into an RGBA element by attaching 0.0 for red, green, and blue. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). GL_RGB Each element is an RGB triple. It is converted to floating point and assembled into an RGBA element by attaching 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). GL_RGBA Each element is a complete RGBA element. It is converted to floating point. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). GL_LUMINANCE Each element is a single luminance value. It is converted to floating point, then assembled into an RGBA element by replicating the luminance value three times for red, green, and blue and attaching 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). GL_LUMINANCE_ALPHA Each element is a luminance/alpha pair. It is converted to floating point, then assembled into an RGBA element by replicating the luminance value three times for red, green, and blue. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Please refer to the glDrawPixels reference page for a description of the acceptable values for the type parameter. A texture image can have up to four components per texture element, depending on components. A one- component texture image uses only the red component of the RGBA color extracted from pixels. A two-component image uses the R and A values. A three-component image uses the R, G, and B values. A four-component image uses all of the RGBA components. Notes Texturing has no effect in color index mode. The texture image can be represented by the same data formats as the pixels in a glDrawPixels command, except that GL_STENCIL_INDEX and GL_DEPTH_COMPONENT cannot be used. glPixelStore and glPixelTransfer modes affect texture images in exactly the way they affect glDrawPixels. A texture image with zero height or width indicates the null texture. If the null texture is specified for level-of-detail 0, it is as if texturing were disabled. Errors GL_INVALID_ENUM is generated when target is not GL_TEXTURE_2D. GL_INVALID_ENUM is generated when format is not an accepted format constant. Format constants other than GL_STENCIL_INDEX and GL_DEPTH_COMPONENT are accepted. GL_INVALID_ENUM is generated when type is not a type constant. GL_INVALID_ENUM is generated if type is GL_BITMAP and format is not GL_COLOR_INDEX. GL_INVALID_VALUE is generated if level is less than zero or greater than log max, where max is the returned value of GL_MAX_TEXTURE_SIZE. 2 GL_INVALID_VALUE is generated if components is not 1, 2, 3, or 4. GL_INVALID_VALUE is generated if width or height is less than zero or greater than 2 + GL_MAX_TEXTURE_SIZE, or if either cannot be represented as k 2 +2(border) for some integer value of k. GL_INVALID_VALUE is generated if border is not 0 or 1. GL_INVALID_OPERATION is generated if glTexImage2D is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGetTexImage glIsEnabled with argument GL_TEXTURE_2D See Also glDrawPixels, glFog, glPixelStore, glPixelTransfer, glTexEnv, glTexGen, glTexImage1D, glTexParameter ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.113. glTexParameter ═══ OpenGL man pages glTexParameter Name glTexParameterf, glTexParameteri, glTexParameterfv, glTexParameteriv - set texture parameters C Specification void glTexParameterf( GLenum target, GLenum pname, GLfloat param ) void glTexParameteri( GLenum target, GLenum pname, GLint param ) Parameters target Specifies the target texture, which must be either GL_TEXTURE_1D or GL_TEXTURE_2D. pname Specifies the symbolic name of a single-valued texture parameter. pname can be one of the following: GL_TEXTURE_MIN_FILTER, GL_TEXTURE_MAG_FILTER, GL_TEXTURE_WRAP_S, or GL_TEXTURE_WRAP_T. param Specifies the value of pname. C Specification void glTexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) void glTexParameteriv( GLenum target, GLenum pname, const GLint *params ) Parameters target Specifies the target texture, which must be either GL_TEXTURE_1D or GL_TEXTURE_2D. pname Specifies the symbolic name of a texture parameter. pname can be one of the following: GL_TEXTURE_MIN_FILTER, GL_TEXTURE_MAG_FILTER, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, or GL_TEXTURE_BORDER_COLOR. params Specifies a pointer to an array where the value or values of pname are stored. Description Texture mapping is a technique that applies an image onto an object's surface as if the image were a decal or cellophane shrink-wrap. The image is created in texture space, with an (s, t) coordinate system. A texture is a one- or two-dimensional image and a set of parameters that determine how samples are derived from the image. glTexParameter assigns the value or values in params to the texture parameter specified as pname. target defines the target texture, either GL_TEXTURE_1D or GL_TEXTURE_2D. The following symbols are accepted in pname: GL_TEXTURE_MIN_FILTER The texture minifying function is used whenever the pixel being textured maps to an area greater than one texture element. There are six defined minifying functions. Two of them use the nearest one or nearest four texture elements to compute the texture value. The other four use mipmaps. A mipmap is an ordered set of arrays representing the same image at progressively lower resolutions. If the texture has dimensions 2nx2m there are max(n,m)+1 mipmaps. The first mipmap is the original texture, with dimensions 2nx2m. Each subsequent mipmap has dimensions 2k-1x2l-1 where 2kx2l are the dimensions of the previous mipmap, until either k=0 or l=0. At that point, subsequent mipmaps have dimension 1x2l-1 or 2k-1x1 until the final mipmap, which has dimension 1x1. Mipmaps are defined using glTexImage1D or glTexImage2D with the level-of-detail argument indicating the order of the mipmaps. Level 0 is the original texture; level max(n,m) is the final 1x1 mipmap. params supplies a function for minifying the texture as one of the following: GL_NEAREST Returns the value of the texture element that is nearest (in Manhattan distance) to the center of the pixel being textured. GL_LINEAR Returns the weighted average of the four texture elements that are closest to the center of the pixel being textured. These can include border texture elements, depending on the values of GL_TEXTURE_WRAP_S and GL_TEXTURE_WRAP_T, and on the exact mapping. GL_NEAREST_MIPMAP_NEAREST Chooses the mipmap that most closely matches the size of the pixel being textured and uses the GL_NEAREST criterion (the texture element nearest to the center of the pixel) to produce a texture value. GL_LINEAR_MIPMAP_NEAREST Chooses the mipmap that most closely matches the size of the pixel being textured and uses the GL_LINEAR criterion (a weighted average of the four texture elements that are closest to the center of the pixel) to produce a texture value. GL_NEAREST_MIPMAP_LINEAR Chooses the two mipmaps that most closely match the size of the pixel being textured and uses the GL_NEAREST criterion (the texture element nearest to the center of the pixel) to produce a texture value from each mipmap. The final texture value is a weighted average of those two values. GL_LINEAR_MIPMAP_LINEAR Chooses the two mipmaps that most closely match the size of the pixel being textured and uses the GL_LINEAR criterion (a weighted average of the four texture elements that are closest to the center of the pixel) to produce a texture value from each mipmap. The final texture value is a weighted average of those two values. As more texture elements are sampled in the minification process, fewer aliasing artifacts will be apparent. While the GL_NEAREST and GL_LINEAR minification functions can be faster than the other four, they sample only one or four texture elements to determine the texture value of the pixel being rendered and can produce moire patterns or ragged transitions. The default value of GL_TEXTURE_MIN_FILTER is GL_NEAREST_MIPMAP_LINEAR. GL_TEXTURE_MAG_FILTER The texture magnification function is used when the pixel being textured maps to an area less than or equal to one texture element. It sets the texture magnification function to either of the following: GL_NEAREST Returns the value of the texture element that is nearest (in Manhattan distance) to the center of the pixel being textured. GL_LINEAR Returns the weighted average of the four texture elements that are closest to the center of the pixel being textured. These can include border texture elements, depending on the values of GL_TEXTURE_WRAP_S and GL_TEXTURE_WRAP_T, and on the exact mapping. GL_NEAREST is generally faster than GL_LINEAR, but it can produce textured images with sharper edges because the transition between texture elements is not as smooth. The default value of GL_TEXTURE_MAG_FILTER is GL_LINEAR. GL_TEXTURE_WRAP_S Sets the wrap parameter for texture coordinate s to either GL_CLAMP or GL_REPEAT. GL_CLAMP causes s coordinates to be clamped to the range [0,1] and is useful for preventing wrapping artifacts when mapping a single image onto an object. GL_REPEAT causes the integer part of the s coordinate to be ignored; the GL uses only the fractional part, thereby creating a repeating pattern. Border texture elements are accessed only if wrapping is set to GL_CLAMP. Initially, GL_TEXTURE_WRAP_S is set to GL_REPEAT. GL_TEXTURE_WRAP_T Sets the wrap parameter for texture coordinate t to either GL_CLAMP or GL_REPEAT. See the discussion under GL_TEXTURE_WRAP_S. Initially, GL_TEXTURE_WRAP_T is set to GL_REPEAT. GL_TEXTURE_BORDER_COLOR Sets a border color. params contains four values that comprise the RGBA color of the texture border. Integer color components are interpreted linearly such that the most positive integer maps to 1.0, and the most negative integer maps to -1.0. The values are clamped to the range [0,1] when they are specified. Initially, the border color is (0, 0, 0, 0). Notes Suppose texturing is enabled (by calling glEnable with argument GL_TEXTURE_1D or GL_TEXTURE_2D) and GL_TEXTURE_MIN_FILTER is set to one of the functions that requires a mipmap. If either the dimensions of the texture images currently defined (with previous calls to glTexImage1D or glTexImage2D) do not follow the proper sequence for mipmaps (described above), or there are fewer texture images defined than are needed, or the set of texture images have differing numbers of texture components, then it is as if texture mapping were disabled. Linear filtering accesses the four nearest texture elements only in 2-D textures. In 1-D textures, linear filtering accesses the two nearest texture elements. Errors GL_INVALID_ENUM is generated when target or pname is not one of the accepted defined values, or when params should have a defined constant value (based on the value of pname) and does not. GL_INVALID_OPERATION is generated if glTexParameter is called between a call to glBegin and the corresponding call to glEnd. Associated Gets glGetTexParameter glGetTexLevelParameter See Also glTexEnv, glTexImage1D, glTexImage2D, glTexGen ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.114. glTranslate ═══ OpenGL man pages glTranslate Name glTranslated, glTranslatef - multiply the current matrix by a translation matrix C Specification void glTranslated( GLdouble x, GLdouble y, GLdouble z ) void glTranslatef( GLfloat x, GLfloat y, GLfloat z ) Parameters x, y, z Specify the x, y, and z coordinates of a translation vector. Description glTranslate moves the coordinate system origin to the point specified by (x,y,z). The translation vector is used to compute a 4x4 translation matrix: | 1 0 0 x | | | | 0 1 0 y | | | | 0 0 1 z | | | | 0 0 0 1 | The current matrix (see glMatrixMode) is multiplied by this translation matrix, with the product replacing the current matrix. That is, if M is the current matrix and T is the translation matrix, then M is replaced with M ╖ T. If the matrix mode is either GL_MODELVIEW or GL_PROJECTION, all objects drawn after glTranslate is called are translated. Use glPushMatrix and glPopMatrix to save and restore the untranslated coordinate system. Errors GL_INVALID_OPERATION is generated if glTranslate is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_MATRIX_MODE glGet with argument GL_MODELVIEW_MATRIX glGet with argument GL_PROJECTION_MATRIX glGet with argument GL_TEXTURE_MATRIX See Also glMatrixMode, glMultMatrix, glPushMatrix, glRotate, glScale ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.115. glVertex ═══ OpenGL man pages glVertex Name glVertex2d, glVertex2f, glVertex2i, glVertex2s, glVertex3d, glVertex3f, glVertex3i, glVertex3s, glVertex4d, glVertex4f, glVertex4i, glVertex4s, glVertex2dv, glVertex2fv, glVertex2iv, glVertex2sv, glVertex3dv, glVertex3fv, glVertex3iv, glVertex3sv, glVertex4dv, glVertex4fv, glVertex4iv, glVertex4sv - specify a vertex C Specification void glVertex2d( GLdouble x, GLdouble y ) void glVertex2f( GLfloat x, GLfloat y ) void glVertex2i( GLint x, GLint y ) void glVertex2s( GLshort x, GLshort y ) void glVertex3d( GLdouble x, GLdouble y, GLdouble z ) void glVertex3f( GLfloat x, GLfloat y, GLfloat z ) void glVertex3i( GLint x, GLint y, GLint z ) void glVertex3s( GLshort x, GLshort y, GLshort z ) void glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ) void glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) void glVertex4i( GLint x, GLint y, GLint z, GLint w ) void glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w ) Parameters x, y, z, w Specify x, y, z, and w coordinates of a vertex. Not all parameters are present in all forms of the command. C Specification void glVertex2dv( const GLdouble *v ) void glVertex2fv( const GLfloat *v ) void glVertex2iv( const GLint *v ) void glVertex2sv( const GLshort *v ) void glVertex3dv( const GLdouble *v ) void glVertex3fv( const GLfloat *v ) void glVertex3iv( const GLint *v ) void glVertex3sv( const GLshort *v ) void glVertex4dv( const GLdouble *v ) void glVertex4fv( const GLfloat *v ) void glVertex4iv( const GLint *v ) void glVertex4sv( const GLshort *v ) Parameters v Specifies a pointer to an array of two, three, or four elements. The elements of a two-element array are x and y; of a three-element array, x, y, and z; and of a four-element array, x, y, z, and w. Description glVertex commands are used within glBegin/glEnd pairs to specify point, line, and polygon vertices. The current color, normal, and texture coordinates are associated with the vertex when glVertex is called. When only x and y are specified, z defaults to 0.0 and w defaults to 1.0. When x, y, and z are specified, w defaults to 1.0. Notes Invoking glVertex outside of a glBegin/glEnd pair results in undefined behavior. See Also glBegin, glCallList, glColor, glEdgeFlag, glEvalCoord, glIndex, glMaterial, glNormal, glRect, glTexCoord ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.116. glVertexPointerEXT ═══ OpenGL man pages glVertexPointerEXT Name glVertexPointerEXT - define an array of vertex data C Specification void glVertexPointerEXT( GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer ) Parameters size Specifies the number of coordinates per vertex, must be 2,3, or 4. type Specifies the data type of each coordinate in the array. Symbolic constants GL_SHORT, GL_INT, GL_FLOAT, or GL_DOUBLE_EXT are accepted. stride Specifies the byte offset between consecutive vertexes. If stride is 0 the vertexes are understood to be tightly packed in the array. count Specifies the number of vertexes, counting from the first, that are static. pointer Specifies a pointer to the first coordinate of the first vertex in the array. Description glVertexPointerEXT specifies the location and data format of an array of vertex coordinates to use when rendering using the vertex array extension. size specifies the number of coordinates per vertex and type the data type of the coordinates. stride gives the byte stride from one vertex to the next allowing vertexes and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations.) count indicates the number of array elements (counting from the first) that are static. Static elements may be modified by the application, but once they are modified, the application must explicitly respecify the array before using it for any rendering. When a vertex array is specified, size, type, stride, count, and pointer are saved as client-side state, and static array elements may be cached by the implementation. The vertex array is enabled and disabled using glEnable and glDisable with the argument GL_VERTEX_ARRAY_EXT. If enabled, the vertex array is used when glDrawArraysEXT or glArrayElementEXT is called. Use glDrawArraysEXT to define a sequence of primitives (all of the same type) from pre-specified vertex and vertex attribute arrays. Use glArrayElementEXT to specify primitives by indexing vertexes and vertex attributes. Notes Non-static array elements are not accessed until glArrayElementEXT or glDrawArraysEXT is executed. By default the vertex array is disabled and it won't be accessed when glArrayElementEXT or glDrawArraysEXT is called. Although it is not an error to call glVertexPointerEXT between the execution of glBegin and the corresponding execution of glEnd, the results are undefined. glVertexPointerEXT will typically be implemented on the client side with no protocol. Since the vertex array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. glVertexPointerEXT commands are not entered into display lists. glVertexPointerEXT is part of the EXT_vertex_array extension, not part of the core GL command set. If "GL_EXT_vertex_array" is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension EXT_vertex_array is supported. Errors GL_INVALID_VALUE is generated if size is not 2, 3, or 4. GL_INVALID_ENUM is generated if type is is not an accepted value. GL_INVALID_VALUE is generated if stride or count is negative. Associated Gets glIsEnabled with argument GL_VERTEX_ARRAY_EXT glGet with argument GL_VERTEX_ARRAY_SIZE_EXT glGet with argument GL_VERTEX_ARRAY_TYPE_EXT glGet with argument GL_VERTEX_ARRAY_STRIDE_EXT glGet with argument GL_VERTEX_ARRAY_COUNT_EXT glGetPointervEXT with argument GL_VERTEX_ARRAY_POINTER_EXT See Also glArrayElementEXT, glColorPointerEXT, glDrawArraysEXT, glEdgeFlagPointerEXT, glGetPointervEXT, glIndexPointerEXT, glNormalPointerEXT, glTexCoordPointerEXT, glEnable ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.117. glViewport ═══ OpenGL man pages glViewport Name glViewport - set the viewport C Specification void glViewport( GLint x, GLint y, GLsizei width, GLsizei height ) Parameters x, y Specify the lower left corner of the viewport rectangle, in pixels. The default is (0,0). width, height Specify the width and height, respectively, of the viewport. When a GL context is first attached to a window, width and height are set to the dimensions of that window. Description glViewport specifies the affine transformation of x and y from normalized device coordinates to window coordinates. Let (x , y ) be normalized nd nd device coordinates. Then the window coordinates x , y ) are computed as follows: w w width x = (x +1)----- + x w nd 2 height y = (y +1)------ + y w nd 2 Viewport width and height are silently clamped to a range that depends on the implementation. This range is queried by calling glGet with argument GL_MAX_VIEWPORT_DIMS. Errors GL_INVALID_VALUE is generated if either width or height is negative. GL_INVALID_OPERATION is generated if glViewport is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_VIEWPORT glGet with argument GL_MAX_VIEWPORT_DIMS See Also glDepthRange ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.118. glXChooseVisual ═══ OpenGL man pages glXChooseVisual Name glXChooseVisual - return a visual that matches specified attributes C Specification XVisualInfo* glXChooseVisual( Display *dpy, int screen, int *attribList ) Parameters dpy Specifies the connection to the X server. screen Specifies the screen number. attribList Specifies a list of Boolean attributes and integer attribute/value pairs. The last attribute must be None. Description glXChooseVisual returns a pointer to an XVisualInfo structure describing the visual that best meets a minimum specification. The Boolean GLX attributes of the visual that is returned will match the specified values, and the integer GLX attributes will meet or exceed the specified minimum values. If all other attributes are equivalent, then TrueColor and PseudoColor visuals have priority over DirectColor and StaticColor visuals, respectively. If no conforming visual exists, NULL is returned. To free the data returned by this function, use XFree. All Boolean GLX attributes default to False except GLX_USE_GL, which defaults to True. All integer GLX attributes default to zero. Default specifications are superseded by attributes included in attribList. Boolean attributes included in attribList are understood to be True. Integer attributes are followed immediately by the corresponding desired or minimum value. The list must be terminated with None. The interpretations of the various GLX visual attributes are as follows: GLX_USE_GL Ignored. Only visuals that can be rendered with GLX are considered. GLX_BUFFER_SIZE Must be followed by a nonnegative integer that indicates the desired color index buffer size. The smallest index buffer of at least the specified size is preferred. Ignored if GLX_RGBA is asserted. GLX_LEVEL Must be followed by an integer buffer-level specification. This specification is honored exactly. Buffer level zero corresponds to the default frame buffer of the display. Buffer level one is the first overlay frame buffer, level two the second overlay frame buffer, and so on. Negative buffer levels correspond to underlay frame buffers. GLX_RGBA If present, only TrueColor and DirectColor visuals are considered. Otherwise, only PseudoColor and StaticColor visuals are considered. GLX_DOUBLEBUFFER If present, only double-buffered visuals are considered. Otherwise, only single-buffered visuals are considered. GLX_STEREO If present, only stereo visuals are considered. Otherwise, only monoscopic visuals are considered. GLX_AUX_BUFFERS Must be followed by a nonnegative integer that indicates the desired number of auxiliary buffers. Visuals with the smallest number of auxiliary buffers that meets or exceeds the specified number are preferred. GLX_RED_SIZE Must be followed by a nonnegative minimum size specification. If this value is zero, the smallest available red buffer is preferred. Otherwise, the largest available red buffer of at least the minimum size is preferred. GLX_GREEN_SIZE Must be followed by a nonnegative minimum size specification. If this value is zero, the smallest available green buffer is preferred. Otherwise, the largest available green buffer of at least the minimum size is preferred. GLX_BLUE_SIZE Must be followed by a nonnegative minimum size specification. If this value is zero, the smallest available blue buffer is preferred. Otherwise, the largest available blue buffer of at least the minimum size is preferred. GLX_ALPHA_SIZE Must be followed by a nonnegative minimum size specification. If this value is zero, the smallest available alpha buffer is preferred. Otherwise, the largest available alpha buffer of at least the minimum size is preferred. GLX_DEPTH_SIZE Must be followed by a nonnegative minimum size specification. If this value is zero, visuals with no depth buffer are preferred. Otherwise, the largest available depth buffer of at least the minimum size is preferred. GLX_STENCIL_SIZE Must be followed by a nonnegative integer that indicates the desired number of stencil bitplanes. The smallest stencil buffer of at least the specified size is preferred. If the desired value is zero, visuals with no stencil buffer are preferred. GLX_ACCUM_RED_SIZE Must be followed by a nonnegative minimum size specification. If this value is zero, visuals with no red accumulation buffer are preferred. Otherwise, the largest possible red accumulation buffer of at least the minimum size is preferred. GLX_ACCUM_GREEN_SIZE Must be followed by a nonnegative minimum size specification. If this value is zero, visuals with no green accumulation buffer are preferred. Otherwise, the largest possible green accumulation buffer of at least the minimum size is preferred. GLX_ACCUM_BLUE_SIZE Must be followed by a nonnegative minimum size specification. If this value is zero, visuals with no blue accumulation buffer are preferred. Otherwise, the largest possible blue accumulation buffer of at least the minimum size is preferred. GLX_ACCUM_ALPHA_SIZE Must be followed by a nonnegative minimum size specification. If this value is zero, visuals with no alpha accumulation buffer are preferred. Otherwise, the largest possible alpha accumulation buffer of at least the minimum size is preferred. Examples attribList = {GLX_RGBA, GLX_RED_SIZE, 4, GLX_GREEN_SIZE, 4, GLX_BLUE_SIZE, 4, None}; Specifies a single-buffered RGB visual in the normal frame buffer, not an overlay or underlay buffer. The returned visual supports at least four bits each of red, green, and blue, and possibly no bits of alpha. It does not support color index mode, double-buffering, or stereo display. It may or may not have one or more auxiliary color buffers, a depth buffer, a stencil buffer, or an accumulation buffer. Notes XVisualInfo is defined in Xutil.h. It is a structure that includes visual, visualID, screen, and depth elements. glXChooseVisual is implemented as a client-side utility using only XGetVisualInfo and glXGetConfig. Calls to these two routines can be used to implement selection algorithms other than the generic one implemented by glXChooseVisual. GLX implementers are strongly discouraged, but not proscribed, from changing the selection algorithm used by glXChooseVisual. Therefore, selections may change from release to release of the client-side library. There is no direct filter for picking only visuals that support GLXPixmaps. GLXPixmaps are supported for visuals whose GLX_BUFFER_SIZE. is one of the Pixmap depths supported by the X server. Errors NULL is returned if an undefined GLX attribute is encountered in attribList. See Also glXCreateContext, glXGetConfig ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.119. glXCopyContext ═══ OpenGL man pages glXCopyContext Name glXCopyContext - copy state from one rendering context to another C Specification void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst, GLuint mask ) Parameters dpy Specifies the connection to the X server. src Specifies the source context. dst Specifies the destination context. mask Specifies which portions of src state are to be copied to dst. Description glXCopyContext copies selected groups of state variables from src to dst. mask indicates which groups of state variables are to be copied. mask contains the bitwise OR of the same symbolic names that are passed to the OpenGL command glPushAttrib. The single symbolic constant GL_ALL_ATTRIB_BITS can be used to copy the maximum possible portion of rendering state. The copy can be done only if the renderers named by src and dst share an address space. Two rendering contexts share an address space if both are nondirect using the same server, or if both are direct and owned by a single process. Note that in the nondirect case it is not necessary for the calling threads to share an address space, only for their related rendering contexts to share an address space. Not all values for OpenGL state can be copied. For example, pixel pack and unpack state, render mode state, and select and feedback state are not copied. The state that can be copied is exactly the state that is manipulated by OpenGL command glPushAttrib. An implicit glFlush is done by glXCopyContext if src is the current context for the calling thread. If src is not the current context for the thread issuing the request, then the state of the src context is undefined. Notes Two rendering contexts share an address space if both are nondirect using the same server, or if both are direct and owned by a single process. A process is a single execution environment, implemented in a single address space, consisting of one or more threads. A thread is one of a set of subprocesses that share a single address space, but maintain separate program counters, stack spaces, and other related global data. A thread that is the only member of its subprocess group is equivalent to a process. Errors BadMatch is generated if rendering contexts src and dst do not share an address space or were not created with respect to the same screen. BadAccess is generated if dst is current to any thread (including the calling thread) at the time glXCopyContext is called. GLXBadCurrentWindow is generated if src is the current context and the current drawable is a window that is no longer valid. GLXBadContext is generated if either src or dst is not a valid GLX context. BadValue is generated if undefined mask bits are specified. See Also glPushAttrib, glXCreateContext, glXIsDirect ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.120. glXCreateContext ═══ OpenGL man pages glXCreateContext Name glXCreateContext - create a new GLX rendering context C Specification GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct ) Parameters dpy Specifies the connection to the X server. vis Specifies the visual that defines the frame buffer resources available to the rendering context. It is a pointer to an XVisualInfo structure, not a visual ID or a pointer to a Visual. shareList Specifies the context with which to share display lists. NULL indicates that no sharing is to take place. direct Specifies whether rendering is to be done with a direct connection to the graphics system if possible (True) or through the X server (False). Description glXCreateContext creates a GLX rendering context and returns its handle. This context can be used to render into both windows and GLX pixmaps. If glXCreateContext fails to create a rendering context, NULL is returned. If direct is True, then a direct rendering context is created if the implementation supports direct rendering and the connection is to an X server that is local. If direct is False, then a rendering context that renders through the X server is always created. Direct rendering provides a performance advantage in some implementations. However, direct rendering contexts cannot be shared outside a single process, and they cannot be used to render to GLX pixmaps. If shareList is not NULL, then all display-list indexes and definitions are shared by context shareList and by the newly created context. An arbitrary number of contexts can share a single display-list space. However, all rendering contexts that share a single display-list space must themselves exist in the same address space. Two rendering contexts share an address space if both are nondirect using the same server, or if both are direct and owned by a single process. Note that in the nondirect case, it is not necessary for the calling threads to share an address space, only for their related rendering contexts to share an address space. Notes XVisualInfo is defined in Xutil.h. It is a structure that includes visual, visualID, screen, and depth elements. A process is a single execution environment, implemented in a single address space, consisting of one or more threads. A thread is one of a set of subprocesses that share a single address space, but maintain separate program counters, stack spaces, and other related global data. A thread that is the only member of its subprocess group is equivalent to a process. Errors NULL is returned if execution fails on the client side. BadMatch is generated if the context to be created would not share the address space or the screen of the context specified by shareList. BadValue is generated if vis is not a valid visual (e.g., if the GLX implementation does not support it). GLXBadContext is generated if shareList is not a GLX context and is not NULL. BadAlloc is generated if the server does not have enough resources to allocate the new context. See Also glXDestroyContext, glXGetConfig, glXIsDirect, glXMakeCurrent ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.121. glXCreateGLXPixmap ═══ OpenGL man pages glXCreateGLXPixmap Name glXCreateGLXPixmap - create an off-screen GLX rendering area C Specification GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *vis, Pixmap pixmap ) Parameters dpy Specifies the connection to the X server. vis Specifies the visual that defines the structure of the rendering area. It is a pointer to an XVisualInfo structure, not a visual ID or a pointer to a Visual. pixmap Specifies the X pixmap that will be used as the front left color buffer of the off-screen rendering area. Description glXCreateGLXPixmap creates an off-screen rendering area and returns its XID. Any GLX rendering context that was created with respect to vis can be used to render into this off-screen area. Use glXMakeCurrent to associate the rendering area with a GLX rendering context. The X pixmap identified by pixmap is used as the front left buffer of the resulting off-screen rendering area. All other buffers specified by vis, including color buffers other than the front left buffer, are created without externally visible names. GLX pixmaps with double-buffering are supported. However, glXSwapBuffers is ignored by these pixmaps. Direct rendering contexts cannot be used to render into GLX pixmaps. Notes XVisualInfo is defined in Xutil.h. It is a structure that includes visual, visualID, screen, and depth elements. Errors BadMatch is generated if the depth of pixmap does not match the GLX_BUFFER_SIZE value of vis, or if pixmap was not created with respect to the same screen as vis. BadValue is generated if vis is not a valid XVisualInfo pointer (e.g., if the GLX implementation does not support this visual). BadPixmap is generated if pixmap is not a valid pixmap. BadAlloc is generated if the server cannot allocate the GLX pixmap. See Also glXCreateContext, glXIsDirect, glXMakeCurrent ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.122. glXDestroyContext ═══ OpenGL man pages glXDestroyContext Name glXDestroyContext - destroy a GLX context C Specification void glXDestroyContext( Display *dpy, GLXContext ctx ) Parameters dpy Specifies the connection to the X server. ctx Specifies the GLX context to be destroyed. Description If GLX rendering context ctx is not current to any thread, glXDestroyContext destroys it immediately. Otherwise, ctx is destroyed when it becomes not current to any thread. In either case, the resource ID referenced by ctx is freed immediately. Errors GLXBadContext is generated if ctx is not a valid GLX context. See Also glXCreateContext, glXMakeCurrent ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.123. glXDestroyGLXPixmap ═══ OpenGL man pages glXDestroyGLXPixmap Name glXDestroyGLXPixmap - destroy a GLX pixmap C Specification void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pix ) Parameters dpy Specifies the connection to the X server. pix Specifies the GLX pixmap to be destroyed. Description If GLX pixmap pix is not current to any client, glXDestroyGLXPixmap destroys it immediately. Otherwise, pix is destroyed when it becomes not current to any client. In either case, the resource ID is freed immediately. Errors GLXBadPixmap is generated if pix is not a valid GLX pixmap. See Also glXCreateGLXPixmap, glXMakeCurrent ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.124. glXGetConfig ═══ OpenGL man pages glXGetConfig Name glXGetConfig - return information about GLX visuals C Specification int glXGetConfig( Display *dpy, XVisualInfo *vis, int attrib, int *value ) Parameters dpy Specifies the connection to the X server. vis Specifies the visual to be queried. It is a pointer to an XVisualInfo structure, not a visual ID or a pointer to a Visual. attrib Specifies the visual attribute to be returned. value Returns the requested value. Description glXGetConfig sets value to the attrib value of windows or GLX pixmaps created with respect to vis. glXGetConfig returns an error code if it fails for any reason. Otherwise, zero is returned. attrib is one of the following: GLX_USE_GL True if OpenGL rendering is supported by this visual, False otherwise. GLX_BUFFER_SIZE Number of bits per color buffer. For RGBA visuals, GLX_BUFFER_SIZE is the sum of GLX_RED_SIZE, GLX_GREEN_SIZE, GLX_BLUE_SIZE, and GLX_ALPHA_SIZE. For color index visuals, GLX_BUFFER_SIZE is the size of the color indexes. GLX_LEVEL Frame buffer level of the visual. Level zero is the default frame buffer. Positive levels correspond to frame buffers that overlay the default buffer, and negative levels correspond to frame buffers that underlay the default buffer. GLX_RGBA True if color buffers store red, green, blue, and alpha values, False if they store color indexes. GLX_DOUBLEBUFFER True if color buffers exist in front/back pairs that can be swapped, False otherwise. GLX_STEREO True if color buffers exist in left/right pairs, False otherwise. GLX_AUX_BUFFERS Number of auxiliary color buffers that are available. Zero indicates that no auxiliary color buffers exist. GLX_RED_SIZE Number of bits of red stored in each color buffer. Undefined if GLX_RGBA is False. GLX_GREEN_SIZE Number of bits of green stored in each color buffer. Undefined if GLX_RGBA is False. GLX_BLUE_SIZE Number of bits of blue stored in each color buffer. Undefined if GLX_RGBA is False. GLX_ALPHA_SIZE Number of bits of alpha stored in each color buffer. Undefined if GLX_RGBA is False. GLX_DEPTH_SIZE Number of bits in the depth buffer. GLX_STENCIL_SIZE Number of bits in the stencil buffer. GLX_ACCUM_RED_SIZE Number of bits of red stored in the accumulation buffer. GLX_ACCUM_GREEN_SIZE Number of bits of green stored in the accumulation buffer. GLX_ACCUM_BLUE_SIZE Number of bits of blue stored in the accumulation buffer. GLX_ACCUM_ALPHA_SIZE Number of bits of alpha stored in the accumulation buffer. The X protocol allows a single visual ID to be instantiated with different numbers of bits per pixel. Windows or GLX pixmaps that will be rendered with OpenGL, however, must be instantiated with a color buffer depth of GLX_BUFFER_SIZE. Although a GLX implementation can export many visuals that support OpenGL rendering, it must support at least two. One is an RGBA visual with at least one color buffer, a stencil buffer of at least 1 bit, a depth buffer of at least 12 bits, and an accumulation buffer. Alpha bitplanes are optional in this visual. However, its color buffer size must be as great as that of the deepest TrueColor, DirectColor, PseudoColor, or StaticColor visual supported on level zero, and it must itself be made available on level zero. The other required visual is a color index one with at least one color buffer, a stencil buffer of at least 1 bit, and a depth buffer of at least 12 bits. This visual must have as many color bitplanes as the deepest PseudoColor or StaticColor visual supported on level zero, and it must itself be made available on level zero. Applications are best written to select the visual that most closely meets their requirements. Creating windows or GLX pixmaps with unnecessary buffers can result in reduced rendering performance as well as poor resource allocation. Notes XVisualInfo is defined in Xutil.h. It is a structure that includes visual, visualID, screen, and depth elements. Errors GLX_NO_EXTENSION is returned if dpy does not support the GLX extension. GLX_BAD_SCREEN is returned if the screen of vis does not correspond to a screen. GLX_BAD_ATTRIB is returned if attrib is not a valid GLX attribute. GLX_BAD_VISUAL is returned if vis doesn't support GLX and an attribute other than GLX_USE_GL is requested. See Also glXChooseVisual, glXCreateContext ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.125. glXGetCurrentContext ═══ OpenGL man pages glXGetCurrentContext Name glXGetCurrentContext - return the current context C Specification GLXContext glXGetCurrentContext( void ) Description glXGetCurrentContext returns the current context, as specified by glXMakeCurrent. If there is no current context, NULL is returned. glXGetCurrentContext returns client-side information. It does not make a round trip to the server. See Also glXCreateContext, glXMakeCurrent ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.126. glXGetCurrentDrawable ═══ OpenGL man pages glXGetCurrentDrawable Name glXGetCurrentDrawable - return the current drawable C Specification GLXDrawable glXGetCurrentDrawable( void ) Description glXGetCurrentDrawable returns the current drawable, as specified by glXMakeCurrent. If there is no current drawable, None is returned. glXGetCurrentDrawable returns client-side information. It does not make a round trip to the server. See Also glXCreateGLXPixmap, glXMakeCurrent ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.127. glXIsDirect ═══ OpenGL man pages glXIsDirect Name glXIsDirect - indicate whether direct rendering is enabled C Specification Bool glXIsDirect( Display *dpy, GLXContext ctx ) Parameters dpy Specifies the connection to the X server. ctx Specifies the GLX context that is being queried. Description glXIsDirect returns True if ctx is a direct rendering context, False otherwise. Direct rendering contexts pass rendering commands directly from the calling process's address space to the rendering system, bypassing the X server. Nondirect rendering contexts pass all rendering commands to the X server. Errors GLXBadContext is generated if ctx is not a valid GLX context. See Also glXCreateContext ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.128. glXMakeCurrent ═══ OpenGL man pages glXMakeCurrent Name glXMakeCurrent - attach a GLX context to a window or a GLX pixmap C Specification Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable, GLXContext ctx ) Parameters dpy Specifies the connection to the X server. drawable Specifies a GLX drawable. Must be either an X window ID or a GLX pixmap ID. ctx Specifies a GLX rendering context that is to be attached to drawable. Description glXMakeCurrent does two things: It makes ctx the current GLX rendering context of the calling thread, replacing the previously current context if there was one, and it attaches ctx to a GLX drawable, either a window or a GLX pixmap. As a result of these two actions, subsequent OpenGL rendering calls use rendering context ctx to modify GLX drawable drawable. Because glXMakeCurrent always replaces the current rendering context with ctx, there can be only one current context per thread. Pending commands to the previous context, if any, are flushed before it is released. The first time ctx is made current to any thread, its viewport is set to the full size of drawable. Subsequent calls by any thread to glXMakeCurrent with ctx have no effect on its viewport. To release the current context without assigning a new one, call glXMakeCurrent with drawable and ctx set to None and NULL respectively. glXMakeCurrent returns True if it is successful, False otherwise. If False is returned, the previously current rendering context and drawable (if any) remain unchanged. Notes A process is a single-execution environment, implemented in a single address space, consisting of one or more threads. A thread is one of a set of subprocesses that share a single address space, but maintain separate program counters, stack spaces, and other related global data. A thread that is the only member of its subprocess group is equivalent to a process. Errors BadMatch is generated if drawable was not created with the same X screen and visual as ctx. It is also generated if drawable is None and ctx is not None. BadAccess is generated if ctx was current to another thread at the time glXMakeCurrent was called. GLXBadDrawable is generated if drawable is not a valid GLX drawable. GLXBadContext is generated if ctx is not a valid GLX context. GLXBadContextState is generated if glXMakeCurrent is called between a glBegin and the corresponding call to glEnd. GLXBadContextState is also generated if the rendering context current to the calling thread has OpenGL renderer state GL_FEEDBACK or GL_SELECT. GLXBadCurrentWindow is generated if there are pending OpenGL commands for the previous context and the current drawable is a window that is no longer valid. BadAlloc may be generated if the server has delayed allocation of ancillary buffers until glXMakeCurrent is called, only to find that it has insufficient resources to complete the allocation. See Also glXCreateContext, glXCreateGLXPixmap ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.129. glXQueryExtension ═══ OpenGL man pages glXQueryExtension Name glXQueryExtension - indicate whether the GLX extension is supported C Specification Bool glXQueryExtension( Display *dpy, int *errorBase, int *eventBase ) Parameters dpy Specifies the connection to the X server. errorBase Returns the base error code of the GLX server extension. eventBase Returns the base event code of the GLX server extension. Description glXQueryExtension returns True if the X server of connection dpy supports the GLX extension, False otherwise. If True is returned, then errorBase and eventBase return the error base and event base of the GLX extension. Otherwise, errorBase and eventBase are unchanged. errorBase and eventBase do not return values if they are specified as NULL. Notes eventBase is included for future extensions. GLX does not currently define any events. See Also glXQueryVersion ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.130. glXQueryVersion ═══ OpenGL man pages glXQueryVersion Name glXQueryVersion - return the version numbers of the GLX extension C Specification Bool glXQueryVersion( Display *dpy, int *major, int *minor ) Parameters dpy Specifies the connection to the X server. major Returns the major version number of the GLX server extension. minor Returns the minor version number of the GLX server extension. Description glXQueryVersion returns the major and minor version numbers of the GLX extension available on the connection dpy. The client library and the server implementations must have the same major version number or else glXQueryVersion will return False. The minor version that is returned is the minimum of the two minor version numbers. major and minor do not return values if they are specified as NULL. Errors glXQueryVersion returns False if it fails, True otherwise. major and minor are not updated when False is returned. See Also glXQueryExtension ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.131. glXSwapBuffers ═══ OpenGL man pages glXSwapBuffers Name glXSwapBuffers - make back buffer visible C Specification void glXSwapBuffers( Display *dpy, GLXDrawable drawable ) Parameters dpy Specifies the connection to the X server. drawable Specifies the window whose buffers are to be swapped. Description glXSwapBuffers promotes the contents of the back buffer of drawable to become the contents of the front buffer of drawable. The contents of the back buffer then become undefined. The update typically takes place during the vertical retrace of the monitor, rather than immediately after glXSwapBuffers is called. All GLX rendering contexts share the same notion of which are front buffers and which are back buffers. An implicit glFlush is done by glXSwapBuffers before it returns. Subsequent OpenGL commands can be issued immediately after calling glXSwapBuffers, but are not executed until the buffer exchange is completed. If drawable was not created with respect to a double-buffered visual, glXSwapBuffers has no effect, and no error is generated. Notes Synchronization of multiple GLX contexts rendering to the same double- buffered window is the responsibility of the clients. The X Synchronization Extension can be used to facilitate such cooperation. Errors GLXBadDrawable is generated if drawable is not a valid GLX drawable. GLXBadCurrentWindow is generated if dpy and drawable are respectively the display and drawable associated with the current context of the calling thread, and drawable identifies a window that is no longer valid. See Also glFlush ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.132. glXUseXFont ═══ OpenGL man pages glXUseXFont Name glXUseXFont - create bitmap display lists from an X font C Specification void glXUseXFont( Font font, int first, int count, int listBase ) Parameters font Specifies the font from which character glyphs are to be taken. first Specifies the index of the first glyph to be taken. count Specifies the number of glyphs to be taken. listBase Specifies the index of the first display list to be generated. Description glXUseXFont generates count display lists, named listBase through listBase+count-1, each containing a single glBitmap command. The parameters of the glBitmap command of display list listBase+i are derived from glyph first+i. Bitmap parameters xorig, yorig, width, and height are computed from font metrics as descent-1, -lbearing, rbearing-lbearing, and ascent+descent, respectively. xmove is taken from the glyph's width metric, and ymove is set to zero. Finally, the glyph's image is converted to the appropriate format for glBitmap. Using glXUseXFont may be more efficient than accessing the X font and generating the display lists explicitly, both because the display lists are created on the server without requiring a round trip of the glyph data, and because the server may choose to delay the creation of each bitmap until it is accessed. Empty display lists are created for all glyphs that are requested and are not defined in font. glXUseXFont is ignored if there is no current GLX context. Errors BadFont is generated if font is not a valid font. GLXBadContextState is generated if the current GLX context is in display- list construction mode. GLXBadCurrentWindow is generated if the drawable associated with the current context of the calling thread is a window, and that window is no longer valid. See Also glBitmap, glXMakeCurrent ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.133. glXWaitGL ═══ OpenGL man pages glXWaitGL Name glXWaitGL - complete GL execution prior to subsequent X calls C Specification void glXWaitGL( void ) Description OpenGL rendering calls made prior to glXWaitGL are guaranteed to be executed before X rendering calls made after glXWaitGL. Although this same result can be achieved using glFinish, glXWaitGL does not require a round trip to the server, and it is therefore more efficient in cases where client and server are on separate machines. glXWaitGL is ignored if there is no current GLX context. Notes glXWaitGL may or may not flush the X stream. Errors GLXBadCurrentWindow is generated if the drawable associated with the current context of the calling thread is a window, and that window is no longer valid. See Also glFinish, glFlush, glXWaitX, XSync ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.134. glXWaitX ═══ OpenGL man pages glXWaitX Name glXWaitX - complete X execution prior to subsequent OpenGL calls C Specification void glXWaitX( void ) Description X rendering calls made prior to glXWaitX are guaranteed to be executed before OpenGL rendering calls made after glXWaitX. Although this same result can be achieved using XSync, glXWaitX does not require a round trip to the server, and it is therefore more efficient in cases where client and server are on separate machines. glXWaitX is ignored if there is no current GLX context. Notes glXWaitX may or may not flush the OpenGL stream. Errors GLXBadCurrentWindow is generated if the drawable associated with the current context of the calling thread is a window, and that window is no longer valid. See Also glFinish, glFlush, glXWaitGL, XSync ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.135. gluBeginCurve ═══ OpenGL man pages gluBeginCurve Name gluBeginCurve, gluEndCurve - delimit a NURBS curve definition C Specification void gluBeginCurve( GLUnurbsObj *nobj ) void gluEndCurve( GLUnurbsObj *nobj ) Parameters nobj Specifies the NURBS object (created with gluNewNurbsRenderer). Description Use gluBeginCurve to mark the beginning of a NURBS curve definition. After calling gluBeginCurve, make one or more calls to gluNurbsCurve to define the attributes of the curve. Exactly one of the calls to gluNurbsCurve must have a curve type of GL_MAP1_VERTEX_3 or GL_MAP1_VERTEX_4. To mark the end of the NURBS curve definition, call gluEndCurve. OpenGL evaluators are used to render the NURBS curve as a series of line segments. Evaluator state is preserved during rendering with glPushAttrib(GL_EVAL_BIT) and glPopAttrib(). See the glPushAttrib reference page for details on exactly what state these calls preserve. Example The following commands render a textured NURBS curve with normals; texture coordinates and normals are also specified as NURBS curves: gluBeginCurve(nobj); gluNurbsCurve(nobj, ..., GL_MAP1_TEXTURE_COORD_2); gluNurbsCurve(nobj, ..., GL_MAP1_NORMAL); gluNurbsCurve(nobj, ..., GL_MAP1_VERTEX_4); gluEndCurve(nobj); See Also gluBeginSurface, gluBeginTrim, gluNewNurbsRenderer, gluNurbsCurve, glPopAttrib, glPushAttrib ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.136. gluBeginPolygon ═══ OpenGL man pages gluBeginPolygon (Obsolete in GLU version 1.2 and later) Name gluBeginPolygon, gluEndPolygon - delimit a polygon description C Specification void gluBeginPolygon( GLUtesselator *tess ) void gluEndPolygon( GLUtesselator *tess ) Parameters tess Specifies the tessellation object (created with gluNewTess). Description gluBeginPolygon and gluEndPolygon delimit the definition of a nonconvex polygon. To define such a polygon, first call gluBeginPolygon. Then define the contours of the polygon by calling gluTessVertex for each vertex and gluNextContour to start each new contour. Finally, call gluEndPolygon to signal the end of the definition. See the gluTessVertex and gluNextContour reference pages for more details. Once gluEndPolygon is called, the polygon is tessellated, and the resulting triangles are described through callbacks. See gluTessCallback for descriptions of the callback functions. Notes As of GLU version 1.2, this command is obsolete and is provided for backwards compatibility only. GLU version 1.2 (and later) can be distinguished during compilation by checking if the pre-processor symbol GLU_VERSION_1_2 is defined. Calls to gluBeginPolygon are mapped to gluTessBeginPolygon followed by gluTessBeginContour. Calls to gluEndPolygon are mapped to gluTessEndContour followed by gluTessEndPolygon. Example A quadrilateral with a triangular hole in it can be described like this: gluBeginPolygon(tobj); gluTessVertex(tobj, v1, v1); gluTessVertex(tobj, v2, v2); gluTessVertex(tobj, v3, v3); gluTessVertex(tobj, v4, v4); gluNextContour(tobj, GLU_INTERIOR); gluTessVertex(tobj, v5, v5); gluTessVertex(tobj, v6, v6); gluTessVertex(tobj, v7, v7); gluEndPolygon(tobj); See Also gluNewTess, gluNextContour, gluTessCallback, gluTessVertex, gluTessBeginPolygon, gluTessBeginContour ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.137. gluBeginPolygon ═══ OpenGL man pages gluBeginPolygon (GLU versions 1.0 and 1.1) Name gluBeginPolygon, gluEndPolygon - delimit a polygon description C Specification void gluBeginPolygon( GLUtriangulatorObj *tobj ) void gluEndPolygon( GLUtriangulatorObj *tobj ) Parameters tobj Specifies the tessellation object (created with gluNewTess). Description gluBeginPolygon and gluEndPolygon delimit the definition of a nonconvex polygon. To define such a polygon, first call gluBeginPolygon. Then define the contours of the polygon by calling gluTessVertex for each vertex and gluNextContour to start each new contour. Finally, call gluEndPolygon to signal the end of the definition. See the gluTessVertex and gluNextContour reference pages for more details. Once gluEndPolygon is called, the polygon is tessellated, and the resulting triangles are described through callbacks. See gluTessCallback for descriptions of the callback functions. Example A quadrilateral with a triangular hole in it can be described like this: gluBeginPolygon(tobj); gluTessVertex(tobj, v1, v1); gluTessVertex(tobj, v2, v2); gluTessVertex(tobj, v3, v3); gluTessVertex(tobj, v4, v4); gluNextContour(tobj, GLU_INTERIOR); gluTessVertex(tobj, v5, v5); gluTessVertex(tobj, v6, v6); gluTessVertex(tobj, v7, v7); gluEndPolygon(tobj); See Also gluNewTess, gluNextContour, gluTessCallback, gluTessVertex ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.138. gluBeginSurface ═══ OpenGL man pages gluBeginSurface Name gluBeginSurface, gluEndSurface - delimit a NURBS surface definition C Specification void gluBeginSurface( GLUnurbsObj *nobj ) void gluEndSurface( GLUnurbsObj *nobj ) Parameters nobj Specifies the NURBS object (created with gluNewNurbsRenderer). Description Use gluBeginSurface to mark the beginning of a NURBS surface definition. After calling gluBeginSurface, make one or more calls to gluNurbsSurface to define the attributes of the surface. Exactly one of these calls to gluNurbsSurface must have a surface type of GL_MAP2_VERTEX_3 or GL_MAP2_VERTEX_4. To mark the end of the NURBS surface definition, call gluEndSurface. Trimming of NURBS surfaces is supported with gluBeginTrim, gluPwlCurve, gluNurbsCurve, and gluEndTrim. Refer to the gluBeginTrim reference page for details. OpenGL evaluators are used to render the NURBS surface as a set of polygons. Evaluator state is preserved during rendering with glPushAttrib(GL_EVAL_BIT) and glPopAttrib(). See the glPushAttrib reference page for details on exactly what state these calls preserve. Example The following commands render a textured NURBS surface with normals; the texture coordinates and normals are also described as NURBS surfaces: gluBeginSurface(nobj); gluNurbsSurface(nobj, ..., GL_MAP2_TEXTURE_COORD_2); gluNurbsSurface(nobj, ..., GL_MAP2_NORMAL); gluNurbsSurface(nobj, ..., GL_MAP2_VERTEX_4); gluEndSurface(nobj); See Also gluBeginCurve, gluBeginTrim, gluNewNurbsRenderer, gluNurbsCurve, gluNurbsSurface, gluPwlCurve ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.139. gluBeginTrim ═══ OpenGL man pages gluBeginTrim Name gluBeginTrim, gluEndTrim - delimit a NURBS trimming loop definition C Specification void gluBeginTrim( GLUnurbsObj *nobj ) void gluEndTrim( GLUnurbsObj *nobj ) Parameters nobj Specifies the NURBS object (created with gluNewNurbsRenderer). Description Use gluBeginTrim to mark the beginning of a trimming loop, and gluEndTrim to mark the end of a trimming loop. A trimming loop is a set of oriented curve segments (forming a closed curve) that define boundaries of a NURBS surface. You include these trimming loops in the definition of a NURBS surface, between calls to gluBeginSurface and gluEndSurface. The definition for a NURBS surface can contain many trimming loops. For example, if you wrote a definition for a NURBS surface that resembled a rectangle with a hole punched out, the definition would contain two trimming loops. One loop would define the outer edge of the rectangle; the other would define the hole punched out of the rectangle. The definitions of each of these trimming loops would be bracketed by a gluBeginTrim/gluEndTrim pair. The definition of a single closed trimming loop can consist of multiple curve segments, each described as a piecewise linear curve (see gluPwlCurve) or as a single NURBS curve (see gluNurbsCurve), or as a combination of both in any order. The only library calls that can appear in a trimming loop definition (between the calls to gluBeginTrim and gluEndTrim) are gluPwlCurve and gluNurbsCurve. The area of the NURBS surface that is displayed is the region in the domain to the left of the trimming curve as the curve parameter increases. Thus, the retained region of the NURBS surface is inside a counterclockwise trimming loop and outside a clockwise trimming loop. For the rectangle mentioned earlier, the trimming loop for the outer edge of the rectangle runs counterclockwise, while the trimming loop for the punched-out hole runs clockwise. If you use more than one curve to define a single trimming loop, the curve segments must form a closed loop (that is, the endpoint of each curve must be the starting point of the next curve, and the endpoint of the final curve must be the starting point of the first curve). If the endpoints of the curve are sufficiently close together but not exactly coincident, they will be coerced to match. If the endpoints are not sufficiently close, an error results (see gluNurbsCallback). If a trimming loop definition contains multiple curves, the direction of the curves must be consistent (that is, the inside must be to the left of all of the curves). Nested trimming loops are legal as long as the curve orientations alternate correctly. Trimming curves cannot be self- intersecting, nor can they intersect one another (or an error results). If no trimming information is given for a NURBS surface, the entire surface is drawn. Example This code fragment defines a trimming loop that consists of one piecewise linear curve, and two NURBS curves: gluBeginTrim(nobj); gluPwlCurve(..., GLU_MAP1_TRIM_2); gluNurbsCurve(..., GLU_MAP1_TRIM_2); gluNurbsCurve(..., GLU_MAP1_TRIM_3); gluEndTrim(nobj); See Also gluBeginSurface, gluNewNurbsRenderer, gluNurbsCallback, gluNurbsCurve, gluPwlCurve ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.140. gluBuild1DMipmaps ═══ OpenGL man pages gluBuild1DMipmaps Name gluBuild1DMipmaps - create 1-D mipmaps C Specification int gluBuild1DMipmaps( GLenum target, GLint components, GLint width, GLenum format, GLenum type, const void *data ) Parameters target Specifies the target texture. Must be GL_TEXTURE_1D. components Specifies the number of color components in the texture. Must be 1, 2, 3, or 4. width Specifies the width of the texture image. format Specifies the format of the pixel data. Must be one of GL_COLOR_INDEX, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_LUMINANCE, and GL_LUMINANCE_ALPHA. type Specifies the data type for data. Must be one of GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, or GL_FLOAT. data Specifies a pointer to the image data in memory. Description gluBuild1DMipmaps obtains the input image and generates all mipmap images (using gluScaleImage) so that the input image can be used as a mipmapped texture image. glTexImage1D is then called to load each of the images. If the width of the input image is not a power of two, then the image is scaled to the nearest power of two before the mipmaps are generated. A return value of zero indicates success. Otherwise, a GLU error code is returned (see gluErrorString). Please refer to the glTexImage1D reference page for a description of the acceptable values for the format parameter. See the glDrawPixels reference page for a description of the acceptable values for the type parameter. See Also glTexImage1D, gluBuild2DMipmaps, gluErrorString, gluScaleImage ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.141. gluBuild2DMipmaps ═══ OpenGL man pages gluBuild2DMipmaps Name gluBuild2DMipmaps - create 2-D mipmaps C Specification int gluBuild2DMipmaps( GLenum target, GLint components, GLint width, GLint height, GLenum format, GLenum type, const void *data ) Parameters target Specifies the target texture. Must be GL_TEXTURE_2D. components Specifies the number of color components in the texture. Must be 1, 2, 3, or 4. width, height Specifies the width and height, respectively, of the texture image. format Specifies the format of the pixel data. Must be one of: GL_COLOR_INDEX, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_LUMINANCE, and GL_LUMINANCE_ALPHA. type Specifies the data type for data. Must be one of: GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, or GL_FLOAT. data Specifies a pointer to the image data in memory. Description gluBuild2DMipmaps obtains the input image and generates all mipmap images (using gluScaleImage) so that the input image can be used as a mipmapped texture image. glTexImage2D is then called to load each of the images. If the dimensions of the input image are not powers of two, then the image is scaled so that both the width and height are powers of two before the mipmaps are generated. A return value of 0 indicates success. Otherwise, a GLU error code is returned (see gluErrorString). Please refer to the glTexImage1D reference page for a description of the acceptable values for the format parameter. See the glDrawPixels reference page for a description of the acceptable values for the type parameter. See Also glDrawPixels, glTexImage1D, glTexImage2D, gluBuild1DMipmaps, gluErrorString, gluScaleImage ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.142. gluCylinder ═══ OpenGL man pages gluCylinder Name gluCylinder - draw a cylinder C Specification void gluCylinder( GLUquadricObj *qobj, GLdouble baseRadius, GLdouble topRadius, GLdouble height, GLint slices, GLint stacks ) Parameters qobj Specifies the quadrics object (created with gluNewQuadric). baseRadius Specifies the radius of the cylinder at z = 0. topRadius Specifies the radius of the cylinder at z = height. height Specifies the height of the cylinder. slices Specifies the number of subdivisions around the z axis. stacks Specifies the number of subdivisions along the z axis. Description gluCylinder draws a cylinder oriented along the z axis. The base of the cylinder is placed at z = 0, and the top at z=height. Like a sphere, a cylinder is subdivided around the z axis into slices, and along the z axis into stacks. Note that if topRadius is set to zero, then this routine will generate a cone. If the orientation is set to GLU_OUTSIDE (with gluQuadricOrientation), then any generated normals point away from the z axis. Otherwise, they point toward the z axis. If texturing is turned on (with gluQuadricTexture), then texture coordinates are generated so that t ranges linearly from 0.0 at z = 0 to 1.0 at z = height, and s ranges from 0.0 at the +y axis, to 0.25 at the +x axis, to 0.5 at the -y axis, to 0.75 at the -x axis, and back to 1.0 at the +y axis. See Also gluDisk, gluNewQuadric, gluPartialDisk, gluQuadricTexture, gluSphere ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.143. gluDeleteNurbsRenderer ═══ OpenGL man pages gluDeleteNurbsRenderer Name gluDeleteNurbsRenderer - destroy a NURBS object C Specification void gluDeleteNurbsRenderer( GLUnurbsObj *nobj ) Parameters nobj Specifies the NURBS object to be destroyed (created with gluNewNurbsRenderer). Description gluDeleteNurbsRenderer destroys the NURBS object and frees any memory used by it. Once gluDeleteNurbsRenderer has been called, nobj cannot be used again. See Also gluNewNurbsRenderer ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.144. gluDeleteQuadric ═══ OpenGL man pages gluDeleteQuadric Name gluDeleteQuadric - destroy a quadrics object C Specification void gluDeleteQuadric( GLUquadricObj *state ) Parameters state Specifies the quadrics object to be destroyed (created with gluNewQuadric). Description gluDeleteQuadric destroys the quadrics object and frees any memory used by it. Once gluDeleteQuadric has been called, state cannot be used again. See Also gluNewQuadric ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.145. gluDeleteTess ═══ OpenGL man pages gluDeleteTess (GLU version 1.2 and later) Name gluDeleteTess - destroy a tessellation object C Specification void gluDeleteTess( GLUtesselator *tess ) Parameters tess Specifies the tessellation object to destroy (created with gluNewTess). Description gluDeleteTess destroys the indicated tessellation object and frees any memory that it used. See Also gluBeginPolygon, gluNewTess, gluTessCallback ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.146. gluDeleteTess ═══ OpenGL man pages gluDeleteTess (GLU version 1.0 and 1.1) Name gluDeleteTess - destroy a tessellation object C Specification void gluDeleteTess( GLUtriangulatorObj *tobj ) Parameters tobj Specifies the tessellation object to destroy (created with gluNewTess). Description gluDeleteTess destroys the indicated tessellation object and frees any memory that it used. See Also gluBeginPolygon, gluNewTess, gluTessCallback ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.147. gluDisk ═══ OpenGL man pages gluDisk Name gluDisk - draw a disk C Specification void gluDisk( GLUquadricObj *qobj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops ) Parameters qobj Specifies the quadrics object (created with gluNewQuadric). innerRadius Specifies the inner radius of the disk (may be 0). outerRadius Specifies the outer radius of the disk. slices Specifies the number of subdivisions around the z axis. loops Specifies the number of concentric rings about the origin into which the disk is subdivided. Description gluDisk renders a disk on the z = 0 plane. The disk has a radius of outerRadius, and contains a concentric circular hole with a radius of innerRadius. If innerRadius is 0, then no hole is generated. The disk is subdivided around the z axis into slices (like pizza slices), and also about the z axis into rings (as specified by slices and loops, respectively). With respect to orientation, the +z side of the disk is considered to be "outside" (see gluQuadricOrientation). This means that if the orientation is set to GLU_OUTSIDE, then any normals generated point along the +z axis. Otherwise, they point along the -z axis. If texturing is turned on (with gluQuadricTexture), texture coordinates are generated linearly such that where r=outerRadius, the value at (r, 0, 0) is (1, 0.5), at (0, r, 0) it is (0.5, 1), at (-r, 0, 0) it is (0, 0.5), and at (0, -r, 0) it is (0.5, 0). See Also gluCylinder, gluNewQuadric, gluPartialDisk, gluQuadricOrientation, gluQuadricTexture, gluSphere ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.148. gluErrorString ═══ OpenGL man pages gluErrorString Name gluErrorString - produce an error string from an OpenGL or GLU error code C Specification const GLubyte* gluErrorString( GLenum errorCode ) Parameters errorCode Specifies an OpenGL or GLU error code. Description gluErrorString produces an error string from an OpenGL or GLU error code. The string is in an ISO Latin 1 format. For example, gluErrorString(GL_OUT_OF_MEMORY) returns the string out of memory. The standard GLU error codes are GLU_INVALID_ENUM, GLU_INVALID_VALUE, and GLU_OUT_OF_MEMORY. Certain other GLU functions can return specialized error codes through callbacks. Refer to the glGetError reference page for the list of OpenGL error codes. See Also glGetError, gluNurbsCallback, gluQuadricCallback, gluTessCallback ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.149. gluGetNurbsProperty ═══ OpenGL man pages gluGetNurbsProperty Name gluGetNurbsProperty - get a NURBS property C Specification void gluGetNurbsProperty( GLUnurbsObj *nobj, GLenum property, GLfloat *value ) Parameters nobj Specifies the NURBS object (created with gluNewNurbsRenderer). property Specifies the property whose value is to be fetched. Valid values are GLU_CULLING, GLU_SAMPLING_TOLERANCE, GLU_DISPLAY_MODE, GLU_AUTO_LOAD_MATRIX, GLU_PARAMETRIC_TOLERANCE, GLU_SAMPLING_METHOD, GLU_U_STEP, and GLU_V_STEP. value Specifies a pointer to the location into which the value of the named property is written. Description gluGetNurbsProperty is used to retrieve properties stored in a NURBS object. These properties affect the way that NURBS curves and surfaces are rendered. Please refer to the gluNurbsProperty reference page for information about what the properties are and what they do. See Also gluNewNurbsRenderer, gluNurbsProperty Notes GLU_PARAMETRIC_TOLERANCE, GLU_SAMPLING_METHOD, GLU_U_STEP, and GLU_V_STEP are additions to GLU starting with GLU version 1.1. This version can be distinguished during compilation by checking if the pre-processor symbol GLU_VERSION_1_1 is defined. ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.150. gluGetTessProperty ═══ OpenGL man pages gluGetTessProperty (GLU version 1.2 and later) Name gluGetTessProperty - get a tessellation object property C Specification void gluGetTessProperty( GLUtesselator *tess, GLenum which, GLdouble *value ) Parameters tess Specifies the tessellation object (created with gluNewTess). which Specifies the property whose value is to be fetched. Valid values are GLU_TESS_WINDING_RULE, GLU_TESS_BOUNDARY_ONLY, and GLU_TESS_TOLERANCE. value Specifies a pointer to the location into which the value of the named property is written. Description gluGetTessProperty is used to retrieve properties stored in a tessellation object. These properties affect the way that tessellation objects are interpreted and rendered. Please refer to the gluTessProperty reference page for information about what the properties are and what they do. See Also gluNewTess, gluTessProperty ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.151. gluLoadSamplingMatrices ═══ OpenGL man pages gluLoadSamplingMatrices Name gluLoadSamplingMatrices - load NURBS sampling and culling matrices C Specification void gluLoadSamplingMatrices( GLUnurbsObj *nobj, const GLfloat modelMatrix[16], const GLfloat projMatrix[16], const GLint viewport[4]); ) Parameters nobj Specifies the NURBS object (created with gluNewNurbsRenderer). modelMatrix Specifies a modelview matrix (as from a glGetFloatv call). projMatrix Specifies a projection matrix (as from a glGetFloatv call). viewport; Specifies a viewport (as from a glGetIntegerv call). Description gluLoadSamplingMatrices uses modelMatrix, projMatrix, and viewport; to recompute the sampling and culling matrices stored in nobj. The sampling matrix determines how finely a NURBS curve or surface must be tessellated to satisfy the sampling tolerance (as determined by the GLU_SAMPLING_TOLERANCE property). The culling matrix is used in deciding if a NURBS curve or surface should be culled before rendering (when the GLU_CULLING property is turned on). gluLoadSamplingMatrices is necessary only if the GLU_AUTO_LOAD_MATRIX property is turned off (see gluNurbsProperty). Although it can be convenient to leave the GLU_AUTO_LOAD_MATRIX property turned on, there can be a performance penalty for doing so. (A round trip to the OpenGL server is needed to fetch the current values of the modelview matrix, projection matrix, and viewport.) See Also gluGetNurbsProperty, gluNewNurbsRenderer, gluNurbsProperty ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.152. gluLookAt ═══ OpenGL man pages gluLookAt Name gluLookAt - define a viewing transformation C Specification void gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, GLdouble upz ) Parameters eyex, eyey, eyez Specifies the position of the eye point. centerx, centery, centerz Specifies the position of the reference point. upx, upy, upz Specifies the direction of the up vector. Description gluLookAt creates a viewing matrix derived from an eye point, a reference point indicating the center of the scene, and an up vector. The matrix maps the reference point to the negative z axis and the eye point to the origin, so that, when a typical projection matrix is used, the center of the scene maps to the center of the viewport. Similarly, the direction described by the up vector projected onto the viewing plane is mapped to the positive y axis so that it points upward in the viewport. The up vector must not be parallel to the line of sight from the eye to the reference point. The matrix generated by gluLookAt postmultiplies the current matrix. See Also glFrustum, gluPerspective ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.153. gluNewNurbsRenderer ═══ OpenGL man pages gluNewNurbsRenderer Name gluNewNurbsRenderer - create a NURBS object C Specification GLUnurbsObj* gluNewNurbsRenderer( void ) Description gluNewNurbsRenderer creates and returns a pointer to a new NURBS object. This object must be referred to when calling NURBS rendering and control functions. A return value of zero means that there is not enough memory to allocate the object. See Also gluBeginCurve, gluBeginSurface, gluBeginTrim, gluDeleteNurbsRenderer, gluNurbsCallback, gluNurbsProperty ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.154. gluNewQuadric ═══ OpenGL man pages gluNewQuadric Name gluNewQuadric - create a quadrics object C Specification GLUquadricObj* gluNewQuadric( void ) Description gluNewQuadric creates and returns a pointer to a new quadrics object. This object must be referred to when calling quadrics rendering and control functions. A return value of zero means that there is not enough memory to allocate the object. See Also gluCylinder, gluDeleteQuadric, gluDisk, gluPartialDisk, gluQuadricCallback, gluQuadricDrawStyle, gluQuadricNormals, gluQuadricOrientation, gluQuadricTexture, gluSphere ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.155. gluNewTess ═══ OpenGL man pages gluNewTess (GLU version 1.2 and later) Name gluNewTess - create a tessellation object C Specification GLUtesselator* gluNewTess( void ) Description gluNewTess creates and returns a pointer to a new tessellation object. This object must be referred to when calling tessellation functions. A return value of zero means that there is not enough memory to allocate the object. See Also gluTessBeginPolygon, gluDeleteTess, gluTessCallback ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.156. gluNewTess ═══ OpenGL man pages gluNewTess (GLU versions 1.0 and 1.1) Name gluNewTess - create a tessellation object C Specification GLUtriangulatorObj* gluNewTess( void ) Description gluNewTess creates and returns a pointer to a new tessellation object. This object must be referred to when calling tessellation functions. A return value of zero means that there is not enough memory to allocate the object. See Also gluBeginPolygon, gluDeleteTess, gluTessCallback ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.157. gluNextContour ═══ OpenGL man pages gluNextContour (Obsolete in GLU version 1.2 and later) Name gluNextContour - mark the beginning of another contour C Specification void gluNextContour( GLUtesselator *tess, GLenum type ) Parameters tess Specifies the tessellation object (created with gluNewTess). type Specifies the type of the contour being defined. Valid values are GLU_EXTERIOR, GLU_INTERIOR, GLU_UNKNOWN, GLU_CCW, and GLU_CW. Description gluNextContour is used in describing polygons with multiple contours. After the first contour has been described through a series of gluTessVertex calls, a gluNextContour call indicates that the previous contour is complete and that the next contour is about to begin. Another series of gluTessVertex calls is then used to describe the new contour. This process can be repeated until all contours have been described. type defines what type of contour follows. The legal contour types are as follows: GLU_EXTERIOR An exterior contour defines an exterior boundary of the polygon. GLU_INTERIOR An interior contour defines an interior boundary of the polygon (such as a hole). GLU_UNKNOWN An unknown contour is analyzed by the library to determine if it is interior or exterior. GLU_CCW, GLU_CW The first GLU_CCW or GLU_CW contour defined is considered to be exterior. All other contours are considered to be exterior if they are oriented in the same direction (clockwise or counterclockwise) as the first contour, and interior if they are not. If one contour is of type GLU_CCW or GLU_CW, then all contours must be of the same type (if they are not, then all GLU_CCW and GLU_CW contours will be changed to GLU_UNKNOWN). Note that there is no real difference between the GLU_CCW and GLU_CW contour types. gluNextContour can be called before the first contour is described to define the type of the first contour. If gluNextContour is not called before the first contour, then the first contour is marked GLU_EXTERIOR. Notes As of GLU version 1.2, this command is obsolete and is provided for backwards compatibility only. GLU version 1.2 (and later) can be distinguished during compilation by checking if the pre-processor symbol GLU_VERSION_1_2 is defined. Calls to gluNextContour are mapped to gluTessEndContour followed by gluTessBeginContour. Example A quadrilateral with a triangular hole in it can be described as follows: gluBeginPolygon(tobj); gluTessVertex(tobj, v1, v1); gluTessVertex(tobj, v2, v2); gluTessVertex(tobj, v3, v3); gluTessVertex(tobj, v4, v4); gluNextContour(tobj, GLU_INTERIOR); gluTessVertex(tobj, v5, v5); gluTessVertex(tobj, v6, v6); gluTessVertex(tobj, v7, v7); gluEndPolygon(tobj); See Also gluBeginPolygon, gluNewTess, gluTessCallback, gluTessVertex, gluTessBeginContour ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.158. gluNextContour ═══ OpenGL man pages gluNextContour (GLU versions 1.0 and 1.1) Name gluNextContour - mark the beginning of another contour C Specification void gluNextContour( GLUtriangulatorObj *tobj, GLenum type ) Parameters tobj Specifies the tessellation object (created with gluNewTess). type Specifies the type of the contour being defined. Valid values are GLU_EXTERIOR, GLU_INTERIOR, GLU_UNKNOWN, GLU_CCW, and GLU_CW. Description gluNextContour is used in describing polygons with multiple contours. After the first contour has been described through a series of gluTessVertex calls, a gluNextContour call indicates that the previous contour is complete and that the next contour is about to begin. Another series of gluTessVertex calls is then used to describe the new contour. This process can be repeated until all contours have been described. type defines what type of contour follows. The legal contour types are as follows: GLU_EXTERIOR An exterior contour defines an exterior boundary of the polygon. GLU_INTERIOR An interior contour defines an interior boundary of the polygon (such as a hole). GLU_UNKNOWN An unknown contour is analyzed by the library to determine if it is interior or exterior. GLU_CCW, GLU_CW The first GLU_CCW or GLU_CW contour defined is considered to be exterior. All other contours are considered to be exterior if they are oriented in the same direction (clockwise or counterclockwise) as the first contour, and interior if they are not. If one contour is of type GLU_CCW or GLU_CW, then all contours must be of the same type (if they are not, then all GLU_CCW and GLU_CW contours will be changed to GLU_UNKNOWN). Note that there is no real difference between the GLU_CCW and GLU_CW contour types. gluNextContour can be called before the first contour is described to define the type of the first contour. If gluNextContour is not called before the first contour, then the first contour is marked GLU_EXTERIOR. Example A quadrilateral with a triangular hole in it can be described as follows: gluBeginPolygon(tobj); gluTessVertex(tobj, v1, v1); gluTessVertex(tobj, v2, v2); gluTessVertex(tobj, v3, v3); gluTessVertex(tobj, v4, v4); gluNextContour(tobj, GLU_INTERIOR); gluTessVertex(tobj, v5, v5); gluTessVertex(tobj, v6, v6); gluTessVertex(tobj, v7, v7); gluEndPolygon(tobj); See Also gluBeginPolygon, gluNewTess, gluTessCallback, gluTessVertex ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.159. gluNurbsCallback ═══ OpenGL man pages gluNurbsCallback Name gluNurbsCallback - define a callback for a NURBS object C Specification void gluNurbsCallback( GLUnurbsObj *nobj, GLenum which, void (*fn)( ) Parameters nobj Specifies the NURBS object (created with gluNewNurbsRenderer). which Specifies the callback being defined. The only valid value is GLU_ERROR. fn Specifies the function that the callback calls. Description gluNurbsCallback is used to define a callback to be used by a NURBS object. If the specified callback is already defined, then it is replaced. If fn is NULL, then any existing callback is erased. The one legal callback is GLU_ERROR: GLU_ERROR The error function is called when an error is encountered. Its single argument is of type GLenum, and it indicates the specific error that occurred. There are 37 errors unique to NURBS named GLU_NURBS_ERROR1 through GLU_NURBS_ERROR37. Character strings describing these errors can be retrieved with gluErrorString. See Also gluErrorString, gluNewNurbsRenderer ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.160. gluNurbsCurve ═══ OpenGL man pages gluNurbsCurve Name gluNurbsCurve - define the shape of a NURBS curve C Specification void gluNurbsCurve( GLUnurbsObj *nobj, GLint nknots, GLfloat *knot, GLint stride, GLfloat *ctlarray, GLint order, GLenum type ) Parameters nobj Specifies the NURBS object (created with gluNewNurbsRenderer). nknots Specifies the number of knots in knot. nknots equals the number of control points plus the order. knot Specifies an array of nknots nondecreasing knot values. stride Specifies the offset (as a number of single-precision floating- point values) between successive curve control points. ctlarray Specifies a pointer to an array of control points. The coordinates must agree with type, specified below. order Specifies the order of the NURBS curve. order equals degree + 1, hence a cubic curve has an order of 4. type Specifies the type of the curve. If this curve is defined within a gluBeginCurve/gluEndCurve pair, then the type can be any of the valid one-dimensional evaluator types (such as GL_MAP1_VERTEX_3 or GL_MAP1_COLOR_4). Between a gluBeginTrim/gluEndTrim pair, the only valid types are GLU_MAP1_TRIM_2 and GLU_MAP1_TRIM_3. Description Use gluNurbsCurve to describe a NURBS curve. When gluNurbsCurve appears between a gluBeginCurve/gluEndCurve pair, it is used to describe a curve to be rendered. Positional, texture, and color coordinates are associated by presenting each as a separate gluNurbsCurve between a gluBeginCurve/gluEndCurve pair. No more than one call to gluNurbsCurve for each of color, position, and texture data can be made within a single gluBeginCurve/gluEndCurve pair. Exactly one call must be made to describe the position of the curve (a type of GL_MAP1_VERTEX_3 or GL_MAP1_VERTEX_4). When gluNurbsCurve appears between a gluBeginTrim/gluEndTrim pair, it is used to describe a trimming curve on a NURBS surface. If type is GLU_MAP1_TRIM_2, then it describes a curve in two-dimensional (u and v) parameter space. If it is GLU_MAP1_TRIM_3, then it describes a curve in two-dimensional homogeneous (u, v, and w) parameter space. See the gluBeginTrim reference page for more discussion about trimming curves. Example The following commands render a textured NURBS curve with normals: gluBeginCurve(nobj); gluNurbsCurve(nobj, ..., GL_MAP1_TEXTURE_COORD_2); gluNurbsCurve(nobj, ..., GL_MAP1_NORMAL); gluNurbsCurve(nobj, ..., GL_MAP1_VERTEX_4); gluEndCurve(nobj); Notes To define trim curves which stitch well use gluPwlCurve. See Also gluBeginCurve, gluBeginTrim, gluNewNurbsRenderer, gluPwlCurve ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.161. gluNurbsProperty ═══ OpenGL man pages gluNurbsProperty Name gluNurbsProperty - set a NURBS property C Specification void gluNurbsProperty( GLUnurbsObj *nobj, GLenum property, GLfloat value ) Parameters nobj Specifies the NURBS object (created with gluNewNurbsRenderer). property Specifies the property to be set. Valid values are GLU_SAMPLING_TOLERANCE, GLU_DISPLAY_MODE, GLU_CULLING, GLU_AUTO_LOAD_MATRIX, GLU_PARAMETRIC_TOLERANCE, GLU_SAMPLING_METHOD, GLU_U_STEP, or GLU_V_STEP. value Specifies the value of the indicated property. It may be a numeric value, or one of GLU_PATH_LENGTH, GLU_PARAMETRIC_ERROR, or GLU_DOMAIN_DISTANCE. Description gluNurbsProperty is used to control properties stored in a NURBS object. These properties affect the way that a NURBS curve is rendered. The legal values for property are as follows: GLU_SAMPLING_METHOD specifies how a NURBS surface should be tessellated. value may be set to one of GLU_PATH_LENGTH, GLU_PARAMETRIC_ERROR, or GLU_DOMAIN_DISTANCE. When set to GLU_PATH_LENGTH, the surface is rendered so that the maximum length, in pixels, of the edges of the tessellation polygons is no greater than what is specified by GLU_SAMPLING_TOLERANCE. GLU_PARAMETRIC_ERROR specifies that the surface is rendered in such a way that the value specified by GLU_PARAMETRIC_TOLERANCE describes the maximum distance, in pixels, between the tessellation polygons and the surfaces they approximate. GLU_DOMAIN_DISTANCE allows users to specify, in parametric coordinates, how many sample points per unit length are taken in u, v direction. The default value of GLU_SAMPLING_METHOD is GLU_PATH_LENGTH. GLU_SAMPLING_TOLERANCE specifies the maximum length, in pixels to use when the sampling method is set to GLU_PATH_LENGTH. The NURBS code is conservative when rendering a curve or surface, so the actual length can be somewhat shorter. The default value is 50.0 pixels. GLU_PARAMETRIC_TOLERANCE specifies the maximum distance, in pixels, to use when the sampling method is set to GLU_PARAMETRIC_ERROR. The default value for GLU_PARAMETRIC_TOLERANCE is 0.5. GLU_U_STEP specifies the number of sample points per unit length taken along the u axis in parametric coordinates. It is needed when GLU_SAMPLING_METHOD is set to GLU_DOMAIN_DISTANCE. The default value is 100. GLU_V_STEP specifies the number of sample points per unit length taken along the v axis in parametric coordinate. It is needed when GLU_SAMPLING_METHOD is set to GLU_DOMAIN_DISTANCE. The default value is 100. GLU_DISPLAY_MODE value defines how a NURBS surface should be rendered. value can be set to GLU_FILL, GLU_OUTLINE_POLYGON, or GLU_OUTLINE_PATCH. When set to GLU_FILL, the surface is rendered as a set of polygons. GLU_OUTLINE_POLYGON instructs the NURBS library to draw only the outlines of the polygons created by tessellation. GLU_OUTLINE_PATCH causes just the outlines of patches and trim curves defined by the user to be drawn. The default value is GLU_FILL. GLU_CULLING value is a Boolean value that, when set to GL_TRUE, indicates that a NURBS curve should be discarded prior to tessellation if its control points lie outside the current viewport. The default is GL_FALSE (because a NURBS curve cannot fall entirely within the convex hull of its control points). GLU_AUTO_LOAD_MATRIX value is a Boolean value. When set to GL_TRUE, the NURBS code downloads the projection matrix, the modelview matrix, and the viewport from the OpenGL server to compute sampling and culling matrices for each NURBS curve that is rendered. Sampling and culling matrices are required to determine the tesselation of a NURBS surface into line segments or polygons and to cull a NURBS surface if it lies outside of the viewport. If this mode is set to GL_FALSE, then the user needs to provide a projection matrix, a modelview matrix, and a viewport for the NURBS renderer to use to construct sampling and culling matrices. This can be done with the gluLoadSamplingMatrices function. The default for this mode is GL_TRUE. Changing this mode from GL_TRUE to GL_FALSE does not affect the sampling and culling matrices until gluLoadSamplingMatrices is called. Notes A property of GLU_PARAMETRIC_TOLERANCE, GLU_SAMPLING_METHOD, GLU_U_STEP, or GLU_V_STEP, or a value of GLU_PATH_LENGTH, GLU_PARAMETRIC_ERROR, GLU_DOMAIN_DISTANCE will only be supported in GLU version number 1.1. They are not valid parameters in GLU 1.0. gluGetString can be used to determine the GLU version. See Also gluGetNurbsProperty, gluLoadSamplingMatrices, gluNewNurbsRenderer, gluGetString. ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.162. gluNurbsSurface ═══ OpenGL man pages gluNurbsSurface Name gluNurbsSurface - define the shape of a NURBS surface C Specification void gluNurbsSurface( GLUnurbsObj *nobj, GLint uknot_count, GLfloat *uknot, GLint vknot_count, GLfloat *vknot, GLint u_stride, GLint v_stride, GLfloat *ctlarray, GLint uorder, GLint vorder, GLenum type ) Parameters nobj Specifies the NURBS object (created with gluNewNurbsRenderer). uknot_count Specifies the number of knots in the parametric u direction. uknot Specifies an array of uknot_count nondecreasing knot values in the parametric u direction. vknot_count Specifies the number of knots in the parametric v direction. vknot Specifies an array of vknot_count nondecreasing knot values in the parametric v direction. u_stride Specifies the offset (as a number of single-precision floating point values) between successive control points in the parametric u direction in ctlarray. v_stride Specifies the offset (in single-precision floating-point values) between successive control points in the parametric v direction in ctlarray. ctlarray Specifies an array containing control points for the NURBS surface. The offsets between successive control points in the parametric u and v directions are given by u_stride and v_stride. uorder Specifies the order of the NURBS surface in the parametric u direction. The order is one more than the degree, hence a surface that is cubic in u has a u order of 4. vorder Specifies the order of the NURBS surface in the parametric v direction. The order is one more than the degree, hence a surface that is cubic in v has a v order of 4. type Specifies type of the surface. type can be any of the valid two-dimensional evaluator types (such as GL_MAP2_VERTEX_3 or GL_MAP2_COLOR_4). Description Use gluNurbsSurface within a NURBS (Non-Uniform Rational B-Spline) surface definition to describe the shape of a NURBS surface (before any trimming). To mark the beginning of a NURBS surface definition, use the gluBeginSurface command. To mark the end of a NURBS surface definition, use the gluEndSurface command. Call gluNurbsSurface within a NURBS surface definition only. Positional, texture, and color coordinates are associated with a surface by presenting each as a separate gluNurbsSurface between a gluBeginSurface/gluEndSurface pair. No more than one call to gluNurbsSurface for each of color, position, and texture data can be made within a single gluBeginSurface/gluEndSurface pair. Exactly one call must be made to describe the position of the surface (a type of GL_MAP2_VERTEX_3 or GL_MAP2_VERTEX_4). A NURBS surface can be trimmed by using the commands gluNurbsCurve and gluPwlCurve between calls to gluBeginTrim and gluEndTrim. Note that a gluNurbsSurface with uknot_count knots in the u direction and vknot_count knots in the v direction with orders uorder and vorder must have (uknot_count - uorder) x (vknot_count - vorder) control points. Example The following commands render a textured NURBS surface with normals; the texture coordinates and normals are also NURBS surfaces: gluBeginSurface(nobj); gluNurbsSurface(nobj, ..., GL_MAP2_TEXTURE_COORD_2); gluNurbsSurface(nobj, ..., GL_MAP2_NORMAL); gluNurbsSurface(nobj, ..., GL_MAP2_VERTEX_4); gluEndSurface(nobj); See Also gluBeginSurface, gluBeginTrim, gluNewNurbsRenderer, gluNurbsCurve, gluPwlCurve ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.163. gluOrtho2D ═══ OpenGL man pages gluOrtho2D Name gluOrtho2D - define a 2-D orthographic projection matrix C Specification void gluOrtho2D( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top ) Parameters left, right Specify the coordinates for the left and right vertical clipping planes. bottom, top Specify the coordinates for the bottom and top horizontal clipping planes. Description gluOrtho2D sets up a two-dimensional orthographic viewing region. This is equivalent to calling glOrtho with near=-1 and far=1. See Also glOrtho, gluPerspective ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.164. gluPartialDisk ═══ OpenGL man pages gluPartialDisk Name gluPartialDisk - draw an arc of a disk C Specification void gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops, GLdouble startAngle, GLdouble sweepAngle ) Parameters qobj Specifies a quadrics object (created with gluNewQuadric). innerRadius Specifies the inner radius of the partial disk (can be zero). outerRadius Specifies the outer radius of the partial disk. slices Specfies the number of subdivisions around the z axis. loops Specifies the number of concentric rings about the origin into which the partial disk is subdivided. startAngle Specifies the starting angle, in degrees, of the disk portion. sweepAngle Specifies the sweep angle, in degrees, of the disk portion. Description gluPartialDisk renders a partial disk on the z=0 plane. A partial disk is similar to a full disk, except that only the subset of the disk from startAngle through startAngle + sweepAngle is included (where 0 degrees is along the +y axis, 90 degrees along the +x axis, 180 along the -y axis, and 270 along the -x axis). The partial disk has a radius of outerRadius, and contains a concentric circular hole with a radius of innerRadius. If innerRadius is zero, then no hole is generated. The partial disk is subdivided around the z axis into slices (like pizza slices), and also about the z axis into rings (as specified by slices and loops, respectively). With respect to orientation, the +z side of the partial disk is considered to be outside (see gluQuadricOrientation). This means that if the orientation is set to GLU_OUTSIDE, then any normals generated point along the +z axis. Otherwise, they point along the -z axis. If texturing is turned on (with gluQuadricTexture), texture coordinates are generated linearly such that where r=outerRadius, the value at (r, 0, 0) is (1, 0.5), at (0, r, 0) it is (0.5, 1), at (-r, 0, 0) it is (0, 0.5), and at (0, -r, 0) it is (0.5, 0). See Also gluCylinder, gluDisk, gluNewQuadric, gluQuadricOrientation, gluQuadricTexture, gluSphere ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.165. gluPerspective ═══ OpenGL man pages gluPerspective Name gluPerspective - set up a perspective projection matrix C Specification void gluPerspective( GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar ) Parameters fovy Specifies the field of view angle, in degrees, in the y direction. aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). zNear Specifies the distance from the viewer to the near clipping plane (always positive). zFar Specifies the distance from the viewer to the far clipping plane (always positive). Description gluPerspective specifies a viewing frustum into the world coordinate system. In general, the aspect ratio in gluPerspective should match the aspect ratio of the associated viewport. For example, aspect=2.0 means the viewer's angle of view is twice as wide in x as it is in y. If the viewport is twice as wide as it is tall, it displays the image without distortion. The matrix generated by gluPerspective is multipled by the current matrix, just as if glMultMatrix were called with the generated matrix. To load the perspective matrix onto the current matrix stack instead, precede the call to gluPerspective with a call to glLoadIdentity. Given f defined as follows: fovy f = cotangent(----) 2 The generated matrix is | f | | ------ 0 0 0 | | aspect | | | | 0 f 0 0 | | | | zFar+zNear 2*zFar*zNear | | 0 0 ---------- ------------ | | zNear-zFar zNear-zFar | | | | 0 0 -1 0 | Notes Depth buffer precision is affected by the values specified for zNear and zFar. The greater the ratio of zFar to zNear is, the less effective the depth buffer will be at distinguishing between surfaces that are near each other. If zFar r = ----- zNear roughly log r bits of depth buffer precision are lost. Because r 2 approaches infinity as zNear approaches zero, zNear must never be set to zero. See Also glFrustum, glLoadIdentity, glMultMatrix, gluOrtho2D ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.166. gluPickMatrix ═══ OpenGL man pages gluPickMatrix Name gluPickMatrix - define a picking region C Specification void gluPickMatrix( GLdouble x, GLdouble y, GLdouble width, GLdouble height, GLint viewport[4] ) Parameters x, y Specify the center of a picking region in window coordinates. width, height Specify the width and height, respectively, of the picking region in window coordinates. viewport Specifies the current viewport (as from a glGetIntegerv call). Description gluPickMatrix creates a projection matrix that can be used to restrict drawing to a small region of the viewport. This is typically useful to determine what objects are being drawn near the cursor. Use gluPickMatrix to restrict drawing to a small region around the cursor. Then, enter selection mode (with glRenderMode and rerender the scene. All primitives that would have been drawn near the cursor are identified and stored in the selection buffer. The matrix created by gluPickMatrix is multiplied by the current matrix just as if glMultMatrix is called with the generated matrix. To effectively use the generated pick matrix for picking, first call glLoadIdentity to load an identity matrix onto the perspective matrix stack. Then call gluPickMatrix, and finally, call a command (such as gluPerspective) to multiply the perspective matrix by the pick matrix. When using gluPickMatrix to pick NURBS, be careful to turn off the NURBS property GLU_AUTO_LOAD_MATRIX. If GLU_AUTO_LOAD_MATRIX is not turned off, then any NURBS surface rendered is subdivided differently with the pick matrix than the way it was subdivided without the pick matrix. Example When rendering a scene as follows: glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(...); glMatrixMode(GL_MODELVIEW); /* Draw the scene */ a portion of the viewport can be selected as a pick region like this: glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPickMatrix(x, y, width, height, viewport); gluPerspective(...); glMatrixMode(GL_MODELVIEW); /* Draw the scene */ See Also glGet, glLoadIndentity, glMultMatrix, glRenderMode, gluPerspective ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.167. gluProject ═══ OpenGL man pages gluProject Name gluProject - map object coordinates to window coordinates C Specification int gluProject( GLdouble objx, GLdouble objy, GLdouble objz, const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *winx, GLdouble *winy, GLdouble *winz ) Parameters objx, objy, objz Specify the object coordinates. modelMatrix Specifies the current modelview matrix (as from a glGetDoublev call). projMatrix Specifies the current projection matrix (as from a glGetDoublev call). viewport Specifies the current viewport (as from a glGetIntegerv call). winx, winy, winz Return the computed window coordinates. Description gluProject transforms the specified object coordinates into window coordinates using modelMatrix, projMatrix, and viewport. The result is stored in winx, winy, and winz. A return value of GL_TRUE indicates success, and GL_FALSE indicates failure. See Also glGet, gluUnProject ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.168. gluPwlCurve ═══ OpenGL man pages gluPwlCurve Name gluPwlCurve - describe a piecewise linear NURBS trimming curve C Specification void gluPwlCurve( GLUnurbsObj *nobj, GLint count, GLfloat *array, GLint stride, GLenum type ) Parameters nobj Specifies the NURBS object (created with gluNewNurbsRenderer). count Specifies the number of points on the curve. array Specifies an array containing the curve points. stride Specifies the offset (a number of single-precision floating-point values) between points on the curve. type Specifies the type of curve. Must be either GLU_MAP1_TRIM_2 or GLU_MAP1_TRIM_3. Description gluPwlCurve describes a piecewise linear trimming curve for a NURBS surface. A piecewise linear curve consists of a list of coordinates of points in the parameter space for the NURBS surface to be trimmed. These points are connected with line segments to form a curve. If the curve is an approximation to a real curve, the points should be close enough that the resulting path appears curved at the resolution used in the application. If type is GLU_MAP1_TRIM_2, then it describes a curve in two-dimensional (u and v) parameter space. If it is GLU_MAP1_TRIM_3, then it describes a curve in two-dimensional homogeneous (u, v, and w) parameter space. Please refer to the gluBeginTrim reference page for more information about trimming curves. Notes To describe a trim curve which closely follows the contours of a Nurbs surface use gluNurbsCurve. See Also gluBeginCurve, gluBeginTrim, gluNewNurbsRenderer, gluNurbsCurve ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.169. gluQuadricCallback ═══ OpenGL man pages gluQuadricCallback Name gluQuadricCallback - define a callback for a quadrics object C Specification void gluQuadricCallback( GLUquadricObj *qobj, GLenum which, void (*fn)( ) Parameters qobj Specifies the quadrics object (created with gluNewQuadric). which Specifies the callback being defined. The only valid value is GLU_ERROR. fn Specifies the function to be called. Description gluQuadricCallback is used to define a new callback to be used by a quadrics object. If the specified callback is already defined, then it is replaced. If fn is NULL, then any existing callback is erased. The one legal callback is GLU_ERROR: GLU_ERROR The function is called when an error is encountered. Its single argument is of type GLenum, and it indicates the specific error that occurred. Character strings describing these errors can be retrieved with the gluErrorString call. See Also gluErrorString, gluNewQuadric ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.170. gluQuadricDrawStyle ═══ OpenGL man pages gluQuadricDrawStyle Name gluQuadricDrawStyle - specify the draw style desired for quadrics C Specification void gluQuadricDrawStyle( GLUquadricObj *qobj, GLenum drawStyle ) Parameters qobj Specifies the quadrics object (created with gluNewQuadric). drawStyle Specifies the desired draw style. Valid values are GLU_FILL, GLU_LINE, GLU_SILHOUETTE, and GLU_POINT. Description gluQuadricDrawStyle specifies the draw style for quadrics rendered with qobj. The legal values are as follows: GLU_FILL Quadrics are rendered with polygon primitives. The polygons are drawn in a counterclockwise fashion with respect to their normals (as defined with gluQuadricOrientation). GLU_LINE Quadrics are rendered as a set of lines. GLU_SILHOUETTE Quadrics are rendered as a set of lines, except that edges separating coplanar faces will not be drawn. GLU_POINT Quadrics are rendered as a set of points. See Also gluNewQuadric, gluQuadricNormals, gluQuadricOrientation, gluQuadricTexture ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.171. gluQuadricNormals ═══ OpenGL man pages gluQuadricNormals Name gluQuadricNormals - specify what kind of normals are desired for quadrics C Specification void gluQuadricNormals( GLUquadricObj *qobj, GLenum normals ) Parameters qobj Specifes the quadrics object (created with gluNewQuadric). normals Specifies the desired type of normals. Valid values are GLU_NONE, GLU_FLAT, and GLU_SMOOTH. Description gluQuadricNormals specifies what kind of normals are desired for quadrics rendered with qobj. The legal values are as follows: GLU_NONE No normals are generated. GLU_FLAT One normal is generated for every facet of a quadric. GLU_SMOOTH One normal is generated for every vertex of a quadric. This is the default. See Also gluNewQuadric, gluQuadricDrawStyle, gluQuadricOrientation, gluQuadricTexture ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.172. gluQuadricOrientation ═══ OpenGL man pages gluQuadricOrientation Name gluQuadricOrientation - specify inside/outside orientation for quadrics C Specification void gluQuadricOrientation( GLUquadricObj *qobj, GLenum orientation ) Parameters qobj Specifies the quadrics object (created with gluNewQuadric). orientation Specifies the desired orientation. Valid values are GLU_OUTSIDE and GLU_INSIDE. Description gluQuadricOrientation specifies what kind of orientation is desired for quadrics rendered with qobj. The orientation values are as follows: GLU_OUTSIDE Quadrics are drawn with normals pointing outward. GLU_INSIDE Normals point inward. The default is GLU_OUTSIDE. Note that the interpretation of outward and inward depends on the quadric being drawn. See Also gluNewQuadric, gluQuadricDrawStyle, gluQuadricNormals, gluQuadricTexture ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.173. gluQuadricTexture ═══ OpenGL man pages gluQuadricTexture Name gluQuadricTexture - specify if texturing is desired for quadrics C Specification void gluQuadricTexture( GLUquadricObj *qobj, GLboolean textureCoords ) Parameters qobj Specifies the quadrics object (created with gluNewQuadric). textureCoords Specifies a flag indicating if texture coordinates should be generated. Description gluQuadricTexture specifies if texture coordinates should be generated for quadrics rendered with qobj. If the value of textureCoords is GL_TRUE, then texture coordinates are generated, and if textureCoords is GL_FALSE, they are not. The default is GL_FALSE. The manner in which texture coordinates are generated depends upon the specific quadric rendered. See Also gluNewQuadric, gluQuadricDrawStyle, gluQuadricNormals, gluQuadricOrientation ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.174. gluScaleImage ═══ OpenGL man pages gluScaleImage Name gluScaleImage - scale an image to an arbitrary size C Specification int gluScaleImage( GLenum format, GLint widthin, GLint heightin, GLenum typein, const void *datain, GLint widthout, GLint heightout, GLenum typeout, void *dataout ) Parameters format Specifies the format of the pixel data. The following symbolic values are valid: GL_COLOR_INDEX, GL_STENCIL_INDEX, GL_DEPTH_COMPONENT, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_LUMINANCE, and GL_LUMINANCE_ALPHA. widthin, heightin Specify the width and height, respectively, of the source image that is scaled. typein Specifies the data type for datain. Must be one of GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, or GL_FLOAT. datain Specifies a pointer to the source image. widthout, heightout Specify the width and height, respectively, of the destination image. typeout Specifies the data type for dataout. Must be one of GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, or GL_FLOAT. dataout Specifies a pointer to the destination image. Description gluScaleImage scales a pixel image using the appropriate pixel store modes to unpack data from the source image and pack data into the destination image. When shrinking an image, gluScaleImage uses a box filter to sample the source image and create pixels for the destination image. When magnifying an image, the pixels from the source image are linearly interpolated to create the destination image. A return value of zero indicates success, otherwise a GLU error code is returned indicating what the problem was (see gluErrorString). Please refer to the glReadPixels reference page for a description of the acceptable values for the format, typein, and typeout parameters. See Also glDrawPixels, glReadPixels, gluBuild1DMipmaps, gluBuild2DMipmaps, gluErrorString ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.175. gluSphere ═══ OpenGL man pages gluSphere Name gluSphere - draw a sphere C Specification void gluSphere( GLUquadricObj *qobj, GLdouble radius, GLint slices, GLint stacks ) Parameters qobj Specifies the quadrics object (created with gluNewQuadric). radius Specifies the radius of the sphere. slices Specifies the number of subdivisions around the z axis (similar to lines of longitude). stacks Specifies the number of subdivisions along the z axis (similar to lines of latitude). Description gluSphere draws a sphere of the given radius centered around the origin. The sphere is subdivided around the z axis into slices and along the z axis into stacks (similar to lines of longitude and latitude). If the orientation is set to GLU_OUTSIDE (with gluQuadricOrientation), then any normals generated point away from the center of the sphere. Otherwise, they point toward the center of the sphere. If texturing is turned on (with gluQuadricTexture), then texture coordinates are generated so that t ranges from 0.0 at z=-radius to 1.0 at z=radius (t increases linearly along longitudinal lines), and s ranges from 0.0 at the +y axis, to 0.25 at the +x axis, to 0.5 at the -y axis, to 0.75 at the -x axis, and back to 1.0 at the +y axis. See Also gluCylinder, gluDisk, gluNewQuadric, gluPartialDisk, gluQuadricOrientation gluQuadricTexture ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.176. gluTessBeginContour ═══ OpenGL man pages gluTessBeginContour (GLU version 1.2 and later) Name gluTessBeginContour, gluTessEndContour - delimit a contour description C Specification void gluTessBeginContour( GLUtesselator *tess ) void gluTessEndContour( GLUtesselator *tess ) Parameters tess Specifies the tessellation object (created with gluNewTess). Description gluTessBeginContour and gluTessEndContour delimit the definition of a polygon contour. Within each gluTessBeginContour/gluTessEndContour pair, there can be zero or more calls to gluTessVertex. The vertices specify a closed contour (the last vertex of each contour is automatically linked to the first). See the gluTessVertex reference page for more details. gluTessBeginContour can only be called between gluTessBeginPolygon and gluTessEndPolygon. See Also gluNewTess, gluTessBeginPolygon, gluTessVertex, gluTessCallback, gluTessProperty, gluTessNormal, gluTessEndPolygon ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.177. gluTessBeginPolygon ═══ OpenGL man pages gluTessBeginPolygon (GLU version 1.2 and later) Name gluTessBeginPolygon - delimit a polygon description C Specification void gluTessBeginPolygon( GLUtesselator *tess, void *polygon_data ) Parameters tess Specifies the tessellation object (created with gluNewTess). polygon_data Specifies a pointer to user polygon data. Description gluTessBeginPolygon and gluTessEndPolygon delimit the definition of a nonconvex polygon. Within each gluTessBeginPolygon/gluTessEndPolygon pair, there must be one or more calls to gluTessBeginContour/gluTessEndContour. Within each contour, there are zero or more calls to gluTessVertex. The vertices specify a closed contour (the last vertex of each contour is automatically linked to the first). See the gluTessVertex, gluTessBeginContour and gluTessEndContour reference pages for more details. polygon_data is a pointer to a user-defined data structure. If the appropriate callback(s) are specified (see gluTessCallback), then this pointer is returned to the callback function(s). Thus, it is a convenient way to store per-polygon information. Once gluTessEndPolygon is called, the polygon is tessellated, and the resulting triangles are described through callbacks. See gluTessCallback for descriptions of the callback functions. Example A quadrilateral with a triangular hole in it can be described like this: gluTessBeginPolygon(tobj, NULL); gluTessBeginContour(tobj); gluTessVertex(tobj, v1, v1); gluTessVertex(tobj, v2, v2); gluTessVertex(tobj, v3, v3); gluTessVertex(tobj, v4, v4); gluTessEndContour(tobj); gluTessBeginContour(tobj); gluTessVertex(tobj, v5, v5); gluTessVertex(tobj, v6, v6); gluTessVertex(tobj, v7, v7); gluTessEndContour(tobj); gluTessEndPolygon(tobj); See Also gluNewTess, gluTessBeginContour, gluTessVertex, gluTessCallback, gluTessProperty, gluTessNormal gluTessEndPolygon ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.178. gluTessCallback ═══ OpenGL man pages gluTessCallback (GLU version 1.2 and later) Name gluTessCallback - define a callback for a tessellation object C Specification void gluTessCallback( GLUtesselator *tess, GLenum which, void (*fn)() ) Parameters tess Specifies the tessellation object (created with gluNewTess). which Specifies the callback being defined. The following values are valid: GLU_TESS_BEGIN, GLU_TESS_BEGIN_DATA, GLU_TESS_EDGE_FLAG, GLU_TESS_EDGE_FLAG_DATA, GLU_TESS_VERTEX, GLU_TESS_VERTEX_DATA, GLU_TESS_END, GLU_TESS_END_DATA, GLU_TESS_COMBINE, GLU_TESS_COMBINE_DATA, GLU_TESS_ERROR, and GLU_TESS_ERROR_DATA. fn Specifies the function to be called. Description gluTessCallback is used to indicate a callback to be used by a tessellation object. If the specified callback is already defined, then it is replaced. If fn is NULL, then the existing callback becomes undefined. These callbacks are used by the tessellation object to describe how a polygon specified by the user is broken into triangles. Note that there are two versions of each callback: one with user-specified polygon data and one without. If both versions of a particular callback are specified then the callback with user-specified polygon data will be used. Note that "polygon_data" is a copy of the pointer that was specified when gluTessBeginPolygon was called. The legal callbacks are as follows: GLU_TESS_BEGIN The begin callback is invoked like glBegin to indicate the start of a (triangle) primitive. The function takes a single argument of type GLenum. If the GLU_TESS_BOUNDARY_ONLY property is set to GL_FALSE then the argument is set to either GL_TRIANGLE_FAN, GL_TRIANGLE_STRIP, or GL_TRIANGLES. If the GLU_TESS_BOUNDARY_ONLY property is set to GL_TRUE then the argument will be set to GL_LINE_LOOP. The function prototype for this callback looks like: void begin ( GLenum type ); GLU_TESS_BEGIN_DATA The same as the GLU_TESS_BEGIN callback except that it takes an additional pointer argument. This pointer is identical to the opaque pointer provided when gluTessBeginPolygon was called. The function prototype for this callback looks like: void beginData ( GLenum type, void *polygon_data ); GLU_TESS_EDGE_FLAG The edge flag callback is similar to glEdgeFlag. The function takes a single Boolean flag that indicates which edges lie on the polygon boundary. If the flag is GL_TRUE, then each vertex that follows begins an edge which lies on the polygon boundary -- that is, an edge which separates an interior region from an exterior one. If the flag is GL_FALSE, then each vertex that follows begins an edge which lies in the polygon interior. The edge flag callback (if defined) is invoked before the first vertex callback is made. Since triangle fans and triangle strips do not support edge flags, the begin callback is not called with GL_TRIANGLE_FAN or GL_TRIANGLE_STRIP if an edge flag callback is provided. Instead, the fans and strips are converted to independent triangles. The function prototype for this callback looks like: void edgeFlag ( GLboolean flag ); GLU_TESS_EDGE_FLAG_DATA The same as the GLU_TESS_EDGE_FLAG callback except that it takes an additional pointer argument. This pointer is identical to the opaque pointer provided when gluTessBeginPolygon was called. The function prototype for this callback looks like: void edgeFlagData ( GLboolean flag, void *polygon_data ); GLU_TESS_VERTEX The vertex callback is invoked between the begin and end callbacks. It is similar to glVertex, and it defines the vertices of the triangles created by the tessellation process. The function takes a pointer as its only argument. This pointer is identical to the opaque pointer provided by the user when the vertex was described (see gluTessVertex). The function prototype for this callback looks like: void vertex ( void *vertex_data ); GLU_TESS_VERTEX_DATA The same as the GLU_TESS_VERTEX callback except that it takes an additional pointer argument. This pointer is identical to the opaque pointer provided when gluTessBeginPolygon was called. The function prototype for this callback looks like: void vertexData ( void *vertex_data, void *polygon_data ); GLU_TESS_END The end callback serves the same purpose as glEnd. It indicates the end of a primitive and it takes no arguments. The function prototype for this callback looks like: void end ( void ); GLU_TESS_END_DATA The same as the GLU_TESS_END callback except that it takes an additional pointer argument. This pointer is identical to the opaque pointer provided when gluTessBeginPolygon was called. The function prototype for this callback looks like: void endData ( void *polygon_data); GLU_TESS_COMBINE The combine callback is called to create a new vertex when the tessellation detects an intersection, or wishes to merge features. The function takes four arguments: an array of three elements each of type GLdouble, an array of four pointers, an array of four elements each of type GLfloat, and a pointer to a pointer. The prototype looks like: void combine( GLdouble coords[3], void *vertex_data[4], GLfloat weight[4], void **outData ); The vertex is defined as a linear combination of up to 4 existing vertices, stored in vertex_data. The coefficients of the linear combination are given by weight; these weights always sum to 1.0. All vertex pointers are valid even when some of the weights are zero. coords gives the location of the new vertex. The user must allocate another vertex, interpolate parameters using vertex_data and weight, and return the new vertex pointer in outData. This handle is supplied during rendering callbacks. The user is responsible for freeing the memory sometime after gluTessEndPolygon is called. For example, if the polygon lies in an arbitrary plane in 3-space, and we associate a color with each vertex, the GLU_TESS_COMBINE callback might look like this: void myCombine( GLdouble coords[3], VERTEX *d[4], GLfloat w[4], VERTEX **dataOut ) { VERTEX *new = new_vertex(); new->x = coords[0]; new->y = coords[1]; new->z = coords[2]; new->r = w[0]*d[0]->r + w[1]*d[1]->r + w[2]*d[2]->r + w[3]*d[3]->r; new->g = w[0]*d[0]->g + w[1]*d[1]->g + w[2]*d[2]->g + w[3]*d[3]->g; new->b = w[0]*d[0]->b + w[1]*d[1]->b + w[2]*d[2]->b + w[3]*d[3]->b; new->a = w[0]*d[0]->a + w[1]*d[1]->a + w[2]*d[2]->a + w[3]*d[3]->a; *dataOut = new; } If the tessellation detects an intersection, then the GLU_TESS_COMBINE or GLU_TESS_COMBINE_DATA callback (see below) must be defined, and it must write a non-NULL pointer into dataOut. Otherwise the GLU_TESS_NEED_COMBINE_CALLBACK error occurs, and no output is generated. (This is the only error that can occur during tessellation and rendering.) GLU_TESS_COMBINE_DATA The same as the GLU_TESS_COMBINE callback except that it takes an additional pointer argument. This pointer is identical to the opaque pointer provided when gluTessBeginPolygon was called. The function prototype for this callback looks like: void combineData ( GLdouble coords[3], void *vertex_data[4], GLfloat weight[4], void **outData, void *polygon_data ); GLU_TESS_ERROR The error callback is called when an error is encountered. The one argument is of type GLenum; it indicates the specific error that occurred and will be set to one of GLU_TESS_MISSING_BEGIN_POLYGON, GLU_TESS_MISSING_END_POLYGON, GLU_TESS_MISSING_BEGIN_CONTOUR, GLU_TESS_MISSING_END_CONTOUR, GLU_TESS_COORD_TOO_LARGE, GLU_TESS_NEED_COMBINE_CALLBACK. Character strings describing these errors can be retrieved with the gluErrorString call. The function prototype for this callback looks like: void error ( GLenum errno ); The GLU library will recover from the first four errors by inserting the missing call(s). GLU_TESS_COORD_TOO_LARGE says that some vertex coordinate exceeded the predefined constant GLU_TESS_MAX_COORD in absolute value, and that the value has been clamped. (Coordinate values must be small enough so that two can be multiplied together without overflow.) GLU_TESS_NEED_COMBINE_CALLBACK says that the tessellation detected an intersection between two edges in the input data, and the GLU_TESS_COMBINE or GLU_TESS_COMBINE_DATA callback was not provided. No output will be generated. GLU_TESS_ERROR_DATA The same as the GLU_TESS_ERROR callback except that it takes an additional pointer argument. This pointer is identical to the opaque pointer provided when gluTessBeginPolygon was called. The function prototype for this callback looks like: void errorData ( GLenum errno, void *polygon_data ); Example Polygons tessellated can be rendered directly like this: gluTessCallback(tobj, GLU_TESS_BEGIN, glBegin); gluTessCallback(tobj, GLU_TESS_VERTEX, glVertex3dv); gluTessCallback(tobj, GLU_TESS_END, glEnd); gluTessCallback(tobj, GLU_TESS_COMBINE, myCombine); gluTessBeginPolygon(tobj, NULL); gluTessBeginContour(tobj); gluTessVertex(tobj, v, v); ... gluTessEndContour(tobj); gluTessEndPolygon(tobj); Typically, the tessellated polygon should be stored in a display list so that it does not need to be retessellated every time it is rendered. See Also glBegin, glEdgeFlag, glVertex, gluNewTess, gluErrorString, gluTessVertex, gluTessBeginPolygon, gluTessBeginContour, gluTessProperty, gluTessNormal ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.179. gluTessCallback ═══ OpenGL man pages gluTessCallback (GLU versions 1.0 and 1.1) Name gluTessCallback - define a callback for a tessellation object C Specification void gluTessCallback( GLUtriangulatorObj *tobj, GLenum which, void (*fn)( ) Parameters tobj Specifies the tessellation object (created with gluNewTess). which Specifies the callback being defined. The following values are valid: GLU_BEGIN, GLU_EDGE_FLAG, GLU_VERTEX, GLU_END, and GLU_ERROR. fn Specifies the function to be called. Description gluTessCallback is used to indicate a callback to be used by a tessellation object. If the specified callback is already defined, then it is replaced. If fn is NULL, then the existing callback is erased. These callbacks are used by the tessellation object to describe how a polygon specified by the user is broken into triangles. The legal callbacks are as follows: GLU_BEGIN The begin callback is invoked like glBegin to indicate the start of a (triangle) primitive. The function takes a single argument of type GLenum that is either GL_TRIANGLE_FAN, GL_TRIANGLE_STRIP, or GL_TRIANGLES. GLU_EDGE_FLAG The edge flag callback is similar to glEdgeFlag. The function takes a single Boolean flag that indicates which edges of the created triangles were part of the original polygon defined by the user, and which were created by the tessellation process. If the flag is GL_TRUE, then each vertex that follows begins an edge that was part of the original polygon. If the flag is GL_FALSE, then each vertex that follows begins an edge that was generated by the tessellator. The edge flag callback (if defined) is invoked before the first vertex callback is made. Since triangle fans and triangle strips do not support edge flags, the begin callback is not called with GL_TRIANGLE_FAN or GL_TRIANGLE_STRIP if an edge flag callback is provided. Instead, the fans and strips are converted to independent triangles. GLU_VERTEX The vertex callback is invoked between the begin and end callbacks. It is similar to glVertex, and it defines the vertices of the triangles created by the tessellation process. The function takes a pointer as its only argument. This pointer is identical to the opaque pointer provided by the user when the vertex was described (see gluTessVertex). GLU_END The end callback serves the same purpose as glEnd. It indicates the end of a primitive and it takes no arguments. GLU_ERROR The error callback is called when an error is encountered. The one argument is of type GLenum, and it indicates the specific error that occurred. There are eight errors unique to polygon tessellation, named GLU_TESS_ERROR1 through GLU_TESS_ERROR8. Character strings describing these errors can be retrieved with the gluErrorString call. Example Polygons tessellated can be rendered directly like this: gluTessCallback(tobj, GLU_BEGIN, glBegin); gluTessCallback(tobj, GLU_VERTEX, glVertex3dv); gluTessCallback(tobj, GLU_END, glEnd); gluBeginPolygon(tobj); gluTessVertex(tobj, v, v); ... gluEndPolygon(tobj); Typically, the tessellated polygon should be stored in a display list so that it does not need to be retessellated every time it is rendered. See Also glBegin, glEdgeFlag, glVertex, gluDeleteTess, gluErrorString, gluNewTess, gluTessVertex ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.180. gluTessEndPolygon ═══ OpenGL man pages gluTessEndPolygon (GLU version 1.2 and later) Name gluTessEndPolygon - delimit a polygon description C Specification void gluTessEndPolygon( GLUtesselator *tess ) Parameters tess Specifies the tessellation object (created with gluNewTess). Description gluTessBeginPolygon and gluTessEndPolygon delimit the definition of a nonconvex polygon. Within each gluTessBeginPolygon/gluTessEndPolygon pair, there must be one or more calls to gluTessBeginContour/gluTessEndContour. Within each contour, there are zero or more calls to gluTessVertex. The vertices specify a closed contour (the last vertex of each contour is automatically linked to the first). See the gluTessVertex, gluTessBeginContour and gluTessEndContour reference pages for more details. Once gluTessEndPolygon is called, the polygon is tessellated, and the resulting triangles are described through callbacks. See gluTessCallback for descriptions of the callback functions. Example A quadrilateral with a triangular hole in it can be described like this: gluTessBeginPolygon(tobj, NULL); gluTessBeginContour(tobj); gluTessVertex(tobj, v1, v1); gluTessVertex(tobj, v2, v2); gluTessVertex(tobj, v3, v3); gluTessVertex(tobj, v4, v4); gluTessEndContour(tobj); gluTessBeginContour(tobj); gluTessVertex(tobj, v5, v5); gluTessVertex(tobj, v6, v6); gluTessVertex(tobj, v7, v7); gluTessEndContour(tobj); gluTessEndPolygon(tobj); See Also gluNewTess, gluTessBeginContour, gluTessVertex, gluTessCallback, gluTessProperty, gluTessNormal, gluTessBeginPolygon ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.181. gluTessNormal ═══ OpenGL man pages gluTessNormal (GLU version 1.2 and later) Name gluTessNormal - specify a normal for a polygon C Specification void gluTessNormal( GLUtesselator *tess, GLdouble x, GLdouble y, GLdouble z ) Parameters tess Specifies the tessellation object (created with gluNewTess). x Specifies the first component of the normal. y Specifies the second component of the normal. z Specifies the third component of the normal. Description gluTessNormal describes a normal for a polygon that the user is defining. All input data will be projected onto a plane perpendicular to one of the three coordinate axes before tessellation and all output triangles will be oriented CCW with respect to the normal (CW orientation can be obtained by reversing the sign of the supplied normal). For example, if you know that all polygons lie in the x-y plane, call gluTessNormal(tess, 0.0, 0.0, 1.0) before rendering any polygons. If the supplied normal is (0,0,0) (the default value), the normal is determined as follows. The direction of the normal, up to its sign, is found by fitting a plane to the vertices, without regard to how the vertices are connected. It is expected that the input data lies approximately in the plane; otherwise projection perpendicular to one of the three coordinate axes may substantially change the geometry. The sign of the normal is chosen so that the sum of the signed areas of all input contours is non-negative (where a CCW contour has positive area). The supplied normal persists until it is changed by another call to gluTessNormal. See Also gluTessBeginPolygon, gluTessEndPolygon ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.182. gluTessProperty ═══ OpenGL man pages gluTessProperty (GLU version 1.2 and later) Name gluTessProperty - set a tessellation object property C Specification void gluTessProperty( GLUtesselator *tess, GLenum which, GLdouble value ) Parameters tess Specifies the tessellation object (created with gluNewTess). which Specifies the property to be set. Valid values are GLU_TESS_WINDING_RULE, GLU_TESS_BOUNDARY_ONLY, GLU_TESS_TOLERANCE. value Specifies the value of the indicated property. Description gluTessProperty is used to control properties stored in a tessellation object. These properties affect the way that the polygons are interpreted and rendered. The legal values for which are as follows: GLU_TESS_WINDING_RULE determines which parts of the polygon are on the "interior". value may be set to one of GLU_TESS_WINDING_ODD, GLU_TESS_WINDING_NONZERO, GLU_TESS_WINDING_POSITIVE, or GLU_TESS_WINDING_NEGATIVE, or GLU_TESS_WINDING_ABS_GEQ_TWO. To understand how the winding rule works first consider that the input contours partition the plane into regions. The winding rule determines which of these regions are inside the polygon. For a single contour C, the winding number of a point x is simply the signed number of revolutions we make around x as we travel once around C (where CCW is positive). When there are several contours, the individual winding numbers are summed. This procedure associates a signed integer value with each point x in the plane. Note that the winding number is the same for all points in a single region. The winding rule classifies a region as "inside" if its winding number belongs to the chosen category (odd, nonzero, positive, negative, or absolute value of at least two). The previous GLU tessellator (prior to GLU 1.2) used the "odd" rule. The "nonzero" rule is another common way to define the interior. The other three rules are useful for polygon CSG operations. GLU_TESS_BOUNDARY_ONLY is a boolean value ("value" should be set to GL_TRUE or GL_FALSE). When set to GL_TRUE, a set of closed contours separating the polygon interior and exterior are returned instead of a tessellation. Exterior contours are oriented CCW with respect to the normal, interior contours are oriented CW. The GLU_TESS_BEGIN and GLU_TESS_BEGIN_DATA callbacks use the type GL_LINE_LOOP for each contour. GLU_TESS_TOLERANCE specifies a tolerance for merging features to reduce the size of the output. For example, two vertices which are very close to each other might be replaced by a single vertex. The tolerance is multiplied by the largest coordinate magnitude of any input vertex; this specifies the maximum distance that any feature can move as the result of a single merge operation. If a single feature takes part in several merge operations, the total distance moved could be larger. Feature merging is completely optional; the tolerance is only a hint. The implementation is free to merge in some cases and not in others, or to never merge features at all. The default tolerance is zero. The current implementation merges vertices only if they are exactly coincident, regardless of the current tolerance. A vertex is spliced into an edge only if the implementation is unable to distinguish which side of the edge the vertex lies on. Two edges are merged only when both endpoints are identical. See Also gluGetTessProperty ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.183. gluTessVertex ═══ OpenGL man pages gluTessVertex (GLU version 1.2 and later) Name gluTessVertex - specify a vertex on a polygon C Specification void gluTessVertex( GLUtesselator *tess, GLdouble coords[3], void *data ) Parameters tess Specifies the tessellation object (created with gluNewTess). coords Specifies the location of the vertex. data Specifies an opaque pointer passed back to the user with the vertex callback (as specified by gluTessCallback). Description gluTessVertex describes a vertex on a polygon that the user is defining. Successive gluTessVertex calls describe a closed contour. For example, if the user wants to describe a quadrilateral, then gluTessVertex should be called four times. gluTessVertex can only be called between gluTessBeginContour and gluTessEndContour. data normally points to a structure containing the vertex location, as well as other per-vertex attributes such as color and normal. This pointer is passed back to the user through the GLU_TESS_VERTEX or GLU_TESS_VERTEX_DATA callback after tessellation (see the gluTessCallback reference page). Example A quadrilateral with a triangular hole in it can be described as follows: gluTessBeginPolygon(tobj, NULL); gluTessBeginContour(tobj); gluTessVertex(tobj, v1, v1); gluTessVertex(tobj, v2, v2); gluTessVertex(tobj, v3, v3); gluTessVertex(tobj, v4, v4); gluTessEndContour(tobj); gluTessBeginContour(tobj); gluTessVertex(tobj, v5, v5); gluTessVertex(tobj, v6, v6); gluTessVertex(tobj, v7, v7); gluTessEndContour(tobj); gluTessEndPolygon(tobj); See Also gluTessBeginPolygon, gluNewTess, gluTessBeginContour, gluTessCallback, gluTessProperty, gluTessNormal, gluTessEndPolygon ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 3.184. gluTessVertex ═══ OpenGL man pages gluTessVertex (GLU versions 1.0 and 1.1) Name gluTessVertex - specify a vertex on a polygon C Specification void gluTessVertex( GLUtriangulatorObj *tobj, GLdouble v[3], void *data ) Parameters tobj Specifies the tessellation object (created with gluNewTess). v Specifies the location of the vertex. data Specifies an opaque pointer passed back to the user with the vertex callback (as specified by gluTessCallback). Description gluTessVertex describes a vertex on a polygon that the user is defining. Successive gluTessVertex calls describe a closed contour. For example, if the user wants to describe a quadrilateral, then gluTessVertex should be called four times. gluTessVertex can only be called between gluBeginPolygon and gluEndPolygon. data normally points to a structure containing the vertex location, as well as other per-vertex attributes such as color and normal. This pointer is passed back to the user through the GLU_VERTEX callback after tessellation (see the gluTessCallback reference page). Example A quadrilateral with a triangular hole in it can be described as follows: gluBeginPolygon(tobj); gluTessVertex(tobj, v1, v1); gluTessVertex(tobj, v2, v2); gluTessVertex(tobj, v3, v3); gluTessVertex(tobj, v4, v4); gluNextContour(tobj, GLU_INTERIOR); gluTessVertex(tobj, v5, v5); gluTessVertex(tobj, v6, v6); gluTessVertex(tobj, v7, v7); gluEndPolygon(tobj); See Also gluBeginPolygon, gluNewTess, gluNextContour, gluTessCallback ═══ 3.185. gluUnProject ═══ OpenGL man pages gluUnProject Name gluUnProject - map window coordinates to object coordinates C Specification int gluUnProject( GLdouble winx, GLdouble winy, GLdouble winz, const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *objx, GLdouble *objy, GLdouble *objz ) Parameters winx, winy, winz Specify the window coordinates to be mapped. modelMatrix Specifies the modelview matrix (as from a glGetDoublev call). projMatrix Specifies the projection matrix (as from a glGetDoublev call). viewport Specifies the viewport (as from a glGetIntegerv call). objx, objy, objz Returns the computed object coordinates. Description gluUnProject maps the specified window coordinates into object coordinates using modelMatrix, projMatrix, and viewport. The result is stored in objx, objy, and objz. A return value of GL_TRUE indicates success, and GL_FALSE indicates failure. See Also glGet, gluProject ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 4. OpenGL Index of routines in Specification Order ═══ OpenGL man pages Table of Contents Chapter 1. Fundamentals Chapter 2. Rasterization Chapter 3. Per-Fragment Operations and the Framebuffer Chapter 4. Special Functions Chapter 5. State and State Requests OpenGL on the X Window System(tm) The OpenGL Utility Library The Vertex Array Extension ──────────────────────────────────────────────────────────────────────────────── Chapter 1. Fundamentals glGetError glGetError glBegin glBegin, glEnd glVertex glVertex2d, glVertex2dv, glVertex2f, glVertex2fv, glVertex2i, glVertex2iv, glVertex2s, glVertex2sv, glVertex3d, glVertex3dv, glVertex3f, glVertex3fv, glVertex3i, glVertex3iv, glVertex3s, glVertex3sv, glVertex4d, glVertex4dv, glVertex4f, glVertex4fv, glVertex4i, glVertex4iv, glVertex4s, glVertex4sv glNormal glNormal3b, glNormal3bv, glNormal3d, glNormal3dv, glNormal3f, glNormal3fv, glNormal3i, glNormal3iv, glNormal3s, glNormal3sv glColor glColor3b, glColor3bv, glColor3d, glColor3dv, glColor3f, glColor3fv, glColor3i, glColor3iv, glColor3s, glColor3sv, glColor3ub, glColor3ubv, glColor3ui, glColor3uiv, glColor3us, glColor3usv, glColor4b, glColor4bv, glColor4d, glColor4dv, glColor4f, glColor4fv, glColor4i, glColor4iv, glColor4s, glColor4sv, glColor4ub, glColor4ubv, glColor4ui, glColor4uiv, glColor4us, glColor4usv glIndex glIndexd, glIndexdv, glIndexf, glIndexfv, glIndexi, glIndexiv, glIndexs, glIndexsv glTexCoord glTexCoord1d, glTexCoord1dv, glTexCoord1f, glTexCoord1fv, glTexCoord1i, glTexCoord1iv, glTexCoord1s, glTexCoord1sv, glTexCoord2d, glTexCoord2dv, glTexCoord2f, glTexCoord2fv, glTexCoord2i, glTexCoord2iv, glTexCoord2s, glTexCoord2sv, glTexCoord3d, glTexCoord3dv, glTexCoord3f, glTexCoord3fv, glTexCoord3i, glTexCoord3iv, glTexCoord3s, glTexCoord3sv, glTexCoord4d, glTexCoord4dv, glTexCoord4f, glTexCoord4fv, glTexCoord4i, glTexCoord4iv, glTexCoord4s, glTexCoord4sv glEdgeFlag glEdgeFlag, glEdgeFlagv glRect glRectd, glRectdv, glRectf, glRectfv, glRecti, glRectiv, glRects, glRectsv glViewport glViewport glDepthRange glDepthRange glMatrixMode glMatrixMode glLoadMatrix glLoadMatrixd, glLoadMatrixf glMultMatrix glMultMatrixd, glMultMatrixf glLoadIdentity glLoadIdentity glRotate glRotated, glRotatef glTranslate glTranslated, glTranslatef glScale glScaled, glScalef glFrustum glFrustum glOrtho glOrtho glPushMatrix glPushMatrix, glPopMatrix glEnable glEnable, glDisable glTexGen glTexGend, glTexGendv, glTexGenf, glTexGenfv, glTexGeni, glTexGeniv glClipPlane glClipPlane glRasterPos glRasterPos2d, glRasterPos2dv, glRasterPos2f, glRasterPos2fv, glRasterPos2i, glRasterPos2iv, glRasterPos2s, glRasterPos2sv, glRasterPos3d, glRasterPos3dv, glRasterPos3f, glRasterPos3fv, glRasterPos3i, glRasterPos3iv, glRasterPos3s, glRasterPos3sv, glRasterPos4d, glRasterPos4dv, glRasterPos4f, glRasterPos4fv, glRasterPos4i, glRasterPos4iv, glRasterPos4s, glRasterPos4sv glFrontFace glFrontFace glMaterial glMaterialf, glMaterialfv, glMateriali, glMaterialiv glLight glLightf, glLightfv, glLighti, glLightiv glLightModel glLightModelf, glLightModelfv, glLightModeli, glLightModeliv glColorMaterial glColorMaterial glShadeModel glShadeModel ──────────────────────────────────────────────────────────────────────────────── Chapter 2. Rasterization glPointSize glPointSize glLineWidth glLineWidth glLineStipple glLineStipple glCullFace glCullFace glPolygonStipple glPolygonStipple glPolygonMode glPolygonMode glPixelStore glPixelStoref, glPixelStorei glPixelTransfer glPixelTransferf, glPixelTransferi glPixelMap glPixelMapfv, glPixelMapuiv, glPixelMapusv glDrawPixels glDrawPixels glPixelZoom glPixelZoom glBitmap glBitmap glTexImage2D glTexImage2D glTexImage1D glTexImage1D glTexParameter glTexParameterf, glTexParameterfv, glTexParameteri, glTexParameteriv glTexEnv glTexEnvf, glTexEnvfv, glTexEnvi, glTexEnviv glFog glFogf, glFogfv, glFogi, glFogiv ──────────────────────────────────────────────────────────────────────────────── Chapter 3. Per-Fragment Operations and the Framebuffer glScissor glScissor glAlphaFunc glAlphaFunc glStencilFunc glStencilFunc glStencilOp glStencilOp glDepthFunc glDepthFunc glBlendFunc glBlendFunc glLogicOp glLogicOp glDrawBuffer glDrawBuffer glIndexMask glIndexMask glColorMask glColorMask glDepthMask glDepthMask glStencilMask glStencilMask glClear glClear glClearColor glClearColor glClearIndex glClearIndex glClearDepth glClearDepth glClearStencil glClearStencil glClearAccum glClearAccum glAccum glAccum glReadPixels glReadPixels glReadBuffer glReadBuffer glCopyPixels glCopyPixels ──────────────────────────────────────────────────────────────────────────────── Chapter 4. Special Functions glMap1 glMap1d, glMap1f glMap2 glMap2d, glMap2f glEvalCoord glEvalCoord1d, glEvalCoord1dv, glEvalCoord1f, glEvalCoord1fv, glEvalCoord2d, glEvalCoord2dv, glEvalCoord2f, glEvalCoord2fv glMapGrid glMapGrid1d, glMapGrid1f, glMapGrid2d, glMapGrid2f glEvalMesh glEvalMesh1, glEvalMesh2 glEvalPoint glEvalPoint1, glEvalPoint2 glInitNames glInitNames glPushName glPushName, glPopName glLoadName glLoadName glRenderMode glRenderMode glSelectBuffer glSelectBuffer glFeedbackBuffer glFeedbackBuffer glPassThrough glPassThrough glNewList glNewList, glEndList glCallList glCallList glCallLists glCallLists glListBase glListBase glGenLists glGenLists glIsList glIsList glDeleteLists glDeleteLists glFlush glFlush glFinish glFinish glHint glHint ──────────────────────────────────────────────────────────────────────────────── Chapter 5. State and State Requests glGet glGetBooleanv, glGetDoublev, glGetFloatv, glGetIntegerv glIsEnabled glIsEnabled glGetClipPlane glGetClipPlane glGetLight glGetLightfv, glGetLightiv glGetMaterial glGetMaterialfv, glGetMaterialiv glGetTexEnv glGetTexEnvfv, glGetTexEnviv glGetTexGen glGetTexGendv, glGetTexGenfv, glGetTexGeniv glGetTexParameter glGetTexParameterfv, glGetTexParameteriv glGetTexLevelParameter glGetTexLevelParameterfv, glGetTexLevelParameteriv glGetPixelMap glGetPixelMapfv, glGetPixelMapuiv, glGetPixelMapusv glGetMap glGetMapdv, glGetMapfv, glGetMapiv glGetTexImage glGetTexImage glGetPolygonStipple glGetPolygonStipple glGetString glGetString glPushAttrib glPushAttrib, glPopAttrib ──────────────────────────────────────────────────────────────────────────────── OpenGL on the X Window System(tm) glXIntro Introduction glXQueryExtension glXQueryExtension glXQueryVersion glXQueryVersion glXGetConfig glXGetConfig glXChooseVisual glXChooseVisual glXCreateGLXPixmap glXCreateGLXPixmap glXDestroyGLXPixmap glXDestroyGLXPixmap glXCreateContext glXCreateContext glXIsDirect glXIsDirect glXDestroyContext glXDestroyContext glXCopyContext glXCopyContext glXMakeCurrent glXMakeCurrent glXGetCurrentContext glXGetCurrentContext glXGetCurrentDrawable glXGetCurrentDrawable glXWaitGL glXWaitGL glXWaitX glXWaitX glXSwapBuffers glXSwapBuffers glXUseXFont glXUseXFont ──────────────────────────────────────────────────────────────────────────────── The OpenGL Utility Library See notes on the new GLU tesselator gluScaleImage gluScaleImage gluBuild1DMipmaps gluBuild1DMipmaps gluBuild2DMipmaps gluBuild2DMipmaps gluOrtho2D gluOrtho2D gluPerspective gluPerspective gluLookAt gluLookAt gluPickMatrix gluPickMatrix gluProject gluProject gluUnProject gluUnProject gluNewQuadric gluNewQuadric gluDeleteQuadric gluDeleteQuadric gluQuadricCallback gluQuadricCallback gluQuadricNormals gluQuadricNormals gluQuadricTexture gluQuadricTexture gluQuadricOrientation gluQuadricOrientation gluQuadricDrawStyle gluQuadricDrawStyle gluSphere gluSphere gluCylinder gluCylinder gluDisk gluDisk gluPartialDisk gluPartialDisk gluNewNurbsRenderer gluNewNurbsRenderer gluDeleteNurbsRenderer gluDeleteNurbsRenderer gluNurbsCallback gluNurbsCallback gluBeginCurve gluBeginCurve, gluEndCurve gluNurbsCurve gluNurbsCurve gluBeginSurface gluBeginSurface, gluEndSurface gluNurbsSurface gluNurbsSurface gluBeginTrim gluBeginTrim, gluEndTrim gluPwlCurve gluPwlCurve gluNurbsProperty gluNurbsProperty gluLoadSamplingMatrices gluLoadSamplingMatrices gluGetNurbsProperty gluGetNurbsProperty gluErrorString gluErrorString The GLU tesselator for GLU versions 1.0 and 1.1: gluNewTess gluNewTess gluDeleteTess gluDeleteTess gluTessCallback gluTessCallback gluBeginPolygon gluBeginPolygon, gluEndPolygon gluTessVertex gluTessVertex gluNextContour gluNextContour The GLU tesselator for GLU version 1.2 and later: gluNewTess gluNewTess gluDeleteTess gluDeleteTess gluTessCallback gluTessCallback gluTessBeginPolygon gluTessBeginPolygon gluTessEndPolygon gluTessEndPolygon gluTessVertex gluTessVertex gluTessBeginContour gluBeginContour, gluEndContour gluTessProperty gluTessProperty gluGetTessProperty gluGetTessProperty gluTessNormal gluTessNormal gluBeginPolygon gluBeginPolygon, gluEndPolygon (Obsolete) gluNextContour gluNextContour (Obsolete) ──────────────────────────────────────────────────────────────────────────────── The Vertex Array Extension glArrayElementEXT glArrayElementEXT glColorPointerEXT glColorPointerEXT glDrawArraysEXT glDrawArraysEXT glEdgeFlagPointerEXT glEdgeFlagPointerEXT glGetPointervEXT glGetPointervEXT glIndexPointerEXT glIndexPointerEXT glNormalPointerEXT glNormalPointerEXT glTexCoordPointerEXT glTexCoordPointerEXT glVertexPointerEXT glVertexPointerEXT ═══ 5. GLU Version 1.2 Polygon Tessellator Notes ═══ OpenGL man pages Some notes on the new polygon tessellator in GLU version 1.2 GLU version 1.2 introduces a new polygon tessellator. The following routines have become obsolete and should not be used for new development based on GLU version 1.2 and later. Obsolete Routine Replace with gluBeginPolygon gluTessBeginPolygon; gluTessBeginContour gluEndPolygon gluTessEndContour; gluTessEndPolygon gluNextContour gluTessEndContour; gluTessBeginContour The following routines are new in GLU version 1.2: gluGetTessProperty gluTessBeginContour gluTessBeginPolygon gluTessEndContour gluTessEndPolygon gluTessNormal gluTessProperty Some routines have had an argument or return-value changed from ``GLUtriangulatorObj *'' to ``GLUtesselator *''. Since the GLU header file for version 1.2 has a typedef from GLUtriangulatorObj to GLUtesselator, source code should not need any immediate changes. However, at some time the source code should be moved to the GLU version 1.2 name. gluBeginPolygon gluDeleteTess gluEndPolygon gluNewTess gluNextContour gluTessCallback gluTessVertex One routine has been expanded to support more valid values for the which argument: gluTessCallback To distinguish what version of the GLU library you are using at compile time, check for the following pre-processor symbols: none defined version 1.0 GLU_VERSION_1_1 version 1.1 or later GLU_VERSION_1_2 version 1.2 or later Digital Open3D supports the following versions of the GLU library: Digital Open3D Version GLU Version Supported Before Version 2.6 version 1.0 Version 2.6 version 1.1 Version 3.0 and later version 1.2 ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 6. OpenGL on X-Windows ═══ OpenGL man pages glXIntro Name glXIntro - Introduction to OpenGL in the X window system OVERVIEW OpenGL is a high-performance 3-D-oriented renderer. It is available in the X window system through the GLX extension. Use glXQueryExtension and glXQueryVersion to establish whether the GLX extension is supported by an X server, and if so, what version is supported. GLX extended servers make a subset of their visuals available for OpenGL rendering. Drawables created with these visuals can also be rendered using the core X renderer and with the renderer of any other X extension that is compatible with all core X visuals. GLX extends drawables with several buffers other than the standard color buffer. These buffers include back and auxiliary color buffers, a depth buffer, a stencil buffer, and a color accumulation buffer. Some or all are included in each X visual that supports OpenGL. To render using OpenGL into an X drawable, you must first choose a visual that defines the required OpenGL buffers. glXChooseVisual can be used to simplify selecting a compatible visual. If more control of the selection process is required, use XGetVisualInfo and glXGetConfig to select among all the available visuals. Use the selected visual to create both a GLX context and an X drawable. GLX contexts are created with glXCreateContext, and drawables are created with either XCreateWindow or glXCreateGLXPixmap. Finally, bind the context and the drawable together using glXMakeCurrent. This context/drawable pair becomes the current context and current drawable, and it is used by all OpenGL commands until glXMakeCurrent is called with different arguments. Both core X and OpenGL commands can be used to operate on the current drawable. The X and OpenGL command streams are not synchronized, however, except at explicitly created boundaries generated by calling glXWaitGL, glXWaitX, XSync, and glFlush. Examples Below is the minimum code required to create an RGBA-format, OpenGL- compatible X window and clear it to yellow. The code is correct, but it does not include any error checking. Return values dpy, vi, cx, cmap, and win should all be tested. #include #include #include static int attributeList[] = { GLX_RGBA, None }; static Bool WaitForNotify(Display *d, XEvent *e, char *arg) { return (e->type == MapNotify) && (e->xmap.window == (Window)arg); } int main(int argc, char **argv) { Display *dpy; XVisualInfo *vi; Colormap cmap; XSetWindowAttributes swa; Window win; GLXContext cx; XEvent event; /* get a connection */ dpy = XOpenDisplay(0); /* get an appropriate visual */ vi = glXChooseVisual(dpy, DefaultScreen(dpy), attributeList); /* create a GLX context */ cx = glXCreateContext(dpy, vi, 0, GL_TRUE); /* create a color map */ cmap = XCreateColormap(dpy, RootWindow(dpy, vi->screen), vi->visual, AllocNone); /* create a window */ swa.colormap = cmap; swa.border_pixel = 0; swa.event_mask = StructureNotifyMask; win = XCreateWindow(dpy, RootWindow(dpy, vi->screen), 0, 0, 100, 100, 0, vi->depth, InputOutput, vi->visual, CWBorderPixel|CWColormap|CWEventMask, &swa); XMapWindow(dpy, win); XIfEvent(dpy, &event, WaitForNotify, (char*)win); /* connect the context to the window */ glXMakeCurrent(dpy, win, cx); /* clear the buffer */ glClearColor(1,1,0,1); glClear(GL_COLOR_BUFFER_BIT); glFlush(); /* wait a while */ sleep(10); } Notes A color map must be created and passed to XCreateWindow. See the example code above. A GLX context must be created and attached to an X drawable before OpenGL commands can be executed. OpenGL commands issued while no context/drawable pair is current are ignored. Exposure events indicate that all buffers associated with the specified window may be damaged and should be repainted. Although certain buffers of some visuals on some systems may never require repainting (the depth buffer, for example), it is incorrect to code assuming that these buffers will not be damaged. GLX commands manipulate XVisualInfo structures rather than pointers to visuals or visual IDs. XVisualInfo structures contain visual, visualID, screen, and depth elements, as well as other X-specific information. See Also glFinish, glFlush, glXChooseVisual, glXCopyContext, glXCreateContext, glXCreateGLXPixmap, glXDestroyContext, glXGetConfig, glXIsDirect, glXMakeCurrent, glXQueryExtension, glXQueryVersion, glXSwapBuffers, glXUseXFont, glXWaitGL, glXWaitX, XCreateColormap, XCreateWindow, XSync ──────────────────────────────────────────────────────────────────────────────── Introduction | Alphabetic | Specification Last Edited: Fri Dec 6 11:18:03 EST 1996 by AFV Look here for legal stuff: Legal ═══ 7. External links ═══ This chapter contains all URLs referenced in this book. Each page from this chapter contain a link which will launch IBM Web Explorer on a specific URL. ═══ 7.1. http://www.digital.com/ ═══ The link you selected points to Digital Corp. WWW site. Click the URL below to launch IBM Web Explorer http://www.digital.com/ ═══ 7.2. http://www.digital.com/info/tm.html ═══ The link you selected points to Digital Corp. WWW site, legal info page. Click the URL below to launch IBM Web Explorer http://www.digital.com/info/tm.html ═══ 7.3. http://www.sgi.com/Technology/openGL/ ═══ This link points to OpenGL homepage on the Silicon Graphics web site. Click the URL below to launch IBM Web Explorer http://www.sgi.com/Technology/openGL/ ═══ 7.4. http://www.sgi.com/Technology/openGL/glspec1.1/glspec.html ═══ This link points to the header page of OpenGL 1.1 specification located in the Silicon Graphics web site. Click the URL below to launch IBM Web Explorer http://www.sgi.com/Technology/openGL/glspec1.1/glspec.html ═══ 7.5. mailto:andy.vesper@eng.pko.dec.com ═══ This page contains the Andy Vesper`s e-mail address Click the URL below to launch IBM Web Explorer mailto:andy.vesper@eng.pko.dec.com mailto:andy.vesper@pko.mts.dec.com