reorganize file structures; allow for module-specific types
[clinton/guile-figl.git] / figl / gl / low-level.scm
CommitLineData
8925f36f
AW
1;;; figl -*- mode: scheme; coding: utf-8 -*-
2;;; Copyright (C) 2013 Andy Wingo <wingo@pobox.com>
3;;;
4;;; Figl is free software: you can redistribute it and/or modify it
5;;; under the terms of the GNU Lesser General Public License as
6;;; published by the Free Software Foundation, either version 3 of the
7;;; License, or (at your option) any later version.
8;;;
9;;; Figl is distributed in the hope that it will be useful, but WITHOUT
10;;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11;;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
12;;; Public License for more details.
13;;;
14;;; You should have received a copy of the GNU Lesser General Public
15;;; License along with this program. If not, see
16;;; <http://www.gnu.org/licenses/>.
17;;;
18;;; Derived from upstream OpenGL documentation.
19;;;
8925f36f
AW
20;;; Copyright (C) 1991-2006 Silicon Graphics, Inc. This document is licensed
21;;; under the SGI Free Software B License. For details, see
22;;; http://oss.sgi.com/projects/FreeB/ (http://oss.sgi.com/projects/FreeB/).
23;;;
8925f36f
AW
24;;; Copyright (C) 2003-2005 3Dlabs Inc. Ltd. This material may be
25;;; distributed subject to the terms and conditions set forth in the Open
26;;; Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/
27;;; (http://opencontent.org/openpub/).
28;;;
8925f36f
AW
29;;; Copyright (C) 2005 Addison-Wesley. This material may be distributed
30;;; subject to the terms and conditions set forth in the Open Publication
31;;; License, v 1.0, 8 June 1999. http://opencontent.org/openpub/
32;;; (http://opencontent.org/openpub/).
33;;;
8925f36f
AW
34;;; Copyright (C) 2006 Khronos Group. This material may be distributed
35;;; subject to the terms and conditions set forth in the Open Publication
36;;; License, v 1.0, 8 June 1999. http://opencontent.org/openpub/
37;;; (http://opencontent.org/openpub/).
38;;;
39;;; Automatically generated; you probably don't want to edit this. To
40;;; update, run "make update" in the top-level build tree.
41;;;
42
43(define-module
7ec693ed 44 (figl gl low-level)
8925f36f 45 #:use-module
7ec693ed
AW
46 (figl runtime)
47 #:use-module
48 (figl gl types)
8925f36f
AW
49 #:export
50 (glAccum
51 glActiveTexture
52 glAlphaFunc
53 glAreTexturesResident
54 glArrayElement
55 glAttachShader
56 glBeginQuery
bb894c9d 57 glEndQuery
8925f36f 58 glBegin
bb894c9d 59 glEnd
8925f36f
AW
60 glBindAttribLocation
61 glBindBuffer
62 glBindTexture
63 glBitmap
64 glBlendColor
65 glBlendEquationSeparate
66 glBlendEquation
67 glBlendFuncSeparate
68 glBlendFunc
69 glBufferData
70 glBufferSubData
71 glCallLists
72 glCallList
73 glClearAccum
74 glClearColor
75 glClearDepth
76 glClearIndex
77 glClearStencil
78 glClear
79 glClientActiveTexture
80 glClipPlane
81 glColorMask
82 glColorMaterial
83 glColorPointer
84 glColorSubTable
8925f36f 85 glColorTable
bb894c9d
AW
86 glColor3i
87 glColor3d
88 glColor3ui
89 glColor4i
90 glColor4d
91 glColor4ui
8925f36f
AW
92 glCompileShader
93 glCompressedTexImage1D
94 glCompressedTexImage2D
95 glCompressedTexImage3D
96 glCompressedTexSubImage1D
97 glCompressedTexSubImage2D
98 glCompressedTexSubImage3D
99 glConvolutionFilter1D
100 glConvolutionFilter2D
bb894c9d
AW
101 glConvolutionParameterf
102 glConvolutionParameteri
8925f36f
AW
103 glCopyColorSubTable
104 glCopyColorTable
105 glCopyConvolutionFilter1D
106 glCopyConvolutionFilter2D
107 glCopyPixels
108 glCopyTexImage1D
109 glCopyTexImage2D
110 glCopyTexSubImage1D
111 glCopyTexSubImage2D
112 glCopyTexSubImage3D
113 glCreateProgram
114 glCreateShader
115 glCullFace
116 glDeleteBuffers
117 glDeleteLists
118 glDeleteProgram
119 glDeleteQueries
120 glDeleteShader
121 glDeleteTextures
122 glDepthFunc
123 glDepthMask
124 glDepthRange
125 glDetachShader
126 glDrawArrays
127 glDrawBuffers
128 glDrawBuffer
129 glDrawElements
130 glDrawPixels
131 glDrawRangeElements
132 glEdgeFlagPointer
133 glEdgeFlag
134 glEnableClientState
bb894c9d 135 glDisableClientState
8925f36f 136 glEnableVertexAttribArray
bb894c9d 137 glDisableVertexAttribArray
8925f36f 138 glEnable
bb894c9d
AW
139 glDisable
140 glEvalCoord1d
141 glEvalCoord2d
142 glEvalMesh1
143 glEvalMesh2
144 glEvalPoint1
145 glEvalPoint2
8925f36f
AW
146 glFeedbackBuffer
147 glFinish
148 glFlush
149 glFogCoordPointer
bb894c9d
AW
150 glFogCoordd
151 glFogf
152 glFogi
8925f36f
AW
153 glFrontFace
154 glFrustum
155 glGenBuffers
156 glGenLists
157 glGenQueries
158 glGenTextures
159 glGetActiveAttrib
160 glGetActiveUniform
161 glGetAttachedShaders
162 glGetAttribLocation
8925f36f
AW
163 glGetBufferSubData
164 glGetClipPlane
8925f36f
AW
165 glGetColorTable
166 glGetCompressedTexImage
167 glGetConvolutionFilter
8925f36f 168 glGetError
8925f36f 169 glGetHistogram
8925f36f 170 glGetMinmax
8925f36f
AW
171 glGetPolygonStipple
172 glGetProgramInfoLog
8925f36f
AW
173 glGetSeparableFilter
174 glGetShaderInfoLog
175 glGetShaderSource
8925f36f 176 glGetString
8925f36f 177 glGetTexImage
8925f36f 178 glGetUniformLocation
8925f36f
AW
179 glHint
180 glHistogram
181 glIndexMask
182 glIndexPointer
bb894c9d
AW
183 glIndexi
184 glIndexd
185 glIndexub
8925f36f
AW
186 glInitNames
187 glInterleavedArrays
188 glIsBuffer
189 glIsEnabled
190 glIsList
191 glIsProgram
192 glIsQuery
193 glIsShader
194 glIsTexture
bb894c9d
AW
195 glLightModelf
196 glLightModeli
197 glLightf
198 glLighti
8925f36f
AW
199 glLineStipple
200 glLineWidth
201 glLinkProgram
202 glListBase
203 glLoadIdentity
bb894c9d 204 glLoadMatrixd
8925f36f 205 glLoadName
bb894c9d 206 glLoadTransposeMatrixd
8925f36f 207 glLogicOp
bb894c9d
AW
208 glMap1d
209 glMap2d
8925f36f 210 glMapBuffer
bb894c9d
AW
211 glUnmapBuffer
212 glMapGrid1d
213 glMapGrid2d
214 glMaterialf
215 glMateriali
8925f36f
AW
216 glMatrixMode
217 glMinmax
218 glMultiDrawArrays
219 glMultiDrawElements
bb894c9d
AW
220 glMultiTexCoord1i
221 glMultiTexCoord1d
222 glMultiTexCoord2i
223 glMultiTexCoord2d
224 glMultiTexCoord3i
225 glMultiTexCoord3d
226 glMultiTexCoord4i
227 glMultiTexCoord4d
228 glMultMatrixd
229 glMultTransposeMatrixd
8925f36f 230 glNewList
bb894c9d 231 glEndList
8925f36f 232 glNormalPointer
bb894c9d
AW
233 glNormal3d
234 glNormal3i
8925f36f
AW
235 glOrtho
236 glPassThrough
bb894c9d
AW
237 glPixelStoref
238 glPixelStorei
239 glPixelTransferf
240 glPixelTransferi
8925f36f 241 glPixelZoom
bb894c9d
AW
242 glPointParameterf
243 glPointParameteri
8925f36f
AW
244 glPointSize
245 glPolygonMode
246 glPolygonOffset
247 glPolygonStipple
248 glPrioritizeTextures
249 glPushAttrib
bb894c9d 250 glPopAttrib
8925f36f 251 glPushClientAttrib
bb894c9d 252 glPopClientAttrib
8925f36f 253 glPushMatrix
bb894c9d 254 glPopMatrix
8925f36f 255 glPushName
bb894c9d
AW
256 glPopName
257 glRasterPos2i
258 glRasterPos2d
259 glRasterPos3i
260 glRasterPos3d
261 glRasterPos4i
262 glRasterPos4d
8925f36f
AW
263 glReadBuffer
264 glReadPixels
bb894c9d
AW
265 glRectd
266 glRecti
8925f36f
AW
267 glRenderMode
268 glResetHistogram
269 glResetMinmax
bb894c9d 270 glRotated
8925f36f 271 glSampleCoverage
bb894c9d 272 glScaled
8925f36f
AW
273 glScissor
274 glSecondaryColorPointer
bb894c9d
AW
275 glSecondaryColor3i
276 glSecondaryColor3d
277 glSecondaryColor3ui
8925f36f
AW
278 glSelectBuffer
279 glSeparableFilter2D
280 glShadeModel
281 glShaderSource
282 glStencilFuncSeparate
283 glStencilFunc
284 glStencilMaskSeparate
285 glStencilMask
286 glStencilOpSeparate
287 glStencilOp
288 glTexCoordPointer
bb894c9d
AW
289 glTexCoord1i
290 glTexCoord1d
291 glTexCoord2i
292 glTexCoord2d
293 glTexCoord3i
294 glTexCoord3d
295 glTexCoord4i
296 glTexCoord4d
297 glTexEnvf
298 glTexEnvi
299 glTexGeni
300 glTexGend
8925f36f
AW
301 glTexImage1D
302 glTexImage2D
303 glTexImage3D
bb894c9d
AW
304 glTexParameterf
305 glTexParameteri
8925f36f
AW
306 glTexSubImage1D
307 glTexSubImage2D
308 glTexSubImage3D
bb894c9d 309 glTranslated
8925f36f 310 glUniform1f
bb894c9d
AW
311 glUniform2f
312 glUniform3f
313 glUniform4f
314 glUniform1i
315 glUniform2i
316 glUniform3i
317 glUniform4i
8925f36f
AW
318 glUseProgram
319 glValidateProgram
320 glVertexAttribPointer
bb894c9d
AW
321 glVertexAttrib1s
322 glVertexAttrib1d
323 glVertexAttrib2s
324 glVertexAttrib2d
325 glVertexAttrib3s
326 glVertexAttrib3d
327 glVertexAttrib4s
328 glVertexAttrib4d
329 glVertexAttrib4Nub
8925f36f 330 glVertexPointer
bb894c9d
AW
331 glVertex2i
332 glVertex2d
333 glVertex3i
334 glVertex3d
335 glVertex4i
336 glVertex4d
8925f36f 337 glViewport
bb894c9d
AW
338 glWindowPos2i
339 glWindowPos2d
340 glWindowPos3i
341 glWindowPos3d))
8925f36f 342
7ec693ed 343(define-foreign-procedure
bb894c9d 344 ((glAccum (op GLenum) (value GLfloat) -> void))
3c9b6116
AW
345 "Operate on the accumulation buffer.
346
347OP
348 Specifies the accumulation buffer operation. Symbolic constants
349 `GL_ACCUM', `GL_LOAD', `GL_ADD', `GL_MULT', and `GL_RETURN' are
350 accepted.
351
352VALUE
353 Specifies a floating-point value used in the accumulation buffer
354 operation. OP determines how VALUE is used.
355
356The accumulation buffer is an extended-range color buffer. Images are
357not rendered into it. Rather, images rendered into one of the color
358buffers are added to the contents of the accumulation buffer after
359rendering. Effects such as antialiasing (of points, lines, and
360polygons), motion blur, and depth of field can be created by
361accumulating images generated with different transformation matrices.
362
363Each pixel in the accumulation buffer consists of red, green, blue, and
364alpha values. The number of bits per component in the accumulation
365buffer depends on the implementation. You can examine this number by
366calling `glGetIntegerv' four times, with arguments `GL_ACCUM_RED_BITS',
367`GL_ACCUM_GREEN_BITS', `GL_ACCUM_BLUE_BITS', and `GL_ACCUM_ALPHA_BITS'.
368Regardless of the number of bits per component, the range of values
369stored by each component is [-1,1] . The accumulation buffer pixels are
370mapped one-to-one with frame buffer pixels.
371
372`glAccum' operates on the accumulation buffer. The first argument, OP,
373is a symbolic constant that selects an accumulation buffer operation.
374The second argument, VALUE, is a floating-point value to be used in that
375operation. Five operations are specified: `GL_ACCUM', `GL_LOAD',
376`GL_ADD', `GL_MULT', and `GL_RETURN'.
377
378All accumulation buffer operations are limited to the area of the
379current scissor box and applied identically to the red, green, blue, and
380alpha components of each pixel. If a `glAccum' operation results in a
381value outside the range [-1,1] , the contents of an accumulation buffer
382pixel component are undefined.
383
384The operations are as follows:
385
386`GL_ACCUM'
387 Obtains R, G, B, and A values from the buffer currently selected
388 for reading (see `glReadBuffer'). Each component value is divided
389 by 2^N-1 , where N is the number of bits allocated to each color
390 component in the currently selected buffer. The result is a
391 floating-point value in the range [0,1] , which is multiplied by
392 VALUE and added to the corresponding pixel component in the
393 accumulation buffer, thereby updating the accumulation buffer.
394
395`GL_LOAD'
396 Similar to `GL_ACCUM', except that the current value in the
397 accumulation buffer is not used in the calculation of the new
398 value. That is, the R, G, B, and A values from the currently
399 selected buffer are divided by 2^N-1 , multiplied by VALUE, and
400 then stored in the corresponding accumulation buffer cell,
401 overwriting the current value.
402
403`GL_ADD'
404 Adds VALUE to each R, G, B, and A in the accumulation buffer.
405
406`GL_MULT'
407 Multiplies each R, G, B, and A in the accumulation buffer by VALUE
408 and returns the scaled component to its corresponding accumulation
409 buffer location.
410
411`GL_RETURN'
412 Transfers accumulation buffer values to the color buffer or buffers
413 currently selected for writing. Each R, G, B, and A component is
414 multiplied by VALUE, then multiplied by 2^N-1 , clamped to the
415 range [0,2^N-1] , and stored in the corresponding display buffer
416 cell. The only fragment operations that are applied to this
417 transfer are pixel ownership, scissor, dithering, and color
418 writemasks.
419
420To clear the accumulation buffer, call `glClearAccum' with R, G, B, and
421A values to set it to, then call `glClear' with the accumulation buffer
422enabled.
423
424`GL_INVALID_ENUM' is generated if OP is not an accepted value.
425
426`GL_INVALID_OPERATION' is generated if there is no accumulation buffer.
427
428`GL_INVALID_OPERATION' is generated if `glAccum' is executed between the
429execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 430
7ec693ed 431(define-foreign-procedure
bb894c9d 432 ((glActiveTexture (texture GLenum) -> void))
3c9b6116
AW
433 "Select active texture unit.
434
435TEXTURE
436 Specifies which texture unit to make active. The number of texture
437 units is implementation dependent, but must be at least two.
438 TEXTURE must be one of `GL_TEXTURE' I , where i ranges from 0 to
439 the larger of (`GL_MAX_TEXTURE_COORDS' - 1) and
440 (`GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS' - 1). The initial value is
441 `GL_TEXTURE0'.
442
443`glActiveTexture' selects which texture unit subsequent texture state
444calls will affect. The number of texture units an implementation
445supports is implementation dependent, but must be at least 2.
446
447Vertex arrays are client-side GL resources, which are selected by the
448`glClientActiveTexture' routine.
449
450`GL_INVALID_ENUM' is generated if TEXTURE is not one of `GL_TEXTURE'I ,
451where i ranges from 0 to the larger of (`GL_MAX_TEXTURE_COORDS' - 1) and
452(`GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS' - 1).")
8925f36f 453
7ec693ed 454(define-foreign-procedure
bb894c9d
AW
455 ((glAlphaFunc
456 (func GLenum)
457 (ref GLclampf)
458 ->
459 void))
3c9b6116
AW
460 "Specify the alpha test function.
461
462FUNC
463 Specifies the alpha comparison function. Symbolic constants
464 `GL_NEVER', `GL_LESS', `GL_EQUAL', `GL_LEQUAL', `GL_GREATER',
465 `GL_NOTEQUAL', `GL_GEQUAL', and `GL_ALWAYS' are accepted. The
466 initial value is `GL_ALWAYS'.
467
468REF
469 Specifies the reference value that incoming alpha values are
470 compared to. This value is clamped to the range [0,1] , where 0
471 represents the lowest possible alpha value and 1 the highest
472 possible value. The initial reference value is 0.
473
474The alpha test discards fragments depending on the outcome of a
475comparison between an incoming fragment's alpha value and a constant
476reference value. `glAlphaFunc' specifies the reference value and the
477comparison function. The comparison is performed only if alpha testing
478is enabled. By default, it is not enabled. (See `glEnable' and
479`glDisable' of `GL_ALPHA_TEST'.)
480
481FUNC and REF specify the conditions under which the pixel is drawn. The
482incoming alpha value is compared to REF using the function specified by
483FUNC. If the value passes the comparison, the incoming fragment is drawn
484if it also passes subsequent stencil and depth buffer tests. If the
485value fails the comparison, no change is made to the frame buffer at
486that pixel location. The comparison functions are as follows:
487
488`GL_NEVER'
489 Never passes.
490
491`GL_LESS'
492 Passes if the incoming alpha value is less than the reference
493 value.
494
495`GL_EQUAL'
496 Passes if the incoming alpha value is equal to the reference value.
497
498`GL_LEQUAL'
499 Passes if the incoming alpha value is less than or equal to the
500 reference value.
501
502`GL_GREATER'
503 Passes if the incoming alpha value is greater than the reference
504 value.
505
506`GL_NOTEQUAL'
507 Passes if the incoming alpha value is not equal to the reference
508 value.
509
510`GL_GEQUAL'
511 Passes if the incoming alpha value is greater than or equal to the
512 reference value.
513
514`GL_ALWAYS'
515 Always passes (initial value).
516
517`glAlphaFunc' operates on all pixel write operations, including those
518resulting from the scan conversion of points, lines, polygons, and
519bitmaps, and from pixel draw and copy operations. `glAlphaFunc' does not
520affect screen clear operations.
521
522`GL_INVALID_ENUM' is generated if FUNC is not an accepted value.
523
524`GL_INVALID_OPERATION' is generated if `glAlphaFunc' is executed between
525the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 526
7ec693ed 527(define-foreign-procedure
bb894c9d
AW
528 ((glAreTexturesResident
529 (n GLsizei)
530 (textures *)
531 (residences *)
532 ->
533 GLboolean))
3c9b6116
AW
534 "Determine if textures are loaded in texture memory.
535
536N
537 Specifies the number of textures to be queried.
538
539TEXTURES
540 Specifies an array containing the names of the textures to be
541 queried.
542
543RESIDENCES
544 Specifies an array in which the texture residence status is
545 returned. The residence status of a texture named by an element of
546 TEXTURES is returned in the corresponding element of RESIDENCES.
547
548GL establishes a ``working set'' of textures that are resident in
549texture memory. These textures can be bound to a texture target much
550more efficiently than textures that are not resident.
551
552`glAreTexturesResident' queries the texture residence status of the N
553textures named by the elements of TEXTURES. If all the named textures
554are resident, `glAreTexturesResident' returns `GL_TRUE', and the
555contents of RESIDENCES are undisturbed. If not all the named textures
556are resident, `glAreTexturesResident' returns `GL_FALSE', and detailed
557status is returned in the N elements of RESIDENCES. If an element of
558RESIDENCES is `GL_TRUE', then the texture named by the corresponding
559element of TEXTURES is resident.
560
561The residence status of a single bound texture may also be queried by
562calling `glGetTexParameter' with the TARGET argument set to the target
563to which the texture is bound, and the PNAME argument set to
564`GL_TEXTURE_RESIDENT'. This is the only way that the residence status of
565a default texture can be queried.
566
567`GL_INVALID_VALUE' is generated if N is negative.
568
569`GL_INVALID_VALUE' is generated if any element in TEXTURES is 0 or does
570not name a texture. In that case, the function returns `GL_FALSE' and
571the contents of RESIDENCES is indeterminate.
572
573`GL_INVALID_OPERATION' is generated if `glAreTexturesResident' is
574executed between the execution of `glBegin' and the corresponding
575execution of `glEnd'.")
8925f36f 576
7ec693ed 577(define-foreign-procedure
bb894c9d 578 ((glArrayElement (i GLint) -> void))
3c9b6116
AW
579 "Render a vertex using the specified vertex array element.
580
581I
582 Specifies an index into the enabled vertex data arrays.
583
584`glArrayElement' commands are used within `glBegin'/`glEnd' pairs to
585specify vertex and attribute data for point, line, and polygon
586primitives. If `GL_VERTEX_ARRAY' is enabled when `glArrayElement' is
587called, a single vertex is drawn, using vertex and attribute data taken
588from location I of the enabled arrays. If `GL_VERTEX_ARRAY' is not
589enabled, no drawing occurs but the attributes corresponding to the
590enabled arrays are modified.
591
592Use `glArrayElement' to construct primitives by indexing vertex data,
593rather than by streaming through arrays of data in first-to-last order.
594Because each call specifies only a single vertex, it is possible to
595explicitly specify per-primitive attributes such as a single normal for
596each triangle.
597
598Changes made to array data between the execution of `glBegin' and the
599corresponding execution of `glEnd' may affect calls to `glArrayElement'
600that are made within the same `glBegin'/`glEnd' period in nonsequential
601ways. That is, a call to `glArrayElement' that precedes a change to
602array data may access the changed data, and a call that follows a change
603to array data may access original data.
604
605`GL_INVALID_VALUE' may be generated if I is negative.
606
607`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
608bound to an enabled array and the buffer object's data store is
609currently mapped.")
8925f36f 610
7ec693ed 611(define-foreign-procedure
bb894c9d
AW
612 ((glAttachShader
613 (program GLuint)
614 (shader GLuint)
615 ->
616 void))
3c9b6116
AW
617 "Attaches a shader object to a program object.
618
619PROGRAM
620 Specifies the program object to which a shader object will be
621 attached.
622
623SHADER
624 Specifies the shader object that is to be attached.
625
626In order to create an executable, there must be a way to specify the
627list of things that will be linked together. Program objects provide
628this mechanism. Shaders that are to be linked together in a program
629object must first be attached to that program object. `glAttachShader'
630attaches the shader object specified by SHADER to the program object
631specified by PROGRAM. This indicates that SHADER will be included in
632link operations that will be performed on PROGRAM.
633
634All operations that can be performed on a shader object are valid
635whether or not the shader object is attached to a program object. It is
636permissible to attach a shader object to a program object before source
637code has been loaded into the shader object or before the shader object
638has been compiled. It is permissible to attach multiple shader objects
639of the same type because each may contain a portion of the complete
640shader. It is also permissible to attach a shader object to more than
641one program object. If a shader object is deleted while it is attached
642to a program object, it will be flagged for deletion, and deletion will
643not occur until `glDetachShader' is called to detach it from all program
644objects to which it is attached.
645
646`GL_INVALID_VALUE' is generated if either PROGRAM or SHADER is not a
647value generated by OpenGL.
648
649`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
650
651`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
652
653`GL_INVALID_OPERATION' is generated if SHADER is already attached to
654PROGRAM.
655
656`GL_INVALID_OPERATION' is generated if `glAttachShader' is executed
657between the execution of `glBegin' and the corresponding execution of
658`glEnd'.")
8925f36f 659
7ec693ed 660(define-foreign-procedure
bb894c9d
AW
661 ((glBeginQuery
662 (target GLenum)
663 (id GLuint)
664 ->
665 void)
666 (glEndQuery (target GLenum) -> void))
3c9b6116
AW
667 "Delimit the boundaries of a query object.
668
669TARGET
670 Specifies the target type of query object established between
671 `glBeginQuery' and the subsequent `glEndQuery'. The symbolic
672 constant must be `GL_SAMPLES_PASSED'.
673
674ID
675 Specifies the name of a query object.
676
677`glBeginQuery' and `glEndQuery' delimit the boundaries of a query
678object. If a query object with name ID does not yet exist it is created.
679
680When `glBeginQuery' is executed, the query object's samples-passed
681counter is reset to 0. Subsequent rendering will increment the counter
682once for every sample that passes the depth test. When `glEndQuery' is
683executed, the samples-passed counter is assigned to the query object's
684result value. This value can be queried by calling `glGetQueryObject'
685with PNAME`GL_QUERY_RESULT'.
686
687Querying the `GL_QUERY_RESULT' implicitly flushes the GL pipeline until
688the rendering delimited by the query object has completed and the result
689is available. `GL_QUERY_RESULT_AVAILABLE' can be queried to determine if
690the result is immediately available or if the rendering is not yet
691complete.
692
693`GL_INVALID_ENUM' is generated if TARGET is not `GL_SAMPLES_PASSED'.
694
695`GL_INVALID_OPERATION' is generated if `glBeginQuery' is executed while
696a query object of the same TARGET is already active.
697
698`GL_INVALID_OPERATION' is generated if `glEndQuery' is executed when a
699query object of the same TARGET is not active.
700
701`GL_INVALID_OPERATION' is generated if ID is 0.
702
703`GL_INVALID_OPERATION' is generated if ID is the name of an already
704active query object.
705
706`GL_INVALID_OPERATION' is generated if `glBeginQuery' or `glEndQuery' is
707executed between the execution of `glBegin' and the corresponding
708execution of `glEnd'.")
8925f36f 709
7ec693ed 710(define-foreign-procedure
bb894c9d 711 ((glBegin (mode GLenum) -> void) (glEnd -> void))
3c9b6116
AW
712 "Delimit the vertices of a primitive or a group of like primitives.
713
714MODE
715 Specifies the primitive or primitives that will be created from
716 vertices presented between `glBegin' and the subsequent `glEnd'.
717 Ten symbolic constants are accepted: `GL_POINTS', `GL_LINES',
718 `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_TRIANGLES',
719 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_QUADS',
720 `GL_QUAD_STRIP', and `GL_POLYGON'.
721
722`glBegin' and `glEnd' delimit the vertices that define a primitive or a
723group of like primitives. `glBegin' accepts a single argument that
724specifies in which of ten ways the vertices are interpreted. Taking N as
725an integer count starting at one, and N as the total number of vertices
726specified, the interpretations are as follows:
727
728`GL_POINTS'
729 Treats each vertex as a single point. Vertex N defines point N . N
730 points are drawn.
731
732`GL_LINES'
733 Treats each pair of vertices as an independent line segment.
734 Vertices 2\u2062N-1 and 2\u2062N define line N . N/2 lines are drawn.
735
736`GL_LINE_STRIP'
737 Draws a connected group of line segments from the first vertex to
738 the last. Vertices N and N+1 define line N . N-1 lines are drawn.
739
740`GL_LINE_LOOP'
741 Draws a connected group of line segments from the first vertex to
742 the last, then back to the first. Vertices N and N+1 define line N
743 . The last line, however, is defined by vertices N and 1 . N lines
744 are drawn.
745
746`GL_TRIANGLES'
747 Treats each triplet of vertices as an independent triangle.
748 Vertices 3\u2062N-2 , 3\u2062N-1 , and 3\u2062N define triangle N . N/3 triangles
749 are drawn.
750
751`GL_TRIANGLE_STRIP'
752 Draws a connected group of triangles. One triangle is defined for
753 each vertex presented after the first two vertices. For odd N ,
754 vertices N , N+1 , and N+2 define triangle N . For even N ,
755 vertices N+1 , N , and N+2 define triangle N . N-2 triangles are
756 drawn.
757
758`GL_TRIANGLE_FAN'
759 Draws a connected group of triangles. One triangle is defined for
760 each vertex presented after the first two vertices. Vertices 1 ,
761 N+1 , and N+2 define triangle N . N-2 triangles are drawn.
762
763`GL_QUADS'
764 Treats each group of four vertices as an independent quadrilateral.
765 Vertices 4\u2062N-3 , 4\u2062N-2 , 4\u2062N-1 , and 4\u2062N define quadrilateral N .
766 N/4 quadrilaterals are drawn.
767
768`GL_QUAD_STRIP'
769 Draws a connected group of quadrilaterals. One quadrilateral is
770 defined for each pair of vertices presented after the first pair.
771 Vertices 2\u2062N-1 , 2\u2062N , 2\u2062N+2 , and 2\u2062N+1 define quadrilateral N .
772 N/2-1 quadrilaterals are drawn. Note that the order in which
773 vertices are used to construct a quadrilateral from strip data is
774 different from that used with independent data.
775
776`GL_POLYGON'
777 Draws a single, convex polygon. Vertices 1 through N define this
778 polygon.
779
780Only a subset of GL commands can be used between `glBegin' and `glEnd'.
781The commands are `glVertex', `glColor', `glSecondaryColor', `glIndex',
782`glNormal', `glFogCoord', `glTexCoord', `glMultiTexCoord',
783`glVertexAttrib', `glEvalCoord', `glEvalPoint', `glArrayElement',
784`glMaterial', and `glEdgeFlag'. Also, it is acceptable to use
785`glCallList' or `glCallLists' to execute display lists that include only
786the preceding commands. If any other GL command is executed between
787`glBegin' and `glEnd', the error flag is set and the command is ignored.
788
789Regardless of the value chosen for MODE, there is no limit to the number
790of vertices that can be defined between `glBegin' and `glEnd'. Lines,
791triangles, quadrilaterals, and polygons that are incompletely specified
792are not drawn. Incomplete specification results when either too few
793vertices are provided to specify even a single primitive or when an
794incorrect multiple of vertices is specified. The incomplete primitive is
795ignored; the rest are drawn.
796
797The minimum specification of vertices for each primitive is as follows:
7981 for a point, 2 for a line, 3 for a triangle, 4 for a quadrilateral,
799and 3 for a polygon. Modes that require a certain multiple of vertices
800are `GL_LINES' (2), `GL_TRIANGLES' (3), `GL_QUADS' (4), and
801`GL_QUAD_STRIP' (2).
802
803`GL_INVALID_ENUM' is generated if MODE is set to an unaccepted value.
804
805`GL_INVALID_OPERATION' is generated if `glBegin' is executed between a
806`glBegin' and the corresponding execution of `glEnd'.
807
808`GL_INVALID_OPERATION' is generated if `glEnd' is executed without being
809preceded by a `glBegin'.
810
811`GL_INVALID_OPERATION' is generated if a command other than `glVertex',
812`glColor', `glSecondaryColor', `glIndex', `glNormal', `glFogCoord',
813`glTexCoord', `glMultiTexCoord', `glVertexAttrib', `glEvalCoord',
814`glEvalPoint', `glArrayElement', `glMaterial', `glEdgeFlag',
815`glCallList', or `glCallLists' is executed between the execution of
816`glBegin' and the corresponding execution `glEnd'.
817
818Execution of `glEnableClientState', `glDisableClientState',
819`glEdgeFlagPointer', `glFogCoordPointer', `glTexCoordPointer',
820`glColorPointer', `glSecondaryColorPointer', `glIndexPointer',
821`glNormalPointer', `glVertexPointer', `glVertexAttribPointer',
822`glInterleavedArrays', or `glPixelStore' is not allowed after a call to
823`glBegin' and before the corresponding call to `glEnd', but an error may
824or may not be generated.")
8925f36f 825
7ec693ed 826(define-foreign-procedure
bb894c9d
AW
827 ((glBindAttribLocation
828 (program GLuint)
829 (index GLuint)
830 (name *)
831 ->
832 void))
3c9b6116
AW
833 "Associates a generic vertex attribute index with a named attribute
834variable.
835
836PROGRAM
837 Specifies the handle of the program object in which the association
838 is to be made.
839
840INDEX
841 Specifies the index of the generic vertex attribute to be bound.
842
843NAME
844 Specifies a null terminated string containing the name of the
845 vertex shader attribute variable to which INDEX is to be bound.
846
847`glBindAttribLocation' is used to associate a user-defined attribute
848variable in the program object specified by PROGRAM with a generic
849vertex attribute index. The name of the user-defined attribute variable
850is passed as a null terminated string in NAME. The generic vertex
851attribute index to be bound to this variable is specified by INDEX. When
852PROGRAM is made part of current state, values provided via the generic
853vertex attribute INDEX will modify the value of the user-defined
854attribute variable specified by NAME.
855
856If NAME refers to a matrix attribute variable, INDEX refers to the first
857column of the matrix. Other matrix columns are then automatically bound
858to locations INDEX+1 for a matrix of type mat2; INDEX+1 and INDEX+2 for
859a matrix of type mat3; and INDEX+1, INDEX+2, and INDEX+3 for a matrix of
860type mat4.
861
862This command makes it possible for vertex shaders to use descriptive
863names for attribute variables rather than generic variables that are
864numbered from 0 to `GL_MAX_VERTEX_ATTRIBS' -1. The values sent to each
865generic attribute index are part of current state, just like standard
866vertex attributes such as color, normal, and vertex position. If a
867different program object is made current by calling `glUseProgram', the
868generic vertex attributes are tracked in such a way that the same values
869will be observed by attributes in the new program object that are also
870bound to INDEX.
871
872Attribute variable name-to-generic attribute index bindings for a
873program object can be explicitly assigned at any time by calling
874`glBindAttribLocation'. Attribute bindings do not go into effect until
875`glLinkProgram' is called. After a program object has been linked
876successfully, the index values for generic attributes remain fixed (and
877their values can be queried) until the next link command occurs.
878
879Applications are not allowed to bind any of the standard OpenGL vertex
880attributes using this command, as they are bound automatically when
881needed. Any attribute binding that occurs after the program object has
882been linked will not take effect until the next time the program object
883is linked.
884
885`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
886`GL_MAX_VERTEX_ATTRIBS'.
887
888`GL_INVALID_OPERATION' is generated if NAME starts with the reserved
889prefix \"gl_\".
890
891`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
892OpenGL.
893
894`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
895
896`GL_INVALID_OPERATION' is generated if `glBindAttribLocation' is
897executed between the execution of `glBegin' and the corresponding
898execution of `glEnd'.")
8925f36f 899
7ec693ed 900(define-foreign-procedure
bb894c9d
AW
901 ((glBindBuffer
902 (target GLenum)
903 (buffer GLuint)
904 ->
905 void))
3c9b6116
AW
906 "Bind a named buffer object.
907
908TARGET
909 Specifies the target to which the buffer object is bound. The
910 symbolic constant must be `GL_ARRAY_BUFFER',
911 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
912 `GL_PIXEL_UNPACK_BUFFER'.
913
914BUFFER
915 Specifies the name of a buffer object.
916
917`glBindBuffer' lets you create or use a named buffer object. Calling
918`glBindBuffer' with TARGET set to `GL_ARRAY_BUFFER',
919`GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER' or
920`GL_PIXEL_UNPACK_BUFFER' and BUFFER set to the name of the new buffer
921object binds the buffer object name to the target. When a buffer object
922is bound to a target, the previous binding for that target is
923automatically broken.
924
925Buffer object names are unsigned integers. The value zero is reserved,
926but there is no default buffer object for each buffer object target.
927Instead, BUFFER set to zero effectively unbinds any buffer object
928previously bound, and restores client memory usage for that buffer
929object target. Buffer object names and the corresponding buffer object
930contents are local to the shared display-list space (see
931`glXCreateContext') of the current GL rendering context; two rendering
932contexts share buffer object names only if they also share display
933lists.
934
935You may use `glGenBuffers' to generate a set of new buffer object names.
936
937The state of a buffer object immediately after it is first bound is an
938unmapped zero-sized memory buffer with `GL_READ_WRITE' access and
939`GL_STATIC_DRAW' usage.
940
941While a non-zero buffer object name is bound, GL operations on the
942target to which it is bound affect the bound buffer object, and queries
943of the target to which it is bound return state from the bound buffer
944object. While buffer object name zero is bound, as in the initial state,
945attempts to modify or query state on the target to which it is bound
946generates an `GL_INVALID_OPERATION' error.
947
948When vertex array pointer state is changed, for example by a call to
949`glNormalPointer', the current buffer object binding
950(`GL_ARRAY_BUFFER_BINDING') is copied into the corresponding client
951state for the vertex array type being changed, for example
952`GL_NORMAL_ARRAY_BUFFER_BINDING'. While a non-zero buffer object is
953bound to the `GL_ARRAY_BUFFER' target, the vertex array pointer
954parameter that is traditionally interpreted as a pointer to client-side
955memory is instead interpreted as an offset within the buffer object
956measured in basic machine units.
957
958While a non-zero buffer object is bound to the `GL_ELEMENT_ARRAY_BUFFER'
959target, the indices parameter of `glDrawElements',
960`glDrawRangeElements', or `glMultiDrawElements' that is traditionally
961interpreted as a pointer to client-side memory is instead interpreted as
962an offset within the buffer object measured in basic machine units.
963
964While a non-zero buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
965target, the following commands are affected: `glGetCompressedTexImage',
966`glGetConvolutionFilter', `glGetHistogram', `glGetMinmax',
967`glGetPixelMap', `glGetPolygonStipple', `glGetSeparableFilter',
968`glGetTexImage', and `glReadPixels'. The pointer parameter that is
969traditionally interpreted as a pointer to client-side memory where the
970pixels are to be packed is instead interpreted as an offset within the
971buffer object measured in basic machine units.
972
973While a non-zero buffer object is bound to the `GL_PIXEL_UNPACK_BUFFER'
974target, the following commands are affected: `glBitmap',
975`glColorSubTable', `glColorTable', `glCompressedTexImage1D',
976`glCompressedTexImage2D', `glCompressedTexImage3D',
977`glCompressedTexSubImage1D', `glCompressedTexSubImage2D',
978`glCompressedTexSubImage3D', `glConvolutionFilter1D',
979`glConvolutionFilter2D', `glDrawPixels', `glPixelMap',
980`glPolygonStipple', `glSeparableFilter2D', `glTexImage1D',
981`glTexImage2D', `glTexImage3D', `glTexSubImage1D', `glTexSubImage2D',
982and `glTexSubImage3D'. The pointer parameter that is traditionally
983interpreted as a pointer to client-side memory from which the pixels are
984to be unpacked is instead interpreted as an offset within the buffer
985object measured in basic machine units.
986
987A buffer object binding created with `glBindBuffer' remains active until
988a different buffer object name is bound to the same target, or until the
989bound buffer object is deleted with `glDeleteBuffers'.
990
991Once created, a named buffer object may be re-bound to any target as
992often as needed. However, the GL implementation may make choices about
993how to optimize the storage of a buffer object based on its initial
994binding target.
995
996`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
997values.
998
999`GL_INVALID_OPERATION' is generated if `glBindBuffer' is executed
1000between the execution of `glBegin' and the corresponding execution of
1001`glEnd'.")
8925f36f 1002
7ec693ed 1003(define-foreign-procedure
bb894c9d
AW
1004 ((glBindTexture
1005 (target GLenum)
1006 (texture GLuint)
1007 ->
1008 void))
3c9b6116
AW
1009 "Bind a named texture to a texturing target.
1010
1011TARGET
1012 Specifies the target to which the texture is bound. Must be either
1013 `GL_TEXTURE_1D', `GL_TEXTURE_2D', `GL_TEXTURE_3D', or
1014 `GL_TEXTURE_CUBE_MAP'.
1015
1016TEXTURE
1017 Specifies the name of a texture.
1018
1019`glBindTexture' lets you create or use a named texture. Calling
1020`glBindTexture' with TARGET set to `GL_TEXTURE_1D', `GL_TEXTURE_2D',
1021`GL_TEXTURE_3D' or `GL_TEXTURE_CUBE_MAP' and TEXTURE set to the name of
1022the new texture binds the texture name to the target. When a texture is
1023bound to a target, the previous binding for that target is automatically
1024broken.
1025
8925f36f 1026Texture names are unsigned integers. The value zero is reserved to
3c9b6116
AW
1027represent the default texture for each texture target. Texture names and
1028the corresponding texture contents are local to the shared display-list
1029space (see `glXCreateContext') of the current GL rendering context; two
1030rendering contexts share texture names only if they also share display
1031lists.
1032
1033You may use `glGenTextures' to generate a set of new texture names.
1034
1035When a texture is first bound, it assumes the specified target: A
1036texture first bound to `GL_TEXTURE_1D' becomes one-dimensional texture,
1037a texture first bound to `GL_TEXTURE_2D' becomes two-dimensional
1038texture, a texture first bound to `GL_TEXTURE_3D' becomes
1039three-dimensional texture, and a texture first bound to
1040`GL_TEXTURE_CUBE_MAP' becomes a cube-mapped texture. The state of a
1041one-dimensional texture immediately after it is first bound is
1042equivalent to the state of the default `GL_TEXTURE_1D' at GL
1043initialization, and similarly for two- and three-dimensional textures
1044and cube-mapped textures.
1045
8925f36f 1046While a texture is bound, GL operations on the target to which it is
3c9b6116
AW
1047bound affect the bound texture, and queries of the target to which it is
1048bound return state from the bound texture. If texture mapping is active
1049on the target to which a texture is bound, the bound texture is used. In
1050effect, the texture targets become aliases for the textures currently
1051bound to them, and the texture name zero refers to the default textures
1052that were bound to them at initialization.
1053
1054A texture binding created with `glBindTexture' remains active until a
1055different texture is bound to the same target, or until the bound
1056texture is deleted with `glDeleteTextures'.
1057
1058Once created, a named texture may be re-bound to its same original
1059target as often as needed. It is usually much faster to use
1060`glBindTexture' to bind an existing named texture to one of the texture
1061targets than it is to reload the texture image using `glTexImage1D',
1062`glTexImage2D', or `glTexImage3D'. For additional control over
1063performance, use `glPrioritizeTextures'.
1064
1065`glBindTexture' is included in display lists.
1066
1067`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
1068values.
1069
1070`GL_INVALID_OPERATION' is generated if TEXTURE was previously created
1071with a target that doesn't match that of TARGET.
1072
1073`GL_INVALID_OPERATION' is generated if `glBindTexture' is executed
1074between the execution of `glBegin' and the corresponding execution of
1075`glEnd'.")
8925f36f 1076
7ec693ed 1077(define-foreign-procedure
bb894c9d
AW
1078 ((glBitmap
1079 (width GLsizei)
1080 (height GLsizei)
1081 (xorig GLfloat)
1082 (yorig GLfloat)
1083 (xmove GLfloat)
1084 (ymove GLfloat)
1085 (bitmap *)
1086 ->
1087 void))
3c9b6116
AW
1088 "Draw a bitmap.
1089
1090WIDTH
1091 HEIGHT
1092
1093 Specify the pixel width and height of the bitmap image.
1094
1095XORIG
1096 YORIG
1097
1098 Specify the location of the origin in the bitmap image. The origin
1099 is measured from the lower left corner of the bitmap, with right
1100 and up being the positive axes.
1101
1102XMOVE
1103 YMOVE
1104
1105 Specify the X and Y offsets to be added to the current raster
1106 position after the bitmap is drawn.
1107
1108BITMAP
1109 Specifies the address of the bitmap image.
1110
1111A bitmap is a binary image. When drawn, the bitmap is positioned
1112relative to the current raster position, and frame buffer pixels
1113corresponding to 1's in the bitmap are written using the current raster
1114color or index. Frame buffer pixels corresponding to 0's in the bitmap
1115are not modified.
1116
1117`glBitmap' takes seven arguments. The first pair specifies the width and
1118height of the bitmap image. The second pair specifies the location of
1119the bitmap origin relative to the lower left corner of the bitmap image.
1120The third pair of arguments specifies X and Y offsets to be added to the
1121current raster position after the bitmap has been drawn. The final
1122argument is a pointer to the bitmap image itself.
1123
1124If a non-zero named buffer object is bound to the
1125`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a bitmap
1126image is specified, BITMAP is treated as a byte offset into the buffer
1127object's data store.
1128
1129The bitmap image is interpreted like image data for the `glDrawPixels'
1130command, with WIDTH and HEIGHT corresponding to the width and height
1131arguments of that command, and with TYPE set to `GL_BITMAP' and FORMAT
1132set to `GL_COLOR_INDEX'. Modes specified using `glPixelStore' affect the
1133interpretation of bitmap image data; modes specified using
1134`glPixelTransfer' do not.
1135
1136If the current raster position is invalid, `glBitmap' is ignored.
1137Otherwise, the lower left corner of the bitmap image is positioned at
1138the window coordinates
1139
1140X_W=⌊X_R-X_O,⌋
1141
1142Y_W=⌊Y_R-Y_O,⌋
1143
1144where (X_R,Y_R) is the raster position and (X_O,Y_O) is the bitmap
1145origin. Fragments are then generated for each pixel corresponding to a 1
1146(one) in the bitmap image. These fragments are generated using the
1147current raster Z coordinate, color or color index, and current raster
1148texture coordinates. They are then treated just as if they had been
1149generated by a point, line, or polygon, including texture mapping,
1150fogging, and all per-fragment operations such as alpha and depth
1151testing.
1152
1153After the bitmap has been drawn, the X and Y coordinates of the current
1154raster position are offset by XMOVE and YMOVE. No change is made to the
1155Z coordinate of the current raster position, or to the current raster
1156color, texture coordinates, or index.
1157
1158`GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is negative.
1159
1160`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
1161bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
1162data store is currently mapped.
1163
1164`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
1165bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
1166unpacked from the buffer object such that the memory reads required
1167would exceed the data store size.
1168
1169`GL_INVALID_OPERATION' is generated if `glBitmap' is executed between
1170the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 1171
7ec693ed 1172(define-foreign-procedure
bb894c9d
AW
1173 ((glBlendColor
1174 (red GLclampf)
1175 (green GLclampf)
1176 (blue GLclampf)
1177 (alpha GLclampf)
1178 ->
1179 void))
3c9b6116
AW
1180 "Set the blend color.
1181
1182RED
1183 GREEN
1184
1185 BLUE
1186
1187 ALPHA
1188
1189 specify the components of `GL_BLEND_COLOR'
1190
1191The `GL_BLEND_COLOR' may be used to calculate the source and destination
1192blending factors. The color components are clamped to the range [0,1]
1193before being stored. See `glBlendFunc' for a complete description of the
1194blending operations. Initially the `GL_BLEND_COLOR' is set to (0, 0, 0,
11950).
1196
1197`GL_INVALID_OPERATION' is generated if `glBlendColor' is executed
1198between the execution of `glBegin' and the corresponding execution of
1199`glEnd'.")
8925f36f 1200
7ec693ed 1201(define-foreign-procedure
bb894c9d
AW
1202 ((glBlendEquationSeparate
1203 (modeRGB GLenum)
1204 (modeAlpha GLenum)
1205 ->
1206 void))
3c9b6116
AW
1207 "Set the RGB blend equation and the alpha blend equation separately.
1208
1209MODERGB
1210 specifies the RGB blend equation, how the red, green, and blue
1211 components of the source and destination colors are combined. It
1212 must be `GL_FUNC_ADD', `GL_FUNC_SUBTRACT',
1213 `GL_FUNC_REVERSE_SUBTRACT', `GL_MIN', `GL_MAX'.
1214
1215MODEALPHA
1216 specifies the alpha blend equation, how the alpha component of the
1217 source and destination colors are combined. It must be
1218 `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT',
1219 `GL_MIN', `GL_MAX'.
1220
1221The blend equations determines how a new pixel (the ''source'' color) is
1222combined with a pixel already in the framebuffer (the ''destination''
1223color). This function specifies one blend equation for the RGB-color
1224components and one blend equation for the alpha component.
1225
8925f36f 1226The blend equations use the source and destination blend factors
3c9b6116
AW
1227specified by either `glBlendFunc' or `glBlendFuncSeparate'. See
1228`glBlendFunc' or `glBlendFuncSeparate' for a description of the various
1229blend factors.
1230
1231In the equations that follow, source and destination color components
1232are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) , respectively.
1233The result color is referred to as (R_R,G_RB_RA_R) . The source and
1234destination blend factors are denoted (S_R,S_GS_BS_A) and
1235(D_R,D_GD_BD_A) , respectively. For these equations all color components
1236are understood to have values in the range [0,1] .
1237
1238*Mode*
1239 *RGB Components*, *Alpha Component*
1240
1241`GL_FUNC_ADD'
1242 RR=R_S\u2062S_R+R_D\u2062D_R GR=G_S\u2062S_G+G_D\u2062D_G BR=B_S\u2062S_B+B_D\u2062D_B ,
1243 AR=A_S\u2062S_A+A_D\u2062D_A
1244
1245`GL_FUNC_SUBTRACT'
1246 RR=R_S\u2062S_R-R_D\u2062D_R GR=G_S\u2062S_G-G_D\u2062D_G BR=B_S\u2062S_B-B_D\u2062D_B ,
1247 AR=A_S\u2062S_A-A_D\u2062D_A
1248
1249`GL_FUNC_REVERSE_SUBTRACT'
1250 RR=R_D\u2062D_R-R_S\u2062S_R GR=G_D\u2062D_G-G_S\u2062S_G BR=B_D\u2062D_B-B_S\u2062S_B ,
1251 AR=A_D\u2062D_A-A_S\u2062S_A
1252
1253`GL_MIN'
1254 RR=MIN\u2061(R_S,R_D) GR=MIN\u2061(G_S,G_D) BR=MIN\u2061(B_S,B_D) ,
1255 AR=MIN\u2061(A_S,A_D)
1256
1257`GL_MAX'
1258 RR=MAX\u2061(R_S,R_D) GR=MAX\u2061(G_S,G_D) BR=MAX\u2061(B_S,B_D) ,
1259 AR=MAX\u2061(A_S,A_D)
1260
1261The results of these equations are clamped to the range [0,1] .
1262
1263The `GL_MIN' and `GL_MAX' equations are useful for applications that
1264analyze image data (image thresholding against a constant color, for
1265example). The `GL_FUNC_ADD' equation is useful for antialiasing and
1266transparency, among other things.
1267
1268Initially, both the RGB blend equation and the alpha blend equation are
1269set to `GL_FUNC_ADD'.
1270
1271
1272
1273`GL_INVALID_ENUM' is generated if either MODERGB or MODEALPHA is not one
1274of `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT',
1275`GL_MAX', or `GL_MIN'.
1276
1277`GL_INVALID_OPERATION' is generated if `glBlendEquationSeparate' is
1278executed between the execution of `glBegin' and the corresponding
1279execution of `glEnd'.")
8925f36f 1280
7ec693ed 1281(define-foreign-procedure
bb894c9d 1282 ((glBlendEquation (mode GLenum) -> void))
3c9b6116
AW
1283 "Specify the equation used for both the RGB blend equation and the Alpha
1284blend equation.
1285
1286MODE
1287 specifies how source and destination colors are combined. It must
1288 be `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT',
1289 `GL_MIN', `GL_MAX'.
1290
1291The blend equations determine how a new pixel (the ''source'' color) is
1292combined with a pixel already in the framebuffer (the ''destination''
1293color). This function sets both the RGB blend equation and the alpha
1294blend equation to a single equation.
1295
1296These equations use the source and destination blend factors specified
1297by either `glBlendFunc' or `glBlendFuncSeparate'. See `glBlendFunc' or
1298`glBlendFuncSeparate' for a description of the various blend factors.
1299
1300In the equations that follow, source and destination color components
1301are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) , respectively.
1302The result color is referred to as (R_R,G_RB_RA_R) . The source and
1303destination blend factors are denoted (S_R,S_GS_BS_A) and
1304(D_R,D_GD_BD_A) , respectively. For these equations all color components
1305are understood to have values in the range [0,1] .
1306
1307*Mode*
1308 *RGB Components*, *Alpha Component*
1309
1310`GL_FUNC_ADD'
1311 RR=R_S\u2062S_R+R_D\u2062D_R GR=G_S\u2062S_G+G_D\u2062D_G BR=B_S\u2062S_B+B_D\u2062D_B ,
1312 AR=A_S\u2062S_A+A_D\u2062D_A
1313
1314`GL_FUNC_SUBTRACT'
1315 RR=R_S\u2062S_R-R_D\u2062D_R GR=G_S\u2062S_G-G_D\u2062D_G BR=B_S\u2062S_B-B_D\u2062D_B ,
1316 AR=A_S\u2062S_A-A_D\u2062D_A
1317
1318`GL_FUNC_REVERSE_SUBTRACT'
1319 RR=R_D\u2062D_R-R_S\u2062S_R GR=G_D\u2062D_G-G_S\u2062S_G BR=B_D\u2062D_B-B_S\u2062S_B ,
1320 AR=A_D\u2062D_A-A_S\u2062S_A
1321
1322`GL_MIN'
1323 RR=MIN\u2061(R_S,R_D) GR=MIN\u2061(G_S,G_D) BR=MIN\u2061(B_S,B_D) ,
1324 AR=MIN\u2061(A_S,A_D)
1325
1326`GL_MAX'
1327 RR=MAX\u2061(R_S,R_D) GR=MAX\u2061(G_S,G_D) BR=MAX\u2061(B_S,B_D) ,
1328 AR=MAX\u2061(A_S,A_D)
1329
1330The results of these equations are clamped to the range [0,1] .
1331
1332The `GL_MIN' and `GL_MAX' equations are useful for applications that
1333analyze image data (image thresholding against a constant color, for
1334example). The `GL_FUNC_ADD' equation is useful for antialiasing and
1335transparency, among other things.
1336
1337Initially, both the RGB blend equation and the alpha blend equation are
1338set to `GL_FUNC_ADD'.
1339
1340
1341
1342`GL_INVALID_ENUM' is generated if MODE is not one of `GL_FUNC_ADD',
1343`GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT', `GL_MAX', or `GL_MIN'.
1344
1345`GL_INVALID_OPERATION' is generated if `glBlendEquation' is executed
1346between the execution of `glBegin' and the corresponding execution of
1347`glEnd'.")
8925f36f 1348
7ec693ed 1349(define-foreign-procedure
bb894c9d
AW
1350 ((glBlendFuncSeparate
1351 (srcRGB GLenum)
1352 (dstRGB GLenum)
1353 (srcAlpha GLenum)
1354 (dstAlpha GLenum)
1355 ->
1356 void))
3c9b6116
AW
1357 "Specify pixel arithmetic for RGB and alpha components separately.
1358
1359SRCRGB
1360 Specifies how the red, green, and blue blending factors are
1361 computed. The following symbolic constants are accepted: `GL_ZERO',
1362 `GL_ONE', `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR',
1363 `GL_ONE_MINUS_DST_COLOR', `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA',
1364 `GL_DST_ALPHA', `GL_ONE_MINUS_DST_ALPHA', `GL_CONSTANT_COLOR',
1365 `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA',
1366 `GL_ONE_MINUS_CONSTANT_ALPHA', and `GL_SRC_ALPHA_SATURATE'. The
1367 initial value is `GL_ONE'.
1368
1369DSTRGB
1370 Specifies how the red, green, and blue destination blending factors
1371 are computed. The following symbolic constants are accepted:
1372 `GL_ZERO', `GL_ONE', `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR',
1373 `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR', `GL_SRC_ALPHA',
1374 `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA', `GL_ONE_MINUS_DST_ALPHA'.
1375 `GL_CONSTANT_COLOR', `GL_ONE_MINUS_CONSTANT_COLOR',
1376 `GL_CONSTANT_ALPHA', and `GL_ONE_MINUS_CONSTANT_ALPHA'. The initial
1377 value is `GL_ZERO'.
1378
1379SRCALPHA
1380 Specified how the alpha source blending factor is computed. The
1381 same symbolic constants are accepted as for SRCRGB. The initial
1382 value is `GL_ONE'.
1383
1384DSTALPHA
1385 Specified how the alpha destination blending factor is computed.
1386 The same symbolic constants are accepted as for DSTRGB. The initial
1387 value is `GL_ZERO'.
1388
1389In RGBA mode, pixels can be drawn using a function that blends the
1390incoming (source) RGBA values with the RGBA values that are already in
1391the frame buffer (the destination values). Blending is initially
1392disabled. Use `glEnable' and `glDisable' with argument `GL_BLEND' to
1393enable and disable blending.
1394
1395`glBlendFuncSeparate' defines the operation of blending when it is
1396enabled. SRCRGB specifies which method is used to scale the source
1397RGB-color components. DSTRGB specifies which method is used to scale the
1398destination RGB-color components. Likewise, SRCALPHA specifies which
1399method is used to scale the source alpha color component, and DSTALPHA
1400specifies which method is used to scale the destination alpha component.
1401The possible methods are described in the following table. Each method
1402defines four scale factors, one each for red, green, blue, and alpha.
1403
1404In the table and in subsequent equations, source and destination color
1405components are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) . The
1406color specified by `glBlendColor' is referred to as (R_C,G_CB_CA_C) .
1407They are understood to have integer values between 0 and (K_R,K_GK_BK_A)
1408, where
1409
1410K_C=2^M_C,-1
1411
1412and (M_R,M_GM_BM_A) is the number of red, green, blue, and alpha
1413bitplanes.
1414
1415Source and destination scale factors are referred to as (S_R,S_GS_BS_A)
1416and (D_R,D_GD_BD_A) . All scale factors have range [0,1] .
1417
1418
1419
1420*Parameter*
1421 *RGB Factor*, *Alpha Factor*
1422
1423`GL_ZERO'
1424 (0,00) , 0
1425
1426`GL_ONE'
1427 (1,11) , 1
1428
1429`GL_SRC_COLOR'
1430 (R_S/K_R,G_S/K_GB_S/K_B) , A_S/K_A
1431
1432`GL_ONE_MINUS_SRC_COLOR'
1433 (1,111)-(R_S/K_R,G_S/K_GB_S/K_B) , 1-A_S/K_A
1434
1435`GL_DST_COLOR'
1436 (R_D/K_R,G_D/K_GB_D/K_B) , A_D/K_A
1437
1438`GL_ONE_MINUS_DST_COLOR'
1439 (1,11)-(R_D/K_R,G_D/K_GB_D/K_B) , 1-A_D/K_A
1440
1441`GL_SRC_ALPHA'
1442 (A_S/K_A,A_S/K_AA_S/K_A) , A_S/K_A
1443
1444`GL_ONE_MINUS_SRC_ALPHA'
1445 (1,11)-(A_S/K_A,A_S/K_AA_S/K_A) , 1-A_S/K_A
1446
1447`GL_DST_ALPHA'
1448 (A_D/K_A,A_D/K_AA_D/K_A) , A_D/K_A
1449
1450`GL_ONE_MINUS_DST_ALPHA'
1451 (1,11)-(A_D/K_A,A_D/K_AA_D/K_A) , 1-A_D/K_A
1452
1453`GL_CONSTANT_COLOR'
1454 (R_C,G_CB_C) , A_C
1455
1456`GL_ONE_MINUS_CONSTANT_COLOR'
1457 (1,11)-(R_C,G_CB_C) , 1-A_C
1458
1459`GL_CONSTANT_ALPHA'
1460 (A_C,A_CA_C) , A_C
1461
1462`GL_ONE_MINUS_CONSTANT_ALPHA'
1463 (1,11)-(A_C,A_CA_C) , 1-A_C
1464
1465`GL_SRC_ALPHA_SATURATE'
1466 (I,II) , 1
1467
1468In the table,
1469
1470I=MIN\u2061(A_S,1-A_D,)
1471
1472To determine the blended RGBA values of a pixel when drawing in RGBA
1473mode, the system uses the following equations:
1474
1475R_D=MIN\u2061(K_R,R_S\u2062S_R+R_D\u2062D_R) G_D=MIN\u2061(K_G,G_S\u2062S_G+G_D\u2062D_G)
1476B_D=MIN\u2061(K_B,B_S\u2062S_B+B_D\u2062D_B) A_D=MIN\u2061(K_A,A_S\u2062S_A+A_D\u2062D_A)
1477
1478Despite the apparent precision of the above equations, blending
1479arithmetic is not exactly specified, because blending operates with
1480imprecise integer color values. However, a blend factor that should be
1481equal to 1 is guaranteed not to modify its multiplicand, and a blend
1482factor equal to 0 reduces its multiplicand to 0. For example, when
1483SRCRGB is `GL_SRC_ALPHA', DSTRGB is `GL_ONE_MINUS_SRC_ALPHA', and A_S is
1484equal to K_A , the equations reduce to simple replacement:
1485
1486R_D=R_S G_D=G_S B_D=B_S A_D=A_S
1487
1488
1489
1490`GL_INVALID_ENUM' is generated if either SRCRGB or DSTRGB is not an
1491accepted value.
1492
1493`GL_INVALID_OPERATION' is generated if `glBlendFuncSeparate' is executed
1494between the execution of `glBegin' and the corresponding execution of
1495`glEnd'.")
8925f36f 1496
7ec693ed 1497(define-foreign-procedure
bb894c9d
AW
1498 ((glBlendFunc
1499 (sfactor GLenum)
1500 (dfactor GLenum)
1501 ->
1502 void))
3c9b6116 1503 "Specify pixel arithmetic.
8925f36f 1504
3c9b6116
AW
1505SFACTOR
1506 Specifies how the red, green, blue, and alpha source blending
1507 factors are computed. The following symbolic constants are
1508 accepted: `GL_ZERO', `GL_ONE', `GL_SRC_COLOR',
1509 `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR',
1510 `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA',
1511 `GL_ONE_MINUS_DST_ALPHA', `GL_CONSTANT_COLOR',
1512 `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA',
1513 `GL_ONE_MINUS_CONSTANT_ALPHA', and `GL_SRC_ALPHA_SATURATE'. The
1514 initial value is `GL_ONE'.
8925f36f 1515
3c9b6116
AW
1516DFACTOR
1517 Specifies how the red, green, blue, and alpha destination blending
1518 factors are computed. The following symbolic constants are
1519 accepted: `GL_ZERO', `GL_ONE', `GL_SRC_COLOR',
1520 `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR',
1521 `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA',
1522 `GL_ONE_MINUS_DST_ALPHA'. `GL_CONSTANT_COLOR',
1523 `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA', and
1524 `GL_ONE_MINUS_CONSTANT_ALPHA'. The initial value is `GL_ZERO'.
8925f36f 1525
3c9b6116
AW
1526In RGBA mode, pixels can be drawn using a function that blends the
1527incoming (source) RGBA values with the RGBA values that are already in
1528the frame buffer (the destination values). Blending is initially
1529disabled. Use `glEnable' and `glDisable' with argument `GL_BLEND' to
1530enable and disable blending.
1531
1532`glBlendFunc' defines the operation of blending when it is enabled.
1533SFACTOR specifies which method is used to scale the source color
1534components. DFACTOR specifies which method is used to scale the
1535destination color components. The possible methods are described in the
1536following table. Each method defines four scale factors, one each for
1537red, green, blue, and alpha. In the table and in subsequent equations,
1538source and destination color components are referred to as
1539(R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) . The color specified by
1540`glBlendColor' is referred to as (R_C,G_CB_CA_C) . They are understood
1541to have integer values between 0 and (K_R,K_GK_BK_A) , where
1542
1543K_C=2^M_C,-1
1544
1545and (M_R,M_GM_BM_A) is the number of red, green, blue, and alpha
1546bitplanes.
1547
1548Source and destination scale factors are referred to as (S_R,S_GS_BS_A)
1549and (D_R,D_GD_BD_A) . The scale factors described in the table, denoted
1550(F_R,F_GF_BF_A) , represent either source or destination factors. All
1551scale factors have range [0,1] .
1552
1553
1554
1555*Parameter*
1556 * (F_R,F_GF_BF_A) *
1557
1558`GL_ZERO'
1559 (0,000)
1560
1561`GL_ONE'
1562 (1,111)
1563
1564`GL_SRC_COLOR'
1565 (R_S/K_R,G_S/K_GB_S/K_BA_S/K_A)
1566
1567`GL_ONE_MINUS_SRC_COLOR'
1568 (1,111)-(R_S/K_R,G_S/K_GB_S/K_BA_S/K_A)
1569
1570`GL_DST_COLOR'
1571 (R_D/K_R,G_D/K_GB_D/K_BA_D/K_A)
1572
1573`GL_ONE_MINUS_DST_COLOR'
1574 (1,111)-(R_D/K_R,G_D/K_GB_D/K_BA_D/K_A)
1575
1576`GL_SRC_ALPHA'
1577 (A_S/K_A,A_S/K_AA_S/K_AA_S/K_A)
1578
1579`GL_ONE_MINUS_SRC_ALPHA'
1580 (1,111)-(A_S/K_A,A_S/K_AA_S/K_AA_S/K_A)
1581
1582`GL_DST_ALPHA'
1583 (A_D/K_A,A_D/K_AA_D/K_AA_D/K_A)
1584
1585`GL_ONE_MINUS_DST_ALPHA'
1586 (1,111)-(A_D/K_A,A_D/K_AA_D/K_AA_D/K_A)
1587
1588`GL_CONSTANT_COLOR'
1589 (R_C,G_CB_CA_C)
1590
1591`GL_ONE_MINUS_CONSTANT_COLOR'
1592 (1,111)-(R_C,G_CB_CA_C)
1593
1594`GL_CONSTANT_ALPHA'
1595 (A_C,A_CA_CA_C)
1596
1597`GL_ONE_MINUS_CONSTANT_ALPHA'
1598 (1,111)-(A_C,A_CA_CA_C)
1599
1600`GL_SRC_ALPHA_SATURATE'
1601 (I,II1)
1602
1603In the table,
1604
1605I=MIN\u2061(A_S,K_A-A_D)/K_A
1606
1607To determine the blended RGBA values of a pixel when drawing in RGBA
1608mode, the system uses the following equations:
1609
1610R_D=MIN\u2061(K_R,R_S\u2062S_R+R_D\u2062D_R) G_D=MIN\u2061(K_G,G_S\u2062S_G+G_D\u2062D_G)
1611B_D=MIN\u2061(K_B,B_S\u2062S_B+B_D\u2062D_B) A_D=MIN\u2061(K_A,A_S\u2062S_A+A_D\u2062D_A)
1612
1613Despite the apparent precision of the above equations, blending
1614arithmetic is not exactly specified, because blending operates with
1615imprecise integer color values. However, a blend factor that should be
1616equal to 1 is guaranteed not to modify its multiplicand, and a blend
1617factor equal to 0 reduces its multiplicand to 0. For example, when
1618SFACTOR is `GL_SRC_ALPHA', DFACTOR is `GL_ONE_MINUS_SRC_ALPHA', and A_S
1619is equal to K_A , the equations reduce to simple replacement:
1620
1621R_D=R_S G_D=G_S B_D=B_S A_D=A_S
1622
1623
1624
1625`GL_INVALID_ENUM' is generated if either SFACTOR or DFACTOR is not an
1626accepted value.
1627
1628`GL_INVALID_OPERATION' is generated if `glBlendFunc' is executed between
1629the execution of `glBegin' and the corresponding execution of `glEnd'.")
1630
7ec693ed 1631(define-foreign-procedure
bb894c9d
AW
1632 ((glBufferData
1633 (target GLenum)
1634 (size GLsizeiptr)
1635 (data *)
1636 (usage GLenum)
1637 ->
1638 void))
3c9b6116
AW
1639 "Creates and initializes a buffer object's data store.
1640
1641TARGET
1642 Specifies the target buffer object. The symbolic constant must be
1643 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
1644 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
1645
1646SIZE
1647 Specifies the size in bytes of the buffer object's new data store.
1648
1649DATA
1650 Specifies a pointer to data that will be copied into the data store
1651 for initialization, or `NULL' if no data is to be copied.
1652
1653USAGE
1654 Specifies the expected usage pattern of the data store. The
1655 symbolic constant must be `GL_STREAM_DRAW', `GL_STREAM_READ',
1656 `GL_STREAM_COPY', `GL_STATIC_DRAW', `GL_STATIC_READ',
1657 `GL_STATIC_COPY', `GL_DYNAMIC_DRAW', `GL_DYNAMIC_READ', or
1658 `GL_DYNAMIC_COPY'.
1659
1660`glBufferData' creates a new data store for the buffer object currently
1661bound to TARGET. Any pre-existing data store is deleted. The new data
1662store is created with the specified SIZE in bytes and USAGE. If DATA is
1663not `NULL', the data store is initialized with data from this pointer.
1664In its initial state, the new data store is not mapped, it has a `NULL'
1665mapped pointer, and its mapped access is `GL_READ_WRITE'.
1666
1667USAGE is a hint to the GL implementation as to how a buffer object's
1668data store will be accessed. This enables the GL implementation to make
1669more intelligent decisions that may significantly impact buffer object
1670performance. It does not, however, constrain the actual usage of the
1671data store. USAGE can be broken down into two parts: first, the
1672frequency of access (modification and usage), and second, the nature of
1673that access. The frequency of access may be one of these:
1674
1675STREAM
1676 The data store contents will be modified once and used at most a
1677 few times.
1678
1679STATIC
1680 The data store contents will be modified once and used many times.
1681
1682DYNAMIC
1683 The data store contents will be modified repeatedly and used many
1684 times.
1685
1686The nature of access may be one of these:
1687
1688DRAW
1689 The data store contents are modified by the application, and used
1690 as the source for GL drawing and image specification commands.
1691
1692READ
1693 The data store contents are modified by reading data from the GL,
1694 and used to return that data when queried by the application.
1695
1696COPY
1697 The data store contents are modified by reading data from the GL,
1698 and used as the source for GL drawing and image specification
1699 commands.
1700
1701`GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
1702`GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
1703`GL_PIXEL_UNPACK_BUFFER'.
1704
1705`GL_INVALID_ENUM' is generated if USAGE is not `GL_STREAM_DRAW',
1706`GL_STREAM_READ', `GL_STREAM_COPY', `GL_STATIC_DRAW', `GL_STATIC_READ',
1707`GL_STATIC_COPY', `GL_DYNAMIC_DRAW', `GL_DYNAMIC_READ', or
1708`GL_DYNAMIC_COPY'.
1709
1710`GL_INVALID_VALUE' is generated if SIZE is negative.
1711
1712`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
1713is bound to TARGET.
1714
1715`GL_OUT_OF_MEMORY' is generated if the GL is unable to create a data
1716store with the specified SIZE.
1717
1718`GL_INVALID_OPERATION' is generated if `glBufferData' is executed
1719between the execution of `glBegin' and the corresponding execution of
1720`glEnd'.")
1721
7ec693ed 1722(define-foreign-procedure
bb894c9d
AW
1723 ((glBufferSubData
1724 (target GLenum)
1725 (offset GLintptr)
1726 (size GLsizeiptr)
1727 (data *)
1728 ->
1729 void))
3c9b6116
AW
1730 "Updates a subset of a buffer object's data store.
1731
1732TARGET
1733 Specifies the target buffer object. The symbolic constant must be
1734 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
1735 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
1736
1737OFFSET
1738 Specifies the offset into the buffer object's data store where data
1739 replacement will begin, measured in bytes.
1740
1741SIZE
1742 Specifies the size in bytes of the data store region being
1743 replaced.
1744
1745DATA
1746 Specifies a pointer to the new data that will be copied into the
1747 data store.
1748
1749`glBufferSubData' redefines some or all of the data store for the buffer
1750object currently bound to TARGET. Data starting at byte offset OFFSET
1751and extending for SIZE bytes is copied to the data store from the memory
1752pointed to by DATA. An error is thrown if OFFSET and SIZE together
1753define a range beyond the bounds of the buffer object's data store.
1754
1755`GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
1756`GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
1757`GL_PIXEL_UNPACK_BUFFER'.
1758
1759`GL_INVALID_VALUE' is generated if OFFSET or SIZE is negative, or if
1760together they define a region of memory that extends beyond the buffer
1761object's allocated data store.
1762
1763`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
1764is bound to TARGET.
1765
1766`GL_INVALID_OPERATION' is generated if the buffer object being updated
1767is mapped.
1768
1769`GL_INVALID_OPERATION' is generated if `glBufferSubData' is executed
1770between the execution of `glBegin' and the corresponding execution of
1771`glEnd'.")
1772
7ec693ed 1773(define-foreign-procedure
bb894c9d
AW
1774 ((glCallLists
1775 (n GLsizei)
1776 (type GLenum)
1777 (lists *)
1778 ->
1779 void))
3c9b6116
AW
1780 "Execute a list of display lists.
1781
1782N
1783 Specifies the number of display lists to be executed.
1784
1785TYPE
1786 Specifies the type of values in LISTS. Symbolic constants
1787 `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT', `GL_UNSIGNED_SHORT',
1788 `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', `GL_2_BYTES',
1789 `GL_3_BYTES', and `GL_4_BYTES' are accepted.
1790
1791LISTS
1792 Specifies the address of an array of name offsets in the display
1793 list. The pointer type is void because the offsets can be bytes,
1794 shorts, ints, or floats, depending on the value of TYPE.
1795
1796`glCallLists' causes each display list in the list of names passed as
1797LISTS to be executed. As a result, the commands saved in each display
1798list are executed in order, just as if they were called without using a
1799display list. Names of display lists that have not been defined are
1800ignored.
1801
1802`glCallLists' provides an efficient means for executing more than one
1803display list. TYPE allows lists with various name formats to be
1804accepted. The formats are as follows:
1805
1806`GL_BYTE'
1807 LISTS is treated as an array of signed bytes, each in the range
1808 -128 through 127.
1809
1810`GL_UNSIGNED_BYTE'
1811 LISTS is treated as an array of unsigned bytes, each in the range 0
1812 through 255.
1813
1814`GL_SHORT'
1815 LISTS is treated as an array of signed two-byte integers, each in
1816 the range -32768 through 32767.
1817
1818`GL_UNSIGNED_SHORT'
1819 LISTS is treated as an array of unsigned two-byte integers, each in
1820 the range 0 through 65535.
1821
1822`GL_INT'
1823 LISTS is treated as an array of signed four-byte integers.
1824
1825`GL_UNSIGNED_INT'
1826 LISTS is treated as an array of unsigned four-byte integers.
1827
1828`GL_FLOAT'
1829 LISTS is treated as an array of four-byte floating-point values.
1830
1831`GL_2_BYTES'
1832 LISTS is treated as an array of unsigned bytes. Each pair of bytes
1833 specifies a single display-list name. The value of the pair is
1834 computed as 256 times the unsigned value of the first byte plus the
1835 unsigned value of the second byte.
1836
1837`GL_3_BYTES'
1838 LISTS is treated as an array of unsigned bytes. Each triplet of
1839 bytes specifies a single display-list name. The value of the
1840 triplet is computed as 65536 times the unsigned value of the first
1841 byte, plus 256 times the unsigned value of the second byte, plus
1842 the unsigned value of the third byte.
1843
1844`GL_4_BYTES'
1845 LISTS is treated as an array of unsigned bytes. Each quadruplet of
1846 bytes specifies a single display-list name. The value of the
1847 quadruplet is computed as 16777216 times the unsigned value of the
1848 first byte, plus 65536 times the unsigned value of the second byte,
1849 plus 256 times the unsigned value of the third byte, plus the
1850 unsigned value of the fourth byte.
1851
1852The list of display-list names is not null-terminated. Rather, N
1853specifies how many names are to be taken from LISTS.
1854
1855An additional level of indirection is made available with the
1856`glListBase' command, which specifies an unsigned offset that is added
1857to each display-list name specified in LISTS before that display list is
1858executed.
1859
1860`glCallLists' can appear inside a display list. To avoid the possibility
1861of infinite recursion resulting from display lists calling one another,
1862a limit is placed on the nesting level of display lists during
1863display-list execution. This limit must be at least 64, and it depends
1864on the implementation.
1865
1866GL state is not saved and restored across a call to `glCallLists'. Thus,
1867changes made to GL state during the execution of the display lists
1868remain after execution is completed. Use `glPushAttrib', `glPopAttrib',
1869`glPushMatrix', and `glPopMatrix' to preserve GL state across
1870`glCallLists' calls.
1871
1872`GL_INVALID_VALUE' is generated if N is negative.
1873
1874`GL_INVALID_ENUM' is generated if TYPE is not one of `GL_BYTE',
1875`GL_UNSIGNED_BYTE', `GL_SHORT', `GL_UNSIGNED_SHORT', `GL_INT',
1876`GL_UNSIGNED_INT', `GL_FLOAT', `GL_2_BYTES', `GL_3_BYTES', `GL_4_BYTES'.")
8925f36f 1877
7ec693ed 1878(define-foreign-procedure
bb894c9d 1879 ((glCallList (list GLuint) -> void))
3c9b6116
AW
1880 "Execute a display list.
1881
1882LIST
1883 Specifies the integer name of the display list to be executed.
1884
1885`glCallList' causes the named display list to be executed. The commands
1886saved in the display list are executed in order, just as if they were
1887called without using a display list. If LIST has not been defined as a
1888display list, `glCallList' is ignored.
1889
1890`glCallList' can appear inside a display list. To avoid the possibility
1891of infinite recursion resulting from display lists calling one another,
1892a limit is placed on the nesting level of display lists during
1893display-list execution. This limit is at least 64, and it depends on the
1894implementation.
1895
1896GL state is not saved and restored across a call to `glCallList'. Thus,
1897changes made to GL state during the execution of a display list remain
1898after execution of the display list is completed. Use `glPushAttrib',
1899`glPopAttrib', `glPushMatrix', and `glPopMatrix' to preserve GL state
1900across `glCallList' calls.")
8925f36f 1901
7ec693ed 1902(define-foreign-procedure
bb894c9d
AW
1903 ((glClearAccum
1904 (red GLfloat)
1905 (green GLfloat)
1906 (blue GLfloat)
1907 (alpha GLfloat)
1908 ->
1909 void))
3c9b6116
AW
1910 "Specify clear values for the accumulation buffer.
1911
1912RED
1913 GREEN
1914
1915 BLUE
1916
1917 ALPHA
1918
1919 Specify the red, green, blue, and alpha values used when the
1920 accumulation buffer is cleared. The initial values are all 0.
1921
1922`glClearAccum' specifies the red, green, blue, and alpha values used by
1923`glClear' to clear the accumulation buffer.
1924
1925Values specified by `glClearAccum' are clamped to the range [-1,1] .
1926
1927`GL_INVALID_OPERATION' is generated if `glClearAccum' is executed
1928between the execution of `glBegin' and the corresponding execution of
1929`glEnd'.")
8925f36f 1930
7ec693ed 1931(define-foreign-procedure
bb894c9d
AW
1932 ((glClearColor
1933 (red GLclampf)
1934 (green GLclampf)
1935 (blue GLclampf)
1936 (alpha GLclampf)
1937 ->
1938 void))
3c9b6116
AW
1939 "Specify clear values for the color buffers.
1940
1941RED
1942 GREEN
1943
1944 BLUE
1945
1946 ALPHA
1947
1948 Specify the red, green, blue, and alpha values used when the color
1949 buffers are cleared. The initial values are all 0.
1950
1951`glClearColor' specifies the red, green, blue, and alpha values used by
1952`glClear' to clear the color buffers. Values specified by `glClearColor'
1953are clamped to the range [0,1] .
1954
1955`GL_INVALID_OPERATION' is generated if `glClearColor' is executed
1956between the execution of `glBegin' and the corresponding execution of
1957`glEnd'.")
8925f36f 1958
7ec693ed 1959(define-foreign-procedure
bb894c9d 1960 ((glClearDepth (depth GLclampd) -> void))
3c9b6116
AW
1961 "Specify the clear value for the depth buffer.
1962
1963DEPTH
1964 Specifies the depth value used when the depth buffer is cleared.
1965 The initial value is 1.
1966
1967`glClearDepth' specifies the depth value used by `glClear' to clear the
1968depth buffer. Values specified by `glClearDepth' are clamped to the
1969range [0,1] .
1970
1971`GL_INVALID_OPERATION' is generated if `glClearDepth' is executed
1972between the execution of `glBegin' and the corresponding execution of
1973`glEnd'.")
8925f36f 1974
7ec693ed 1975(define-foreign-procedure
bb894c9d 1976 ((glClearIndex (c GLfloat) -> void))
3c9b6116
AW
1977 "Specify the clear value for the color index buffers.
1978
1979C
1980 Specifies the index used when the color index buffers are cleared.
1981 The initial value is 0.
1982
1983`glClearIndex' specifies the index used by `glClear' to clear the color
1984index buffers. C is not clamped. Rather, C is converted to a fixed-point
1985value with unspecified precision to the right of the binary point. The
1986integer part of this value is then masked with 2^M-1 , where M is the
1987number of bits in a color index stored in the frame buffer.
1988
1989`GL_INVALID_OPERATION' is generated if `glClearIndex' is executed
1990between the execution of `glBegin' and the corresponding execution of
1991`glEnd'.")
8925f36f 1992
7ec693ed 1993(define-foreign-procedure
bb894c9d 1994 ((glClearStencil (s GLint) -> void))
3c9b6116
AW
1995 "Specify the clear value for the stencil buffer.
1996
1997S
1998 Specifies the index used when the stencil buffer is cleared. The
1999 initial value is 0.
2000
2001`glClearStencil' specifies the index used by `glClear' to clear the
2002stencil buffer. S is masked with 2^M-1 , where M is the number of bits
2003in the stencil buffer.
2004
2005`GL_INVALID_OPERATION' is generated if `glClearStencil' is executed
2006between the execution of `glBegin' and the corresponding execution of
2007`glEnd'.")
8925f36f 2008
7ec693ed 2009(define-foreign-procedure
bb894c9d 2010 ((glClear (mask GLbitfield) -> void))
3c9b6116
AW
2011 "Clear buffers to preset values.
2012
2013MASK
2014 Bitwise OR of masks that indicate the buffers to be cleared. The
2015 four masks are `GL_COLOR_BUFFER_BIT', `GL_DEPTH_BUFFER_BIT',
2016 `GL_ACCUM_BUFFER_BIT', and `GL_STENCIL_BUFFER_BIT'.
2017
2018`glClear' sets the bitplane area of the window to values previously
2019selected by `glClearColor', `glClearIndex', `glClearDepth',
2020`glClearStencil', and `glClearAccum'. Multiple color buffers can be
2021cleared simultaneously by selecting more than one buffer at a time using
2022`glDrawBuffer'.
2023
2024The pixel ownership test, the scissor test, dithering, and the buffer
2025writemasks affect the operation of `glClear'. The scissor box bounds the
2026cleared region. Alpha function, blend function, logical operation,
2027stenciling, texture mapping, and depth-buffering are ignored by
2028`glClear'.
2029
2030`glClear' takes a single argument that is the bitwise OR of several
2031values indicating which buffer is to be cleared.
2032
2033The values are as follows:
2034
2035`GL_COLOR_BUFFER_BIT'
2036 Indicates the buffers currently enabled for color writing.
2037
2038`GL_DEPTH_BUFFER_BIT'
2039 Indicates the depth buffer.
2040
2041`GL_ACCUM_BUFFER_BIT'
2042 Indicates the accumulation buffer.
2043
2044`GL_STENCIL_BUFFER_BIT'
2045 Indicates the stencil buffer.
2046
8925f36f 2047The value to which each buffer is cleared depends on the setting of the
3c9b6116
AW
2048clear value for that buffer.
2049
2050`GL_INVALID_VALUE' is generated if any bit other than the four defined
2051bits is set in MASK.
2052
2053`GL_INVALID_OPERATION' is generated if `glClear' is executed between the
2054execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 2055
7ec693ed 2056(define-foreign-procedure
bb894c9d 2057 ((glClientActiveTexture (texture GLenum) -> void))
3c9b6116
AW
2058 "Select active texture unit.
2059
2060TEXTURE
2061 Specifies which texture unit to make active. The number of texture
2062 units is implementation dependent, but must be at least two.
2063 TEXTURE must be one of `GL_TEXTURE' I , where i ranges from 0 to
2064 the value of `GL_MAX_TEXTURE_COORDS' - 1, which is an
2065 implementation-dependent value. The initial value is `GL_TEXTURE0'.
2066
2067`glClientActiveTexture' selects the vertex array client state parameters
2068to be modified by `glTexCoordPointer', and enabled or disabled with
2069`glEnableClientState' or `glDisableClientState', respectively, when
2070called with a parameter of `GL_TEXTURE_COORD_ARRAY'.
2071
2072`GL_INVALID_ENUM' is generated if TEXTURE is not one of `GL_TEXTURE'I ,
2073where i ranges from 0 to the value of `GL_MAX_TEXTURE_COORDS' - 1.")
8925f36f 2074
7ec693ed 2075(define-foreign-procedure
bb894c9d 2076 ((glClipPlane (plane GLenum) (equation *) -> void))
3c9b6116
AW
2077 "Specify a plane against which all geometry is clipped.
2078
2079PLANE
2080 Specifies which clipping plane is being positioned. Symbolic names
2081 of the form `GL_CLIP_PLANE'I, where I is an integer between 0 and
2082 `GL_MAX_CLIP_PLANES' -1 , are accepted.
2083
2084EQUATION
2085 Specifies the address of an array of four double-precision
2086 floating-point values. These values are interpreted as a plane
2087 equation.
2088
8925f36f 2089Geometry is always clipped against the boundaries of a six-plane frustum
3c9b6116
AW
2090in X, Y, and Z. `glClipPlane' allows the specification of additional
2091planes, not necessarily perpendicular to the X, Y, or Z axis, against
2092which all geometry is clipped. To determine the maximum number of
2093additional clipping planes, call `glGetIntegerv' with argument
2094`GL_MAX_CLIP_PLANES'. All implementations support at least six such
2095clipping planes. Because the resulting clipping region is the
2096intersection of the defined half-spaces, it is always convex.
2097
2098`glClipPlane' specifies a half-space using a four-component plane
2099equation. When `glClipPlane' is called, EQUATION is transformed by the
2100inverse of the modelview matrix and stored in the resulting eye
2101coordinates. Subsequent changes to the modelview matrix have no effect
2102on the stored plane-equation components. If the dot product of the eye
2103coordinates of a vertex with the stored plane equation components is
2104positive or zero, the vertex is IN with respect to that clipping plane.
2105Otherwise, it is OUT.
2106
2107To enable and disable clipping planes, call `glEnable' and `glDisable'
2108with the argument `GL_CLIP_PLANE'I, where I is the plane number.
2109
2110All clipping planes are initially defined as (0, 0, 0, 0) in eye
2111coordinates and are disabled.
2112
2113`GL_INVALID_ENUM' is generated if PLANE is not an accepted value.
2114
2115`GL_INVALID_OPERATION' is generated if `glClipPlane' is executed between
2116the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 2117
7ec693ed 2118(define-foreign-procedure
bb894c9d
AW
2119 ((glColorMask
2120 (red GLboolean)
2121 (green GLboolean)
2122 (blue GLboolean)
2123 (alpha GLboolean)
2124 ->
2125 void))
3c9b6116
AW
2126 "Enable and disable writing of frame buffer color components.
2127
2128RED
2129 GREEN
2130
2131 BLUE
2132
2133 ALPHA
2134
2135 Specify whether red, green, blue, and alpha can or cannot be
2136 written into the frame buffer. The initial values are all
2137 `GL_TRUE', indicating that the color components can be written.
2138
2139`glColorMask' specifies whether the individual color components in the
2140frame buffer can or cannot be written. If RED is `GL_FALSE', for
2141example, no change is made to the red component of any pixel in any of
2142the color buffers, regardless of the drawing operation attempted.
2143
2144Changes to individual bits of components cannot be controlled. Rather,
2145changes are either enabled or disabled for entire color components.
2146
2147`GL_INVALID_OPERATION' is generated if `glColorMask' is executed between
2148the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 2149
7ec693ed 2150(define-foreign-procedure
bb894c9d
AW
2151 ((glColorMaterial
2152 (face GLenum)
2153 (mode GLenum)
2154 ->
2155 void))
3c9b6116
AW
2156 "Cause a material color to track the current color.
2157
2158FACE
2159 Specifies whether front, back, or both front and back material
2160 parameters should track the current color. Accepted values are
2161 `GL_FRONT', `GL_BACK', and `GL_FRONT_AND_BACK'. The initial value
2162 is `GL_FRONT_AND_BACK'.
2163
2164MODE
2165 Specifies which of several material parameters track the current
2166 color. Accepted values are `GL_EMISSION', `GL_AMBIENT',
2167 `GL_DIFFUSE', `GL_SPECULAR', and `GL_AMBIENT_AND_DIFFUSE'. The
2168 initial value is `GL_AMBIENT_AND_DIFFUSE'.
2169
2170`glColorMaterial' specifies which material parameters track the current
2171color. When `GL_COLOR_MATERIAL' is enabled, the material parameter or
2172parameters specified by MODE, of the material or materials specified by
2173FACE, track the current color at all times.
2174
2175To enable and disable `GL_COLOR_MATERIAL', call `glEnable' and
2176`glDisable' with argument `GL_COLOR_MATERIAL'. `GL_COLOR_MATERIAL' is
2177initially disabled.
2178
2179`GL_INVALID_ENUM' is generated if FACE or MODE is not an accepted value.
2180
2181`GL_INVALID_OPERATION' is generated if `glColorMaterial' is executed
2182between the execution of `glBegin' and the corresponding execution of
2183`glEnd'.")
8925f36f 2184
7ec693ed 2185(define-foreign-procedure
bb894c9d
AW
2186 ((glColorPointer
2187 (size GLint)
2188 (type GLenum)
2189 (stride GLsizei)
2190 (pointer *)
2191 ->
2192 void))
3c9b6116
AW
2193 "Define an array of colors.
2194
2195SIZE
2196 Specifies the number of components per color. Must be 3 or 4. The
2197 initial value is 4.
2198
2199TYPE
2200 Specifies the data type of each color component in the array.
2201 Symbolic constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
2202 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', and
2203 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
2204
2205STRIDE
2206 Specifies the byte offset between consecutive colors. If STRIDE is
2207 0, the colors are understood to be tightly packed in the array. The
2208 initial value is 0.
2209
2210POINTER
2211 Specifies a pointer to the first component of the first color
2212 element in the array. The initial value is 0.
2213
2214`glColorPointer' specifies the location and data format of an array of
2215color components to use when rendering. SIZE specifies the number of
2216components per color, and must be 3 or 4. TYPE specifies the data type
2217of each color component, and STRIDE specifies the byte stride from one
2218color to the next, allowing vertices and attributes to be packed into a
2219single array or stored in separate arrays. (Single-array storage may be
2220more efficient on some implementations; see `glInterleavedArrays'.)
2221
2222If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
2223target (see `glBindBuffer') while a color array is specified, POINTER is
2224treated as a byte offset into the buffer object's data store. Also, the
2225buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as color
2226vertex array client-side state (`GL_COLOR_ARRAY_BUFFER_BINDING').
2227
2228When a color array is specified, SIZE, TYPE, STRIDE, and POINTER are
2229saved as client-side state, in addition to the current vertex array
2230buffer object binding.
2231
2232To enable and disable the color array, call `glEnableClientState' and
2233`glDisableClientState' with the argument `GL_COLOR_ARRAY'. If enabled,
2234the color array is used when `glDrawArrays', `glMultiDrawArrays',
2235`glDrawElements', `glMultiDrawElements', `glDrawRangeElements', or
2236`glArrayElement' is called.
2237
2238`GL_INVALID_VALUE' is generated if SIZE is not 3 or 4.
2239
2240`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
2241
2242`GL_INVALID_VALUE' is generated if STRIDE is negative.")
8925f36f 2243
7ec693ed 2244(define-foreign-procedure
bb894c9d
AW
2245 ((glColorSubTable
2246 (target GLenum)
2247 (start GLsizei)
2248 (count GLsizei)
2249 (format GLenum)
2250 (type GLenum)
2251 (data *)
2252 ->
2253 void))
3c9b6116
AW
2254 "Respecify a portion of a color table.
2255
2256TARGET
2257 Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE',
2258 or `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
2259
2260START
2261 The starting index of the portion of the color table to be
2262 replaced.
2263
2264COUNT
2265 The number of table entries to replace.
2266
2267FORMAT
2268 The format of the pixel data in DATA. The allowable values are
2269 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE',
2270 `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'.
2271
2272TYPE
2273 The type of the pixel data in DATA. The allowable values are
2274 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
2275 `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2',
2276 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
2277 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
2278 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
2279 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
2280 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
2281 `GL_UNSIGNED_INT_2_10_10_10_REV'.
2282
2283DATA
2284 Pointer to a one-dimensional array of pixel data that is processed
2285 to replace the specified region of the color table.
2286
2287`glColorSubTable' is used to respecify a contiguous portion of a color
2288table previously defined using `glColorTable'. The pixels referenced by
2289DATA replace the portion of the existing table from indices START to
2290START+COUNT-1 , inclusive. This region may not include any entries
2291outside the range of the color table as it was originally specified. It
2292is not an error to specify a subtexture with width of 0, but such a
2293specification has no effect.
2294
2295If a non-zero named buffer object is bound to the
2296`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a portion of
2297a color table is respecified, DATA is treated as a byte offset into the
2298buffer object's data store.
2299
2300`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
2301values.
2302
2303`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
2304values.
2305
2306`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
2307values.
2308
2309`GL_INVALID_VALUE' is generated if START+COUNT>WIDTH .
2310
2311`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2312bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2313data store is currently mapped.
2314
2315`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2316bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2317unpacked from the buffer object such that the memory reads required
2318would exceed the data store size.
2319
2320`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2321bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
2322divisible into the number of bytes needed to store in memory a datum
2323indicated by TYPE.
2324
2325`GL_INVALID_OPERATION' is generated if `glColorSubTable' is executed
2326between the execution of `glBegin' and the corresponding execution of
2327`glEnd'.")
8925f36f 2328
7ec693ed 2329(define-foreign-procedure
bb894c9d
AW
2330 ((glColorTable
2331 (target GLenum)
2332 (internalformat GLenum)
2333 (width GLsizei)
2334 (format GLenum)
2335 (type GLenum)
2336 (data *)
2337 ->
2338 void))
3c9b6116 2339 "Define a color lookup table.
8925f36f 2340
3c9b6116
AW
2341TARGET
2342 Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE',
2343 `GL_POST_COLOR_MATRIX_COLOR_TABLE', `GL_PROXY_COLOR_TABLE',
2344 `GL_PROXY_POST_CONVOLUTION_COLOR_TABLE', or
2345 `GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE'.
8925f36f 2346
3c9b6116
AW
2347INTERNALFORMAT
2348 The internal format of the color table. The allowable values are
2349 `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
2350 `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
2351 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
2352 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
2353 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
2354 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
2355 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
2356 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
2357 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
2358 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', and `GL_RGBA16'.
8925f36f 2359
3c9b6116
AW
2360WIDTH
2361 The number of entries in the color lookup table specified by DATA.
8925f36f 2362
3c9b6116
AW
2363FORMAT
2364 The format of the pixel data in DATA. The allowable values are
2365 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE',
2366 `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'.
8925f36f 2367
3c9b6116
AW
2368TYPE
2369 The type of the pixel data in DATA. The allowable values are
2370 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
2371 `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2',
2372 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
2373 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
2374 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
2375 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
2376 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
2377 `GL_UNSIGNED_INT_2_10_10_10_REV'.
2378
2379DATA
2380 Pointer to a one-dimensional array of pixel data that is processed
2381 to build the color table.
2382
2383`glColorTable' may be used in two ways: to test the actual size and
2384color resolution of a lookup table given a particular set of parameters,
2385or to load the contents of a color lookup table. Use the targets
2386`GL_PROXY_*' for the first case and the other targets for the second
2387case.
2388
2389If a non-zero named buffer object is bound to the
2390`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a color table
2391is specified, DATA is treated as a byte offset into the buffer object's
2392data store.
2393
2394If TARGET is `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', or
2395`GL_POST_COLOR_MATRIX_COLOR_TABLE', `glColorTable' builds a color lookup
2396table from an array of pixels. The pixel array specified by WIDTH,
2397FORMAT, TYPE, and DATA is extracted from memory and processed just as if
2398`glDrawPixels' were called, but processing stops after the final
2399expansion to RGBA is completed.
2400
2401The four scale parameters and the four bias parameters that are defined
2402for the table are then used to scale and bias the R, G, B, and A
2403components of each pixel. (Use `glColorTableParameter' to set these
2404scale and bias parameters.)
2405
2406Next, the R, G, B, and A values are clamped to the range [0,1] . Each
2407pixel is then converted to the internal format specified by
2408INTERNALFORMAT. This conversion simply maps the component values of the
2409pixel (R, G, B, and A) to the values included in the internal format
2410(red, green, blue, alpha, luminance, and intensity). The mapping is as
2411follows:
2412
2413
2414
2415*Internal Format*
2416 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
2417
2418`GL_ALPHA'
2419 , , , A , ,
2420
2421`GL_LUMINANCE'
2422 , , , , R ,
2423
2424`GL_LUMINANCE_ALPHA'
2425 , , , A , R ,
2426
2427`GL_INTENSITY'
2428 , , , , , R
2429
2430`GL_RGB'
2431 R , G , B , , ,
2432
2433`GL_RGBA'
2434 R , G , B , A , ,
2435
2436Finally, the red, green, blue, alpha, luminance, and/or intensity
2437components of the resulting pixels are stored in the color table. They
2438form a one-dimensional table with indices in the range [0,WIDTH-1] .
2439
2440If TARGET is `GL_PROXY_*', `glColorTable' recomputes and stores the
2441values of the proxy color table's state variables
2442`GL_COLOR_TABLE_FORMAT', `GL_COLOR_TABLE_WIDTH',
2443`GL_COLOR_TABLE_RED_SIZE', `GL_COLOR_TABLE_GREEN_SIZE',
2444`GL_COLOR_TABLE_BLUE_SIZE', `GL_COLOR_TABLE_ALPHA_SIZE',
2445`GL_COLOR_TABLE_LUMINANCE_SIZE', and `GL_COLOR_TABLE_INTENSITY_SIZE'.
2446There is no effect on the image or state of any actual color table. If
2447the specified color table is too large to be supported, then all the
2448proxy state variables listed above are set to zero. Otherwise, the color
2449table could be supported by `glColorTable' using the corresponding
2450non-proxy target, and the proxy state variables are set as if that
2451target were being defined.
2452
2453The proxy state variables can be retrieved by calling
2454`glGetColorTableParameter' with a target of `GL_PROXY_*'. This allows
2455the application to decide if a particular `glColorTable' command would
2456succeed, and to determine what the resulting color table attributes
2457would be.
2458
2459If a color table is enabled, and its width is non-zero, then its
2460contents are used to replace a subset of the components of each RGBA
2461pixel group, based on the internal format of the table.
2462
2463Each pixel group has color components (R, G, B, A) that are in the range
2464[0.0,1.0] . The color components are rescaled to the size of the color
2465lookup table to form an index. Then a subset of the components based on
2466the internal format of the table are replaced by the table entry
2467selected by that index. If the color components and contents of the
2468table are represented as follows:
2469
2470
2471
2472*Representation*
2473 *Meaning*
2474
2475`r'
2476 Table index computed from `R'
2477
2478`g'
2479 Table index computed from `G'
2480
2481`b'
2482 Table index computed from `B'
2483
2484`a'
2485 Table index computed from `A'
2486
2487`L[i]'
2488 Luminance value at table index `i'
2489
2490`I[i]'
2491 Intensity value at table index `i'
2492
2493`R[i]'
2494 Red value at table index `i'
2495
2496`G[i]'
2497 Green value at table index `i'
2498
2499`B[i]'
2500 Blue value at table index `i'
2501
2502`A[i]'
2503 Alpha value at table index `i'
2504
2505then the result of color table lookup is as follows:
2506
2507
2508
2509**
2510 *Resulting Texture Components*
2511
2512*Table Internal Format*
2513 *R*, *G*, *B*, *A*
2514
2515`GL_ALPHA'
2516 `R', `G', `B', `A[a]'
2517
2518`GL_LUMINANCE'
2519 `L[r]', `L[g]', `L[b]', `At'
2520
2521`GL_LUMINANCE_ALPHA'
2522 `L[r]', `L[g]', `L[b]', `A[a]'
2523
2524`GL_INTENSITY'
2525 `I[r]', `I[g]', `I[b]', `I[a]'
2526
2527`GL_RGB'
2528 `R[r]', `G[g]', `B[b]', `A'
2529
2530`GL_RGBA'
2531 `R[r]', `G[g]', `B[b]', `A[a]'
2532
2533When `GL_COLOR_TABLE' is enabled, the colors resulting from the pixel
2534map operation (if it is enabled) are mapped by the color lookup table
2535before being passed to the convolution operation. The colors resulting
2536from the convolution operation are modified by the post convolution
2537color lookup table when `GL_POST_CONVOLUTION_COLOR_TABLE' is enabled.
2538These modified colors are then sent to the color matrix operation.
2539Finally, if `GL_POST_COLOR_MATRIX_COLOR_TABLE' is enabled, the colors
2540resulting from the color matrix operation are mapped by the post color
2541matrix color lookup table before being used by the histogram operation.
2542
2543
2544
2545`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
2546values.
2547
2548`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
2549allowable values.
2550
2551`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
2552values.
2553
2554`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
2555values.
2556
2557`GL_INVALID_VALUE' is generated if WIDTH is less than zero.
2558
2559`GL_TABLE_TOO_LARGE' is generated if the requested color table is too
2560large to be supported by the implementation, and TARGET is not a
2561`GL_PROXY_*' target.
2562
2563`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2564bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2565data store is currently mapped.
2566
2567`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2568bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2569unpacked from the buffer object such that the memory reads required
2570would exceed the data store size.
2571
2572`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2573bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
2574divisible into the number of bytes needed to store in memory a datum
2575indicated by TYPE.
2576
2577`GL_INVALID_OPERATION' is generated if `glColorTable' is executed
2578between the execution of `glBegin' and the corresponding execution of
2579`glEnd'.")
2580
7ec693ed 2581(define-foreign-procedure
bb894c9d
AW
2582 ((glColor3i
2583 (red GLint)
2584 (green GLint)
2585 (blue GLint)
2586 ->
2587 void)
2588 (glColor3d
2589 (red GLdouble)
2590 (green GLdouble)
2591 (blue GLdouble)
2592 ->
2593 void)
2594 (glColor3ui
2595 (red GLuint)
2596 (green GLuint)
2597 (blue GLuint)
2598 ->
2599 void)
2600 (glColor4i
2601 (red GLint)
2602 (green GLint)
2603 (blue GLint)
2604 (alpha GLint)
2605 ->
2606 void)
2607 (glColor4d
2608 (red GLdouble)
2609 (green GLdouble)
2610 (blue GLdouble)
2611 (alpha GLdouble)
2612 ->
2613 void)
2614 (glColor4ui
2615 (red GLuint)
2616 (green GLuint)
2617 (blue GLuint)
2618 (alpha GLuint)
2619 ->
2620 void))
3c9b6116
AW
2621 "Set the current color.
2622
2623RED
2624 GREEN
2625
2626 BLUE
2627
2628 Specify new red, green, and blue values for the current color.
2629
2630ALPHA
2631 Specifies a new alpha value for the current color. Included only in
2632 the four-argument `glColor4' commands.
2633
2634The GL stores both a current single-valued color index and a current
2635four-valued RGBA color. `glColor' sets a new four-valued RGBA color.
2636`glColor' has two major variants: `glColor3' and `glColor4'. `glColor3'
2637variants specify new red, green, and blue values explicitly and set the
2638current alpha value to 1.0 (full intensity) implicitly. `glColor4'
2639variants specify all four color components explicitly.
2640
2641`glColor3b', `glColor4b', `glColor3s', `glColor4s', `glColor3i', and
2642`glColor4i' take three or four signed byte, short, or long integers as
2643arguments. When *v* is appended to the name, the color commands can take
2644a pointer to an array of such values.
2645
2646Current color values are stored in floating-point format, with
2647unspecified mantissa and exponent sizes. Unsigned integer color
2648components, when specified, are linearly mapped to floating-point values
2649such that the largest representable value maps to 1.0 (full intensity),
2650and 0 maps to 0.0 (zero intensity). Signed integer color components,
2651when specified, are linearly mapped to floating-point values such that
2652the most positive representable value maps to 1.0, and the most negative
2653representable value maps to -1.0 . (Note that this mapping does not
2654convert 0 precisely to 0.0.) Floating-point values are mapped directly.
2655
2656Neither floating-point nor signed integer values are clamped to the
2657range [0,1] before the current color is updated. However, color
2658components are clamped to this range before they are interpolated or
2659written into a color buffer.")
2660
7ec693ed 2661(define-foreign-procedure
bb894c9d 2662 ((glCompileShader (shader GLuint) -> void))
3c9b6116
AW
2663 "Compiles a shader object.
2664
2665SHADER
2666 Specifies the shader object to be compiled.
2667
2668`glCompileShader' compiles the source code strings that have been stored
2669in the shader object specified by SHADER.
2670
2671The compilation status will be stored as part of the shader object's
2672state. This value will be set to `GL_TRUE' if the shader was compiled
2673without errors and is ready for use, and `GL_FALSE' otherwise. It can be
2674queried by calling `glGetShader' with arguments SHADER and
2675`GL_COMPILE_STATUS'.
2676
2677Compilation of a shader can fail for a number of reasons as specified by
2678the OpenGL Shading Language Specification. Whether or not the
2679compilation was successful, information about the compilation can be
2680obtained from the shader object's information log by calling
2681`glGetShaderInfoLog'.
2682
2683`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
2684OpenGL.
2685
2686`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
2687
2688`GL_INVALID_OPERATION' is generated if `glCompileShader' is executed
2689between the execution of `glBegin' and the corresponding execution of
2690`glEnd'.")
2691
7ec693ed 2692(define-foreign-procedure
bb894c9d
AW
2693 ((glCompressedTexImage1D
2694 (target GLenum)
2695 (level GLint)
2696 (internalformat GLenum)
2697 (width GLsizei)
2698 (border GLint)
2699 (imageSize GLsizei)
2700 (data *)
2701 ->
2702 void))
3c9b6116
AW
2703 "Specify a one-dimensional texture image in a compressed format.
2704
2705TARGET
2706 Specifies the target texture. Must be `GL_TEXTURE_1D' or
2707 `GL_PROXY_TEXTURE_1D'.
2708
2709LEVEL
2710 Specifies the level-of-detail number. Level 0 is the base image
2711 level. Level N is the Nth mipmap reduction image.
2712
2713INTERNALFORMAT
2714 Specifies the format of the compressed image data stored at address
2715 DATA.
2716
2717WIDTH
2718 Specifies the width of the texture image including the border if
2719 any. If the GL version does not support non-power-of-two sizes,
2720 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2721 implementations support texture images that are at least 64 texels
2722 wide. The height of the 1D texture image is 1.
2723
2724BORDER
2725 Specifies the width of the border. Must be either 0 or 1.
2726
2727IMAGESIZE
2728 Specifies the number of unsigned bytes of image data starting at
2729 the address specified by DATA.
2730
2731DATA
2732 Specifies a pointer to the compressed image data in memory.
2733
2734Texturing maps a portion of a specified texture image onto each
2735graphical primitive for which texturing is enabled. To enable and
2736disable one-dimensional texturing, call `glEnable' and `glDisable' with
2737argument `GL_TEXTURE_1D'.
2738
2739`glCompressedTexImage1D' loads a previously defined, and retrieved,
2740compressed one-dimensional texture image if TARGET is `GL_TEXTURE_1D'
2741(see `glTexImage1D').
2742
2743If TARGET is `GL_PROXY_TEXTURE_1D', no data is read from DATA, but all
2744of the texture image state is recalculated, checked for consistency, and
2745checked against the implementation's capabilities. If the implementation
2746cannot handle a texture of the requested texture size, it sets all of
2747the image state to 0, but does not generate an error (see `glGetError').
2748To query for an entire mipmap array, use an image array level greater
2749than or equal to 1.
2750
2751INTERNALFORMAT must be extension-specified compressed-texture format.
2752When a texture is loaded with `glTexImage1D' using a generic compressed
2753texture format (e.g., `GL_COMPRESSED_RGB') the GL selects from one of
2754its extensions supporting compressed textures. In order to load the
2755compressed texture image using `glCompressedTexImage1D', query the
2756compressed texture image's size and format using
2757`glGetTexLevelParameter'.
2758
2759If a non-zero named buffer object is bound to the
2760`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
2761image is specified, DATA is treated as a byte offset into the buffer
2762object's data store.
2763
2764`GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic
2765compressed internal formats: `GL_COMPRESSED_ALPHA',
2766`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
2767`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'.
2768
2769`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
2770format, dimensions, and contents of the specified compressed image data.
2771
2772`GL_INVALID_OPERATION' is generated if parameter combinations are not
2773supported by the specific compressed internal format as specified in the
2774specific texture compression extension.
2775
2776`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2777bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2778data store is currently mapped.
2779
2780`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2781bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2782unpacked from the buffer object such that the memory reads required
2783would exceed the data store size.
2784
2785`GL_INVALID_OPERATION' is generated if `glCompressedTexImage1D' is
2786executed between the execution of `glBegin' and the corresponding
2787execution of `glEnd'.
2788
2789Undefined results, including abnormal program termination, are generated
2790if DATA is not encoded in a manner consistent with the extension
2791specification defining the internal compression format.")
2792
7ec693ed 2793(define-foreign-procedure
bb894c9d
AW
2794 ((glCompressedTexImage2D
2795 (target GLenum)
2796 (level GLint)
2797 (internalformat GLenum)
2798 (width GLsizei)
2799 (height GLsizei)
2800 (border GLint)
2801 (imageSize GLsizei)
2802 (data *)
2803 ->
2804 void))
3c9b6116
AW
2805 "Specify a two-dimensional texture image in a compressed format.
2806
2807TARGET
2808 Specifies the target texture. Must be `GL_TEXTURE_2D',
2809 `GL_PROXY_TEXTURE_2D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
2810 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
2811 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
2812 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'.
2813
2814LEVEL
2815 Specifies the level-of-detail number. Level 0 is the base image
2816 level. Level N is the Nth mipmap reduction image.
2817
2818INTERNALFORMAT
2819 Specifies the format of the compressed image data stored at address
2820 DATA.
2821
2822WIDTH
2823 Specifies the width of the texture image including the border if
2824 any. If the GL version does not support non-power-of-two sizes,
2825 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2826 implementations support 2D texture images that are at least 64
2827 texels wide and cube-mapped texture images that are at least 16
2828 texels wide.
2829
2830HEIGHT
2831 Specifies the height of the texture image including the border if
2832 any. If the GL version does not support non-power-of-two sizes,
2833 this value must be Must be 2^N+2\u2061(BORDER,) for some integer N . All
2834 implementations support 2D texture images that are at least 64
2835 texels high and cube-mapped texture images that are at least 16
2836 texels high.
2837
2838BORDER
2839 Specifies the width of the border. Must be either 0 or 1.
2840
2841IMAGESIZE
2842 Specifies the number of unsigned bytes of image data starting at
2843 the address specified by DATA.
2844
2845DATA
2846 Specifies a pointer to the compressed image data in memory.
2847
2848Texturing maps a portion of a specified texture image onto each
2849graphical primitive for which texturing is enabled. To enable and
2850disable two-dimensional texturing, call `glEnable' and `glDisable' with
2851argument `GL_TEXTURE_2D'. To enable and disable texturing using
2852cube-mapped textures, call `glEnable' and `glDisable' with argument
2853`GL_TEXTURE_CUBE_MAP'.
2854
2855`glCompressedTexImage2D' loads a previously defined, and retrieved,
2856compressed two-dimensional texture image if TARGET is `GL_TEXTURE_2D'
2857(see `glTexImage2D').
2858
2859If TARGET is `GL_PROXY_TEXTURE_2D', no data is read from DATA, but all
2860of the texture image state is recalculated, checked for consistency, and
2861checked against the implementation's capabilities. If the implementation
2862cannot handle a texture of the requested texture size, it sets all of
2863the image state to 0, but does not generate an error (see `glGetError').
2864To query for an entire mipmap array, use an image array level greater
2865than or equal to 1.
2866
2867INTERNALFORMAT must be an extension-specified compressed-texture format.
2868When a texture is loaded with `glTexImage2D' using a generic compressed
2869texture format (e.g., `GL_COMPRESSED_RGB'), the GL selects from one of
2870its extensions supporting compressed textures. In order to load the
2871compressed texture image using `glCompressedTexImage2D', query the
2872compressed texture image's size and format using
2873`glGetTexLevelParameter'.
2874
2875If a non-zero named buffer object is bound to the
2876`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
2877image is specified, DATA is treated as a byte offset into the buffer
2878object's data store.
2879
2880`GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic
2881compressed internal formats: `GL_COMPRESSED_ALPHA',
2882`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
2883`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'.
2884
2885`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
2886format, dimensions, and contents of the specified compressed image data.
2887
2888`GL_INVALID_OPERATION' is generated if parameter combinations are not
2889supported by the specific compressed internal format as specified in the
2890specific texture compression extension.
2891
2892`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2893bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2894data store is currently mapped.
2895
2896`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2897bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2898unpacked from the buffer object such that the memory reads required
2899would exceed the data store size.
2900
2901`GL_INVALID_OPERATION' is generated if `glCompressedTexImage2D' is
2902executed between the execution of `glBegin' and the corresponding
2903execution of `glEnd'.
2904
2905Undefined results, including abnormal program termination, are generated
2906if DATA is not encoded in a manner consistent with the extension
2907specification defining the internal compression format.")
2908
7ec693ed 2909(define-foreign-procedure
bb894c9d
AW
2910 ((glCompressedTexImage3D
2911 (target GLenum)
2912 (level GLint)
2913 (internalformat GLenum)
2914 (width GLsizei)
2915 (height GLsizei)
2916 (depth GLsizei)
2917 (border GLint)
2918 (imageSize GLsizei)
2919 (data *)
2920 ->
2921 void))
3c9b6116
AW
2922 "Specify a three-dimensional texture image in a compressed format.
2923
2924TARGET
2925 Specifies the target texture. Must be `GL_TEXTURE_3D' or
2926 `GL_PROXY_TEXTURE_3D'.
2927
2928LEVEL
2929 Specifies the level-of-detail number. Level 0 is the base image
2930 level. Level N is the Nth mipmap reduction image.
2931
2932INTERNALFORMAT
2933 Specifies the format of the compressed image data stored at address
2934 DATA.
2935
2936WIDTH
2937 Specifies the width of the texture image including the border if
2938 any. If the GL version does not support non-power-of-two sizes,
2939 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2940 implementations support 3D texture images that are at least 16
2941 texels wide.
2942
2943HEIGHT
2944 Specifies the height of the texture image including the border if
2945 any. If the GL version does not support non-power-of-two sizes,
2946 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2947 implementations support 3D texture images that are at least 16
2948 texels high.
2949
2950DEPTH
2951 Specifies the depth of the texture image including the border if
2952 any. If the GL version does not support non-power-of-two sizes,
2953 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2954 implementations support 3D texture images that are at least 16
2955 texels deep.
2956
2957BORDER
2958 Specifies the width of the border. Must be either 0 or 1.
2959
2960IMAGESIZE
2961 Specifies the number of unsigned bytes of image data starting at
2962 the address specified by DATA.
2963
2964DATA
2965 Specifies a pointer to the compressed image data in memory.
2966
2967Texturing maps a portion of a specified texture image onto each
2968graphical primitive for which texturing is enabled. To enable and
2969disable three-dimensional texturing, call `glEnable' and `glDisable'
2970with argument `GL_TEXTURE_3D'.
2971
2972`glCompressedTexImage3D' loads a previously defined, and retrieved,
2973compressed three-dimensional texture image if TARGET is `GL_TEXTURE_3D'
2974(see `glTexImage3D').
2975
2976If TARGET is `GL_PROXY_TEXTURE_3D', no data is read from DATA, but all
2977of the texture image state is recalculated, checked for consistency, and
2978checked against the implementation's capabilities. If the implementation
2979cannot handle a texture of the requested texture size, it sets all of
2980the image state to 0, but does not generate an error (see `glGetError').
2981To query for an entire mipmap array, use an image array level greater
2982than or equal to 1.
2983
2984INTERNALFORMAT must be an extension-specified compressed-texture format.
2985When a texture is loaded with `glTexImage2D' using a generic compressed
2986texture format (e.g., `GL_COMPRESSED_RGB'), the GL selects from one of
2987its extensions supporting compressed textures. In order to load the
2988compressed texture image using `glCompressedTexImage3D', query the
2989compressed texture image's size and format using
2990`glGetTexLevelParameter'.
2991
2992If a non-zero named buffer object is bound to the
2993`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
2994image is specified, DATA is treated as a byte offset into the buffer
2995object's data store.
2996
2997`GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic
2998compressed internal formats: `GL_COMPRESSED_ALPHA',
2999`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3000`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'.
3001
3002`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3003format, dimensions, and contents of the specified compressed image data.
3004
3005`GL_INVALID_OPERATION' is generated if parameter combinations are not
3006supported by the specific compressed internal format as specified in the
3007specific texture compression extension.
3008
3009`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3010bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3011data store is currently mapped.
3012
3013`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3014bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3015unpacked from the buffer object such that the memory reads required
3016would exceed the data store size.
3017
3018`GL_INVALID_OPERATION' is generated if `glCompressedTexImage3D' is
3019executed between the execution of `glBegin' and the corresponding
3020execution of `glEnd'.
3021
3022Undefined results, including abnormal program termination, are generated
3023if DATA is not encoded in a manner consistent with the extension
3024specification defining the internal compression format.")
8925f36f 3025
7ec693ed 3026(define-foreign-procedure
bb894c9d
AW
3027 ((glCompressedTexSubImage1D
3028 (target GLenum)
3029 (level GLint)
3030 (xoffset GLint)
3031 (width GLsizei)
3032 (format GLenum)
3033 (imageSize GLsizei)
3034 (data *)
3035 ->
3036 void))
3c9b6116
AW
3037 "Specify a one-dimensional texture subimage in a compressed format.
3038
3039TARGET
3040 Specifies the target texture. Must be `GL_TEXTURE_1D'.
3041
3042LEVEL
3043 Specifies the level-of-detail number. Level 0 is the base image
3044 level. Level N is the Nth mipmap reduction image.
3045
3046XOFFSET
3047 Specifies a texel offset in the x direction within the texture
3048 array.
3049
3050WIDTH
3051 Specifies the width of the texture subimage.
3052
3053FORMAT
3054 Specifies the format of the compressed image data stored at address
3055 DATA.
3056
3057IMAGESIZE
3058 Specifies the number of unsigned bytes of image data starting at
3059 the address specified by DATA.
3060
3061DATA
3062 Specifies a pointer to the compressed image data in memory.
3063
3064Texturing maps a portion of a specified texture image onto each
3065graphical primitive for which texturing is enabled. To enable and
3066disable one-dimensional texturing, call `glEnable' and `glDisable' with
3067argument `GL_TEXTURE_1D'.
3068
3069`glCompressedTexSubImage1D' redefines a contiguous subregion of an
3070existing one-dimensional texture image. The texels referenced by DATA
3071replace the portion of the existing texture array with x indices XOFFSET
3072and XOFFSET+WIDTH-1 , inclusive. This region may not include any texels
3073outside the range of the texture array as it was originally specified.
3074It is not an error to specify a subtexture with width of 0, but such a
3075specification has no effect.
3076
3077FORMAT must be an extension-specified compressed-texture format. The
3078FORMAT of the compressed texture image is selected by the GL
3079implementation that compressed it (see `glTexImage1D'), and should be
3080queried at the time the texture was compressed with
3081`glGetTexLevelParameter'.
3082
3083If a non-zero named buffer object is bound to the
3084`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3085image is specified, DATA is treated as a byte offset into the buffer
3086object's data store.
3087
3088`GL_INVALID_ENUM' is generated if FORMAT is one of these generic
3089compressed internal formats: `GL_COMPRESSED_ALPHA',
3090`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3091`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA',
3092`GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA',
3093`GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or
3094`GL_COMPRESSED_SRGB_ALPHA'.
3095
3096`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3097format, dimensions, and contents of the specified compressed image data.
3098
3099`GL_INVALID_OPERATION' is generated if parameter combinations are not
3100supported by the specific compressed internal format as specified in the
3101specific texture compression extension.
3102
3103`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3104bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3105data store is currently mapped.
3106
3107`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3108bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3109unpacked from the buffer object such that the memory reads required
3110would exceed the data store size.
3111
3112`GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage1D' is
3113executed between the execution of `glBegin' and the corresponding
3114execution of `glEnd'.
3115
3116Undefined results, including abnormal program termination, are generated
3117if DATA is not encoded in a manner consistent with the extension
3118specification defining the internal compression format.")
8925f36f 3119
7ec693ed 3120(define-foreign-procedure
bb894c9d
AW
3121 ((glCompressedTexSubImage2D
3122 (target GLenum)
3123 (level GLint)
3124 (xoffset GLint)
3125 (yoffset GLint)
3126 (width GLsizei)
3127 (height GLsizei)
3128 (format GLenum)
3129 (imageSize GLsizei)
3130 (data *)
3131 ->
3132 void))
3c9b6116
AW
3133 "Specify a two-dimensional texture subimage in a compressed format.
3134
3135TARGET
3136 Specifies the target texture. Must be `GL_TEXTURE_2D',
3137 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
3138 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
3139 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
3140 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
3141
3142LEVEL
3143 Specifies the level-of-detail number. Level 0 is the base image
3144 level. Level N is the Nth mipmap reduction image.
3145
3146XOFFSET
3147 Specifies a texel offset in the x direction within the texture
3148 array.
3149
3150YOFFSET
3151 Specifies a texel offset in the y direction within the texture
3152 array.
3153
3154WIDTH
3155 Specifies the width of the texture subimage.
3156
3157HEIGHT
3158 Specifies the height of the texture subimage.
3159
3160FORMAT
3161 Specifies the format of the compressed image data stored at address
3162 DATA.
3163
3164IMAGESIZE
3165 Specifies the number of unsigned bytes of image data starting at
3166 the address specified by DATA.
3167
3168DATA
3169 Specifies a pointer to the compressed image data in memory.
3170
3171Texturing maps a portion of a specified texture image onto each
3172graphical primitive for which texturing is enabled. To enable and
3173disable two-dimensional texturing, call `glEnable' and `glDisable' with
3174argument `GL_TEXTURE_2D'. To enable and disable texturing using
3175cube-mapped texture, call `glEnable' and `glDisable' with argument
3176`GL_TEXTURE_CUBE_MAP'.
3177
3178`glCompressedTexSubImage2D' redefines a contiguous subregion of an
3179existing two-dimensional texture image. The texels referenced by DATA
3180replace the portion of the existing texture array with x indices XOFFSET
3181and XOFFSET+WIDTH-1 , and the y indices YOFFSET and YOFFSET+HEIGHT-1 ,
3182inclusive. This region may not include any texels outside the range of
3183the texture array as it was originally specified. It is not an error to
3184specify a subtexture with width of 0, but such a specification has no
3185effect.
3186
3187FORMAT must be an extension-specified compressed-texture format. The
3188FORMAT of the compressed texture image is selected by the GL
3189implementation that compressed it (see `glTexImage2D') and should be
3190queried at the time the texture was compressed with
3191`glGetTexLevelParameter'.
3192
3193If a non-zero named buffer object is bound to the
3194`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3195image is specified, DATA is treated as a byte offset into the buffer
3196object's data store.
3197
3198`GL_INVALID_ENUM' is generated if FORMAT is one of these generic
3199compressed internal formats: `GL_COMPRESSED_ALPHA',
3200`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3201`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA',
3202`GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA',
3203`GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or
3204`GL_COMPRESSED_SRGB_ALPHA'.
3205
3206`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3207format, dimensions, and contents of the specified compressed image data.
3208
3209`GL_INVALID_OPERATION' is generated if parameter combinations are not
3210supported by the specific compressed internal format as specified in the
3211specific texture compression extension.
3212
3213`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3214bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3215data store is currently mapped.
3216
3217`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3218bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3219unpacked from the buffer object such that the memory reads required
3220would exceed the data store size.
3221
3222`GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage2D' is
3223executed between the execution of `glBegin' and the corresponding
3224execution of `glEnd'.
3225
3226Undefined results, including abnormal program termination, are generated
3227if DATA is not encoded in a manner consistent with the extension
3228specification defining the internal compression format.")
8925f36f 3229
7ec693ed 3230(define-foreign-procedure
bb894c9d
AW
3231 ((glCompressedTexSubImage3D
3232 (target GLenum)
3233 (level GLint)
3234 (xoffset GLint)
3235 (yoffset GLint)
3236 (zoffset GLint)
3237 (width GLsizei)
3238 (height GLsizei)
3239 (depth GLsizei)
3240 (format GLenum)
3241 (imageSize GLsizei)
3242 (data *)
3243 ->
3244 void))
3c9b6116
AW
3245 "Specify a three-dimensional texture subimage in a compressed format.
3246
3247TARGET
3248 Specifies the target texture. Must be `GL_TEXTURE_3D'.
3249
3250LEVEL
3251 Specifies the level-of-detail number. Level 0 is the base image
3252 level. Level N is the Nth mipmap reduction image.
3253
3254XOFFSET
3255 Specifies a texel offset in the x direction within the texture
3256 array.
3257
3258YOFFSET
3259 Specifies a texel offset in the y direction within the texture
3260 array.
3261
3262WIDTH
3263 Specifies the width of the texture subimage.
3264
3265HEIGHT
3266 Specifies the height of the texture subimage.
3267
3268DEPTH
3269 Specifies the depth of the texture subimage.
3270
3271FORMAT
3272 Specifies the format of the compressed image data stored at address
3273 DATA.
3274
3275IMAGESIZE
3276 Specifies the number of unsigned bytes of image data starting at
3277 the address specified by DATA.
3278
3279DATA
3280 Specifies a pointer to the compressed image data in memory.
3281
3282Texturing maps a portion of a specified texture image onto each
3283graphical primitive for which texturing is enabled. To enable and
3284disable three-dimensional texturing, call `glEnable' and `glDisable'
3285with argument `GL_TEXTURE_3D'.
3286
3287`glCompressedTexSubImage3D' redefines a contiguous subregion of an
3288existing three-dimensional texture image. The texels referenced by DATA
3289replace the portion of the existing texture array with x indices XOFFSET
3290and XOFFSET+WIDTH-1 , and the y indices YOFFSET and YOFFSET+HEIGHT-1 ,
3291and the z indices ZOFFSET and ZOFFSET+DEPTH-1 , inclusive. This region
3292may not include any texels outside the range of the texture array as it
3293was originally specified. It is not an error to specify a subtexture
3294with width of 0, but such a specification has no effect.
3295
3296FORMAT must be an extension-specified compressed-texture format. The
3297FORMAT of the compressed texture image is selected by the GL
3298implementation that compressed it (see `glTexImage3D') and should be
3299queried at the time the texture was compressed with
3300`glGetTexLevelParameter'.
3301
3302If a non-zero named buffer object is bound to the
3303`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3304image is specified, DATA is treated as a byte offset into the buffer
3305object's data store.
3306
3307`GL_INVALID_ENUM' is generated if FORMAT is one of these generic
3308compressed internal formats: `GL_COMPRESSED_ALPHA',
3309`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3310`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA',
3311`GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA',
3312`GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or
3313`GL_COMPRESSED_SRGB_ALPHA'.
3314
3315`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3316format, dimensions, and contents of the specified compressed image data.
3317
3318`GL_INVALID_OPERATION' is generated if parameter combinations are not
3319supported by the specific compressed internal format as specified in the
3320specific texture compression extension.
3321
3322`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3323bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3324data store is currently mapped.
3325
3326`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3327bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3328unpacked from the buffer object such that the memory reads required
3329would exceed the data store size.
3330
3331`GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage3D' is
3332executed between the execution of `glBegin' and the corresponding
3333execution of `glEnd'.
3334
3335Undefined results, including abnormal program termination, are generated
3336if DATA is not encoded in a manner consistent with the extension
3337specification defining the internal compression format.")
8925f36f 3338
7ec693ed 3339(define-foreign-procedure
bb894c9d
AW
3340 ((glConvolutionFilter1D
3341 (target GLenum)
3342 (internalformat GLenum)
3343 (width GLsizei)
3344 (format GLenum)
3345 (type GLenum)
3346 (data *)
3347 ->
3348 void))
3c9b6116 3349 "Define a one-dimensional convolution filter.
8925f36f 3350
3c9b6116
AW
3351TARGET
3352 Must be `GL_CONVOLUTION_1D'.
3353
3354INTERNALFORMAT
3355 The internal format of the convolution filter kernel. The allowable
3356 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
3357 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
3358 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
3359 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
3360 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
3361 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
3362 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
3363 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
3364 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
3365 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
3366 `GL_RGBA12', or `GL_RGBA16'.
3367
3368WIDTH
3369 The width of the pixel array referenced by DATA.
3370
3371FORMAT
3372 The format of the pixel data in DATA. The allowable values are
3373 `GL_ALPHA', `GL_LUMINANCE', `GL_LUMINANCE_ALPHA', `GL_INTENSITY',
3374 `GL_RGB', and `GL_RGBA'.
3375
3376TYPE
3377 The type of the pixel data in DATA. Symbolic constants
3378 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
3379 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
3380 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3381 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
3382 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3383 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3384 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3385 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
3386 are accepted.
3387
3388DATA
3389 Pointer to a one-dimensional array of pixel data that is processed
3390 to build the convolution filter kernel.
3391
3392`glConvolutionFilter1D' builds a one-dimensional convolution filter
3393kernel from an array of pixels.
3394
3395The pixel array specified by WIDTH, FORMAT, TYPE, and DATA is extracted
3396from memory and processed just as if `glDrawPixels' were called, but
3397processing stops after the final expansion to RGBA is completed.
3398
3399If a non-zero named buffer object is bound to the
3400`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution
3401filter is specified, DATA is treated as a byte offset into the buffer
3402object's data store.
3403
3404The R, G, B, and A components of each pixel are next scaled by the four
34051D `GL_CONVOLUTION_FILTER_SCALE' parameters and biased by the four 1D
3406`GL_CONVOLUTION_FILTER_BIAS' parameters. (The scale and bias parameters
3407are set by `glConvolutionParameter' using the `GL_CONVOLUTION_1D' target
3408and the names `GL_CONVOLUTION_FILTER_SCALE' and
3409`GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors of
3410four values that are applied to red, green, blue, and alpha, in that
3411order.) The R, G, B, and A values are not clamped to [0,1] at any time
3412during this process.
3413
3414Each pixel is then converted to the internal format specified by
3415INTERNALFORMAT. This conversion simply maps the component values of the
3416pixel (R, G, B, and A) to the values included in the internal format
3417(red, green, blue, alpha, luminance, and intensity). The mapping is as
3418follows:
3419
3420
3421
3422*Internal Format*
3423 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3424
3425`GL_ALPHA'
3426 , , , A , ,
3427
3428`GL_LUMINANCE'
3429 , , , , R ,
3430
3431`GL_LUMINANCE_ALPHA'
3432 , , , A , R ,
3433
3434`GL_INTENSITY'
3435 , , , , , R
3436
3437`GL_RGB'
3438 R , G , B , , ,
3439
3440`GL_RGBA'
3441 R , G , B , A , ,
3442
3443The red, green, blue, alpha, luminance, and/or intensity components of
3444the resulting pixels are stored in floating-point rather than integer
3445format. They form a one-dimensional filter kernel image indexed with
3446coordinate I such that I starts at 0 and increases from left to right.
3447Kernel location I is derived from the Ith pixel, counting from 0.
3448
3449Note that after a convolution is performed, the resulting color
3450components are also scaled by their corresponding
3451`GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
3452corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
3453the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
3454set by `glPixelTransfer'.
3455
3456`GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_1D'.
3457
3458`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
3459allowable values.
3460
3461`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
3462values.
3463
3464`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
3465values.
3466
3467`GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
3468than the maximum supported value. This value may be queried with
3469`glGetConvolutionParameter' using target `GL_CONVOLUTION_1D' and name
3470`GL_MAX_CONVOLUTION_WIDTH'.
3471
3472`GL_INVALID_OPERATION' is generated if FORMAT is one of
3473`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3474`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and TYPE is
3475not `GL_RGB'.
3476
3477`GL_INVALID_OPERATION' is generated if FORMAT is one of
3478`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3479`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3480`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3481`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
3482TYPE is neither `GL_RGBA' nor `GL_BGRA'.
3483
3484`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3485bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3486data store is currently mapped.
3487
3488`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3489bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3490unpacked from the buffer object such that the memory reads required
3491would exceed the data store size.
3492
3493`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3494bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
3495divisible into the number of bytes needed to store in memory a datum
3496indicated by TYPE.
3497
3498`GL_INVALID_OPERATION' is generated if `glConvolutionFilter1D' is
3499executed between the execution of `glBegin' and the corresponding
3500execution of `glEnd'.")
3501
7ec693ed 3502(define-foreign-procedure
bb894c9d
AW
3503 ((glConvolutionFilter2D
3504 (target GLenum)
3505 (internalformat GLenum)
3506 (width GLsizei)
3507 (height GLsizei)
3508 (format GLenum)
3509 (type GLenum)
3510 (data *)
3511 ->
3512 void))
3c9b6116
AW
3513 "Define a two-dimensional convolution filter.
3514
3515TARGET
3516 Must be `GL_CONVOLUTION_2D'.
3517
3518INTERNALFORMAT
3519 The internal format of the convolution filter kernel. The allowable
3520 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
3521 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
3522 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
3523 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
3524 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
3525 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
3526 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
3527 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
3528 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
3529 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
3530 `GL_RGBA12', or `GL_RGBA16'.
3531
3532WIDTH
3533 The width of the pixel array referenced by DATA.
3534
3535HEIGHT
3536 The height of the pixel array referenced by DATA.
3537
3538FORMAT
3539 The format of the pixel data in DATA. The allowable values are
3540 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR',
3541 `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
3542
3543TYPE
3544 The type of the pixel data in DATA. Symbolic constants
3545 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
3546 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
3547 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3548 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
3549 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3550 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3551 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3552 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
3553 are accepted.
3554
3555DATA
3556 Pointer to a two-dimensional array of pixel data that is processed
3557 to build the convolution filter kernel.
3558
3559`glConvolutionFilter2D' builds a two-dimensional convolution filter
3560kernel from an array of pixels.
3561
3562The pixel array specified by WIDTH, HEIGHT, FORMAT, TYPE, and DATA is
3563extracted from memory and processed just as if `glDrawPixels' were
3564called, but processing stops after the final expansion to RGBA is
3565completed.
3566
3567If a non-zero named buffer object is bound to the
3568`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution
3569filter is specified, DATA is treated as a byte offset into the buffer
3570object's data store.
3571
8925f36f 3572The R, G, B, and A components of each pixel are next scaled by the four
3c9b6116
AW
35732D `GL_CONVOLUTION_FILTER_SCALE' parameters and biased by the four 2D
3574`GL_CONVOLUTION_FILTER_BIAS' parameters. (The scale and bias parameters
3575are set by `glConvolutionParameter' using the `GL_CONVOLUTION_2D' target
3576and the names `GL_CONVOLUTION_FILTER_SCALE' and
3577`GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors of
3578four values that are applied to red, green, blue, and alpha, in that
3579order.) The R, G, B, and A values are not clamped to [0,1] at any time
3580during this process.
3581
3582Each pixel is then converted to the internal format specified by
3583INTERNALFORMAT. This conversion simply maps the component values of the
3584pixel (R, G, B, and A) to the values included in the internal format
3585(red, green, blue, alpha, luminance, and intensity). The mapping is as
3586follows:
3587
3588
3589
3590*Internal Format*
3591 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3592
3593`GL_ALPHA'
3594 , , , A , ,
3595
3596`GL_LUMINANCE'
3597 , , , , R ,
3598
3599`GL_LUMINANCE_ALPHA'
3600 , , , A , R ,
3601
3602`GL_INTENSITY'
3603 , , , , , R
3604
3605`GL_RGB'
3606 R , G , B , , ,
3607
3608`GL_RGBA'
3609 R , G , B , A , ,
3610
8925f36f 3611The red, green, blue, alpha, luminance, and/or intensity components of
3c9b6116
AW
3612the resulting pixels are stored in floating-point rather than integer
3613format. They form a two-dimensional filter kernel image indexed with
3614coordinates I and J such that I starts at zero and increases from left
3615to right, and J starts at zero and increases from bottom to top. Kernel
3616location I,J is derived from the Nth pixel, where N is I+J*WIDTH.
3617
8925f36f 3618Note that after a convolution is performed, the resulting color
3c9b6116
AW
3619components are also scaled by their corresponding
3620`GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
3621corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
3622the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
3623set by `glPixelTransfer'.
3624
3625`GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_2D'.
3626
3627`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
3628allowable values.
3629
3630`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
3631values.
3632
3633`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
3634values.
3635
3636`GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
3637than the maximum supported value. This value may be queried with
3638`glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
3639`GL_MAX_CONVOLUTION_WIDTH'.
3640
3641`GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater
3642than the maximum supported value. This value may be queried with
3643`glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
3644`GL_MAX_CONVOLUTION_HEIGHT'.
3645
3646`GL_INVALID_OPERATION' is generated if HEIGHT is one of
3647`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3648`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
3649is not `GL_RGB'.
3650
3651`GL_INVALID_OPERATION' is generated if HEIGHT is one of
3652`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3653`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3654`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3655`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
3656FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
3657
3658`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3659bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3660data store is currently mapped.
3661
3662`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3663bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3664unpacked from the buffer object such that the memory reads required
3665would exceed the data store size.
3666
3667`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3668bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
3669divisible into the number of bytes needed to store in memory a datum
3670indicated by TYPE.
3671
3672`GL_INVALID_OPERATION' is generated if `glConvolutionFilter2D' is
3673executed between the execution of `glBegin' and the corresponding
3674execution of `glEnd'.")
8925f36f 3675
7ec693ed 3676(define-foreign-procedure
bb894c9d
AW
3677 ((glConvolutionParameterf
3678 (target GLenum)
3679 (pname GLenum)
3680 (params GLfloat)
3681 ->
3682 void)
3683 (glConvolutionParameteri
3684 (target GLenum)
3685 (pname GLenum)
3686 (params GLint)
3687 ->
3688 void))
3c9b6116
AW
3689 "Set convolution parameters.
3690
3691TARGET
3692 The target for the convolution parameter. Must be one of
3693 `GL_CONVOLUTION_1D', `GL_CONVOLUTION_2D', or `GL_SEPARABLE_2D'.
3694
3695PNAME
3696 The parameter to be set. Must be `GL_CONVOLUTION_BORDER_MODE'.
3697
3698PARAMS
3699 The parameter value. Must be one of `GL_REDUCE',
3700 `GL_CONSTANT_BORDER', `GL_REPLICATE_BORDER'.
3701
3702
3703
3704`glConvolutionParameter' sets the value of a convolution parameter.
3705
3706TARGET selects the convolution filter to be affected:
3707`GL_CONVOLUTION_1D', `GL_CONVOLUTION_2D', or `GL_SEPARABLE_2D' for the
37081D, 2D, or separable 2D filter, respectively.
3709
3710PNAME selects the parameter to be changed. `GL_CONVOLUTION_FILTER_SCALE'
3711and `GL_CONVOLUTION_FILTER_BIAS' affect the definition of the
3712convolution filter kernel; see `glConvolutionFilter1D',
3713`glConvolutionFilter2D', and `glSeparableFilter2D' for details. In these
3714cases, PARAMSv is an array of four values to be applied to red, green,
3715blue, and alpha values, respectively. The initial value for
3716`GL_CONVOLUTION_FILTER_SCALE' is (1, 1, 1, 1), and the initial value for
3717`GL_CONVOLUTION_FILTER_BIAS' is (0, 0, 0, 0).
3718
3719A PNAME value of `GL_CONVOLUTION_BORDER_MODE' controls the convolution
3720border mode. The accepted modes are:
3721
3722`GL_REDUCE'
3723 The image resulting from convolution is smaller than the source
3724 image. If the filter width is WF and height is HF , and the source
3725 image width is WS and height is HS , then the convolved image width
3726 will be WS-WF+1 and height will be HS-HF+1 . (If this reduction
3727 would generate an image with zero or negative width and/or height,
3728 the output is simply null, with no error generated.) The
3729 coordinates of the image resulting from convolution are zero
3730 through WS-WF in width and zero through HS-HF in height.
3731
3732`GL_CONSTANT_BORDER'
3733 The image resulting from convolution is the same size as the source
3734 image, and processed as if the source image were surrounded by
3735 pixels with their color specified by the
3736 `GL_CONVOLUTION_BORDER_COLOR'.
3737
3738`GL_REPLICATE_BORDER'
3739 The image resulting from convolution is the same size as the source
3740 image, and processed as if the outermost pixel on the border of the
3741 source image were replicated.
3742
3743`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
3744values.
3745
3746`GL_INVALID_ENUM' is generated if PNAME is not one of the allowable
3747values.
3748
3749`GL_INVALID_ENUM' is generated if PNAME is `GL_CONVOLUTION_BORDER_MODE'
3750and PARAMS is not one of `GL_REDUCE', `GL_CONSTANT_BORDER', or
3751`GL_REPLICATE_BORDER'.
3752
3753`GL_INVALID_OPERATION' is generated if `glConvolutionParameter' is
3754executed between the execution of `glBegin' and the corresponding
3755execution of `glEnd'.")
8925f36f 3756
7ec693ed 3757(define-foreign-procedure
bb894c9d
AW
3758 ((glCopyColorSubTable
3759 (target GLenum)
3760 (start GLsizei)
3761 (x GLint)
3762 (y GLint)
3763 (width GLsizei)
3764 ->
3765 void))
3c9b6116
AW
3766 "Respecify a portion of a color table.
3767
3768TARGET
3769 Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE',
3770 or `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
3771
3772START
3773 The starting index of the portion of the color table to be
3774 replaced.
3775
3776X
3777 Y
3778
3779 The window coordinates of the left corner of the row of pixels to
3780 be copied.
3781
3782WIDTH
3783 The number of table entries to replace.
3784
3785`glCopyColorSubTable' is used to respecify a contiguous portion of a
3786color table previously defined using `glColorTable'. The pixels copied
3787from the framebuffer replace the portion of the existing table from
3788indices START to START+X-1 , inclusive. This region may not include any
3789entries outside the range of the color table, as was originally
3790specified. It is not an error to specify a subtexture with width of 0,
3791but such a specification has no effect.
3792
3793`GL_INVALID_VALUE' is generated if TARGET is not a previously defined
3794color table.
3795
3796`GL_INVALID_VALUE' is generated if TARGET is not one of the allowable
3797values.
3798
3799`GL_INVALID_VALUE' is generated if START+X>WIDTH .
3800
3801`GL_INVALID_OPERATION' is generated if `glCopyColorSubTable' is executed
3802between the execution of `glBegin' and the corresponding execution of
3803`glEnd'.")
8925f36f 3804
7ec693ed 3805(define-foreign-procedure
bb894c9d
AW
3806 ((glCopyColorTable
3807 (target GLenum)
3808 (internalformat GLenum)
3809 (x GLint)
3810 (y GLint)
3811 (width GLsizei)
3812 ->
3813 void))
3c9b6116
AW
3814 "Copy pixels into a color table.
3815
3816TARGET
3817 The color table target. Must be `GL_COLOR_TABLE',
3818 `GL_POST_CONVOLUTION_COLOR_TABLE', or
3819 `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
3820
3821INTERNALFORMAT
3822 The internal storage format of the texture image. Must be one of
3823 the following symbolic constants: `GL_ALPHA', `GL_ALPHA4',
3824 `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16', `GL_LUMINANCE',
3825 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
3826 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
3827 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
3828 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
3829 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
3830 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
3831 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
3832 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
3833 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'.
3834
3835X
3836 The x coordinate of the lower-left corner of the pixel rectangle to
3837 be transferred to the color table.
3838
3839Y
3840 The y coordinate of the lower-left corner of the pixel rectangle to
3841 be transferred to the color table.
3842
3843WIDTH
3844 The width of the pixel rectangle.
3845
3846`glCopyColorTable' loads a color table with pixels from the current
3847`GL_READ_BUFFER' (rather than from main memory, as is the case for
3848`glColorTable').
3849
3850The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y)
3851having width WIDTH and height 1 is loaded into the color table. If any
3852pixels within this region are outside the window that is associated with
3853the GL context, the values obtained for those pixels are undefined.
3854
3855The pixels in the rectangle are processed just as if `glReadPixels' were
3856called, with INTERNALFORMAT set to RGBA, but processing stops after the
3857final conversion to RGBA.
3858
8925f36f 3859The four scale parameters and the four bias parameters that are defined
3c9b6116
AW
3860for the table are then used to scale and bias the R, G, B, and A
3861components of each pixel. The scale and bias parameters are set by
3862calling `glColorTableParameter'.
3863
3864Next, the R, G, B, and A values are clamped to the range [0,1] . Each
3865pixel is then converted to the internal format specified by
3866INTERNALFORMAT. This conversion simply maps the component values of the
3867pixel (R, G, B, and A) to the values included in the internal format
3868(red, green, blue, alpha, luminance, and intensity). The mapping is as
3869follows:
3870
3871
3872
3873*Internal Format*
3874 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3875
3876`GL_ALPHA'
3877 , , , A , ,
3878
3879`GL_LUMINANCE'
3880 , , , , R ,
3881
3882`GL_LUMINANCE_ALPHA'
3883 , , , A , R ,
3884
3885`GL_INTENSITY'
3886 , , , , , R
3887
3888`GL_RGB'
3889 R , G , B , , ,
3890
3891`GL_RGBA'
3892 R , G , B , A , ,
3893
3894Finally, the red, green, blue, alpha, luminance, and/or intensity
3895components of the resulting pixels are stored in the color table. They
3896form a one-dimensional table with indices in the range [0,WIDTH-1] .
3897
3898
3899
3900`GL_INVALID_ENUM' is generated when TARGET is not one of the allowable
3901values.
3902
3903`GL_INVALID_VALUE' is generated if WIDTH is less than zero.
3904
3905`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not one of the
3906allowable values.
3907
3908`GL_TABLE_TOO_LARGE' is generated if the requested color table is too
3909large to be supported by the implementation.
3910
3911`GL_INVALID_OPERATION' is generated if `glCopyColorTable' is executed
3912between the execution of `glBegin' and the corresponding execution of
3913`glEnd'.")
8925f36f 3914
7ec693ed 3915(define-foreign-procedure
bb894c9d
AW
3916 ((glCopyConvolutionFilter1D
3917 (target GLenum)
3918 (internalformat GLenum)
3919 (x GLint)
3920 (y GLint)
3921 (width GLsizei)
3922 ->
3923 void))
3c9b6116
AW
3924 "Copy pixels into a one-dimensional convolution filter.
3925
3926TARGET
3927 Must be `GL_CONVOLUTION_1D'.
3928
3929INTERNALFORMAT
3930 The internal format of the convolution filter kernel. The allowable
3931 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
3932 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
3933 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
3934 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
3935 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
3936 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
3937 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
3938 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
3939 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
3940 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
3941 `GL_RGBA12', or `GL_RGBA16'.
3942
3943X
3944 Y
3945
3946 The window space coordinates of the lower-left coordinate of the
3947 pixel array to copy.
3948
3949WIDTH
3950 The width of the pixel array to copy.
3951
3952`glCopyConvolutionFilter1D' defines a one-dimensional convolution filter
3953kernel with pixels from the current `GL_READ_BUFFER' (rather than from
3954main memory, as is the case for `glConvolutionFilter1D').
3955
3956The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y),
3957width WIDTH and height 1 is used to define the convolution filter. If
3958any pixels within this region are outside the window that is associated
3959with the GL context, the values obtained for those pixels are undefined.
3960
3961The pixels in the rectangle are processed exactly as if `glReadPixels'
3962had been called with FORMAT set to RGBA, but the process stops just
3963before final conversion. The R, G, B, and A components of each pixel are
3964next scaled by the four 1D `GL_CONVOLUTION_FILTER_SCALE' parameters and
3965biased by the four 1D `GL_CONVOLUTION_FILTER_BIAS' parameters. (The
3966scale and bias parameters are set by `glConvolutionParameter' using the
3967`GL_CONVOLUTION_1D' target and the names `GL_CONVOLUTION_FILTER_SCALE'
3968and `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors
3969of four values that are applied to red, green, blue, and alpha, in that
3970order.) The R, G, B, and A values are not clamped to [0,1] at any time
3971during this process.
3972
3973Each pixel is then converted to the internal format specified by
3974INTERNALFORMAT. This conversion simply maps the component values of the
3975pixel (R, G, B, and A) to the values included in the internal format
3976(red, green, blue, alpha, luminance, and intensity). The mapping is as
3977follows:
3978
3979
3980
3981*Internal Format*
3982 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3983
3984`GL_ALPHA'
3985 , , , A , ,
3986
3987`GL_LUMINANCE'
3988 , , , , R ,
3989
3990`GL_LUMINANCE_ALPHA'
3991 , , , A , R ,
3992
3993`GL_INTENSITY'
3994 , , , , , R
3995
3996`GL_RGB'
3997 R , G , B , , ,
3998
3999`GL_RGBA'
4000 R , G , B , A , ,
4001
8925f36f 4002The red, green, blue, alpha, luminance, and/or intensity components of
3c9b6116
AW
4003the resulting pixels are stored in floating-point rather than integer
4004format.
4005
8925f36f 4006Pixel ordering is such that lower x screen coordinates correspond to
3c9b6116
AW
4007lower I filter image coordinates.
4008
8925f36f 4009Note that after a convolution is performed, the resulting color
3c9b6116
AW
4010components are also scaled by their corresponding
4011`GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
4012corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
4013the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
4014set by `glPixelTransfer'.
4015
4016`GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_1D'.
4017
4018`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
4019allowable values.
4020
4021`GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
4022than the maximum supported value. This value may be queried with
4023`glGetConvolutionParameter' using target `GL_CONVOLUTION_1D' and name
4024`GL_MAX_CONVOLUTION_WIDTH'.
4025
4026`GL_INVALID_OPERATION' is generated if `glCopyConvolutionFilter1D' is
4027executed between the execution of `glBegin' and the corresponding
4028execution of `glEnd'.")
8925f36f 4029
7ec693ed 4030(define-foreign-procedure
bb894c9d
AW
4031 ((glCopyConvolutionFilter2D
4032 (target GLenum)
4033 (internalformat GLenum)
4034 (x GLint)
4035 (y GLint)
4036 (width GLsizei)
4037 (height GLsizei)
4038 ->
4039 void))
3c9b6116
AW
4040 "Copy pixels into a two-dimensional convolution filter.
4041
4042TARGET
4043 Must be `GL_CONVOLUTION_2D'.
4044
4045INTERNALFORMAT
4046 The internal format of the convolution filter kernel. The allowable
4047 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
4048 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
4049 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
4050 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
4051 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
4052 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
4053 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
4054 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
4055 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
4056 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
4057 `GL_RGBA12', or `GL_RGBA16'.
4058
4059X
4060 Y
4061
4062 The window space coordinates of the lower-left coordinate of the
4063 pixel array to copy.
4064
4065WIDTH
4066 The width of the pixel array to copy.
4067
4068HEIGHT
4069 The height of the pixel array to copy.
4070
4071`glCopyConvolutionFilter2D' defines a two-dimensional convolution filter
4072kernel with pixels from the current `GL_READ_BUFFER' (rather than from
4073main memory, as is the case for `glConvolutionFilter2D').
4074
4075The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y),
4076width WIDTH and height HEIGHT is used to define the convolution filter.
4077If any pixels within this region are outside the window that is
4078associated with the GL context, the values obtained for those pixels are
4079undefined.
4080
4081The pixels in the rectangle are processed exactly as if `glReadPixels'
4082had been called with FORMAT set to RGBA, but the process stops just
4083before final conversion. The R, G, B, and A components of each pixel are
4084next scaled by the four 2D `GL_CONVOLUTION_FILTER_SCALE' parameters and
4085biased by the four 2D `GL_CONVOLUTION_FILTER_BIAS' parameters. (The
4086scale and bias parameters are set by `glConvolutionParameter' using the
4087`GL_CONVOLUTION_2D' target and the names `GL_CONVOLUTION_FILTER_SCALE'
4088and `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors
4089of four values that are applied to red, green, blue, and alpha, in that
4090order.) The R, G, B, and A values are not clamped to [0,1] at any time
4091during this process.
4092
4093Each pixel is then converted to the internal format specified by
4094INTERNALFORMAT. This conversion simply maps the component values of the
4095pixel (R, G, B, and A) to the values included in the internal format
4096(red, green, blue, alpha, luminance, and intensity). The mapping is as
4097follows:
4098
4099
4100
4101*Internal Format*
4102 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
4103
4104`GL_ALPHA'
4105 , , , A , ,
4106
4107`GL_LUMINANCE'
4108 , , , , R ,
4109
4110`GL_LUMINANCE_ALPHA'
4111 , , , A , R ,
4112
4113`GL_INTENSITY'
4114 , , , , , R
4115
4116`GL_RGB'
4117 R , G , B , , ,
4118
4119`GL_RGBA'
4120 R , G , B , A , ,
4121
8925f36f 4122The red, green, blue, alpha, luminance, and/or intensity components of
3c9b6116
AW
4123the resulting pixels are stored in floating-point rather than integer
4124format.
4125
8925f36f 4126Pixel ordering is such that lower x screen coordinates correspond to
3c9b6116
AW
4127lower I filter image coordinates, and lower y screen coordinates
4128correspond to lower J filter image coordinates.
4129
8925f36f 4130Note that after a convolution is performed, the resulting color
3c9b6116
AW
4131components are also scaled by their corresponding
4132`GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
4133corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
4134the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
4135set by `glPixelTransfer'.
4136
4137`GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_2D'.
4138
4139`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
4140allowable values.
4141
4142`GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
4143than the maximum supported value. This value may be queried with
4144`glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
4145`GL_MAX_CONVOLUTION_WIDTH'.
4146
4147`GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater
4148than the maximum supported value. This value may be queried with
4149`glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
4150`GL_MAX_CONVOLUTION_HEIGHT'.
4151
4152`GL_INVALID_OPERATION' is generated if `glCopyConvolutionFilter2D' is
4153executed between the execution of `glBegin' and the corresponding
4154execution of `glEnd'.")
8925f36f 4155
7ec693ed 4156(define-foreign-procedure
bb894c9d
AW
4157 ((glCopyPixels
4158 (x GLint)
4159 (y GLint)
4160 (width GLsizei)
4161 (height GLsizei)
4162 (type GLenum)
4163 ->
4164 void))
3c9b6116
AW
4165 "Copy pixels in the frame buffer.
4166
4167X
4168 Y
4169
4170 Specify the window coordinates of the lower left corner of the
4171 rectangular region of pixels to be copied.
4172
4173WIDTH
4174 HEIGHT
4175
4176 Specify the dimensions of the rectangular region of pixels to be
4177 copied. Both must be nonnegative.
4178
4179TYPE
4180 Specifies whether color values, depth values, or stencil values are
4181 to be copied. Symbolic constants `GL_COLOR', `GL_DEPTH', and
4182 `GL_STENCIL' are accepted.
4183
4184`glCopyPixels' copies a screen-aligned rectangle of pixels from the
4185specified frame buffer location to a region relative to the current
4186raster position. Its operation is well defined only if the entire pixel
4187source region is within the exposed portion of the window. Results of
4188copies from outside the window, or from regions of the window that are
4189not exposed, are hardware dependent and undefined.
4190
4191X and Y specify the window coordinates of the lower left corner of the
4192rectangular region to be copied. WIDTH and HEIGHT specify the dimensions
4193of the rectangular region to be copied. Both WIDTH and HEIGHT must not
4194be negative.
4195
4196Several parameters control the processing of the pixel data while it is
4197being copied. These parameters are set with three commands:
4198`glPixelTransfer', `glPixelMap', and `glPixelZoom'. This reference page
4199describes the effects on `glCopyPixels' of most, but not all, of the
4200parameters specified by these three commands.
4201
4202`glCopyPixels' copies values from each pixel with the lower left-hand
4203corner at (X+I,Y+J) for 0<=I<WIDTH and 0<=J<HEIGHT . This pixel is said
4204to be the I th pixel in the J th row. Pixels are copied in row order
4205from the lowest to the highest row, left to right in each row.
4206
4207TYPE specifies whether color, depth, or stencil data is to be copied.
4208The details of the transfer for each data type are as follows:
4209
4210`GL_COLOR'
4211 Indices or RGBA colors are read from the buffer currently specified
4212 as the read source buffer (see `glReadBuffer'). If the GL is in
4213 color index mode, each index that is read from this buffer is
4214 converted to a fixed-point format with an unspecified number of
4215 bits to the right of the binary point. Each index is then shifted
4216 left by `GL_INDEX_SHIFT' bits, and added to `GL_INDEX_OFFSET'. If
4217 `GL_INDEX_SHIFT' is negative, the shift is to the right. In either
4218 case, zero bits fill otherwise unspecified bit locations in the
4219 result. If `GL_MAP_COLOR' is true, the index is replaced with the
4220 value that it references in lookup table `GL_PIXEL_MAP_I_TO_I'.
4221 Whether the lookup replacement of the index is done or not, the
4222 integer part of the index is then ANDed with 2^B-1 , where B is the
4223 number of bits in a color index buffer.
4224
4225 If the GL is in RGBA mode, the red, green, blue, and alpha
4226 components of each pixel that is read are converted to an internal
4227 floating-point format with unspecified precision. The conversion
4228 maps the largest representable component value to 1.0, and
4229 component value 0 to 0.0. The resulting floating-point color values
4230 are then multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where
4231 C is RED, GREEN, BLUE, and ALPHA for the respective color
4232 components. The results are clamped to the range [0,1]. If
4233 `GL_MAP_COLOR' is true, each color component is scaled by the size
4234 of lookup table `GL_PIXEL_MAP_c_TO_c', then replaced by the value
4235 that it references in that table. C is R, G, B, or A.
4236
4237 If the `ARB_imaging' extension is supported, the color values may
4238 be additionally processed by color-table lookups, color-matrix
4239 transformations, and convolution filters.
4240
4241 The GL then converts the resulting indices or RGBA colors to
4242 fragments by attaching the current raster position Z coordinate and
4243 texture coordinates to each pixel, then assigning window
4244 coordinates (X_R+I,Y_R+J) , where (X_R,Y_R) is the current raster
4245 position, and the pixel was the I th pixel in the J th row. These
4246 pixel fragments are then treated just like the fragments generated
4247 by rasterizing points, lines, or polygons. Texture mapping, fog,
4248 and all the fragment operations are applied before the fragments
4249 are written to the frame buffer.
4250
4251`GL_DEPTH'
4252 Depth values are read from the depth buffer and converted directly
4253 to an internal floating-point format with unspecified precision.
4254 The resulting floating-point depth value is then multiplied by
4255 `GL_DEPTH_SCALE' and added to `GL_DEPTH_BIAS'. The result is
4256 clamped to the range [0,1].
4257
4258 The GL then converts the resulting depth components to fragments by
4259 attaching the current raster position color or color index and
4260 texture coordinates to each pixel, then assigning window
4261 coordinates (X_R+I,Y_R+J) , where (X_R,Y_R) is the current raster
4262 position, and the pixel was the I th pixel in the J th row. These
4263 pixel fragments are then treated just like the fragments generated
4264 by rasterizing points, lines, or polygons. Texture mapping, fog,
4265 and all the fragment operations are applied before the fragments
4266 are written to the frame buffer.
4267
4268`GL_STENCIL'
4269 Stencil indices are read from the stencil buffer and converted to
4270 an internal fixed-point format with an unspecified number of bits
4271 to the right of the binary point. Each fixed-point index is then
4272 shifted left by `GL_INDEX_SHIFT' bits, and added to
4273 `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is negative, the shift is to
4274 the right. In either case, zero bits fill otherwise unspecified bit
4275 locations in the result. If `GL_MAP_STENCIL' is true, the index is
4276 replaced with the value that it references in lookup table
4277 `GL_PIXEL_MAP_S_TO_S'. Whether the lookup replacement of the index
4278 is done or not, the integer part of the index is then ANDed with
4279 2^B-1 , where B is the number of bits in the stencil buffer. The
4280 resulting stencil indices are then written to the stencil buffer
4281 such that the index read from the I th location of the J th row is
4282 written to location (X_R+I,Y_R+J) , where (X_R,Y_R) is the current
4283 raster position. Only the pixel ownership test, the scissor test,
4284 and the stencil writemask affect these write operations.
4285
8925f36f 4286The rasterization described thus far assumes pixel zoom factors of 1.0.
3c9b6116
AW
4287If `glPixelZoom' is used to change the X and Y pixel zoom factors,
4288pixels are converted to fragments as follows. If (X_R,Y_R) is the
4289current raster position, and a given pixel is in the I th location in
4290the J th row of the source pixel rectangle, then fragments are generated
4291for pixels whose centers are in the rectangle with corners at
4292
4293(X_R+ZOOM_X,\u2062I,Y_R+ZOOM_Y,\u2062J)
4294
4295and
4296
4297(X_R+ZOOM_X,\u2061(I+1,),Y_R+ZOOM_Y,\u2061(J+1,))
4298
4299where ZOOM_X is the value of `GL_ZOOM_X' and ZOOM_Y is the value of
4300`GL_ZOOM_Y'.
4301
4302`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
4303
4304`GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
4305
4306`GL_INVALID_OPERATION' is generated if TYPE is `GL_DEPTH' and there is
4307no depth buffer.
4308
4309`GL_INVALID_OPERATION' is generated if TYPE is `GL_STENCIL' and there is
4310no stencil buffer.
4311
4312`GL_INVALID_OPERATION' is generated if `glCopyPixels' is executed
4313between the execution of `glBegin' and the corresponding execution of
4314`glEnd'.")
8925f36f 4315
7ec693ed 4316(define-foreign-procedure
bb894c9d
AW
4317 ((glCopyTexImage1D
4318 (target GLenum)
4319 (level GLint)
4320 (internalformat GLenum)
4321 (x GLint)
4322 (y GLint)
4323 (width GLsizei)
4324 (border GLint)
4325 ->
4326 void))
3c9b6116
AW
4327 "Copy pixels into a 1D texture image.
4328
4329TARGET
4330 Specifies the target texture. Must be `GL_TEXTURE_1D'.
4331
4332LEVEL
4333 Specifies the level-of-detail number. Level 0 is the base image
4334 level. Level N is the Nth mipmap reduction image.
4335
4336INTERNALFORMAT
4337 Specifies the internal format of the texture. Must be one of the
4338 following symbolic constants: `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8',
4339 `GL_ALPHA12', `GL_ALPHA16', `GL_COMPRESSED_ALPHA',
4340 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
4341 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB',
4342 `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
4343 `GL_DEPTH_COMPONENT24', `GL_DEPTH_COMPONENT32', `GL_LUMINANCE',
4344 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
4345 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
4346 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
4347 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
4348 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
4349 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_RGB',
4350 `GL_R3_G3_B2', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10',
4351 `GL_RGB12', `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4',
4352 `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
4353 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
4354 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
4355 `GL_SRGB8_ALPHA8'.
4356
4357X
4358 Y
4359
4360 Specify the window coordinates of the left corner of the row of
4361 pixels to be copied.
4362
4363WIDTH
4364 Specifies the width of the texture image. Must be 0 or
4365 2^N+2\u2061(BORDER,) for some integer N . The height of the texture
4366 image is 1.
4367
4368BORDER
4369 Specifies the width of the border. Must be either 0 or 1.
4370
4371`glCopyTexImage1D' defines a one-dimensional texture image with pixels
4372from the current `GL_READ_BUFFER'.
4373
4374The screen-aligned pixel row with left corner at (X,Y) and with a length
4375of WIDTH+2\u2061(BORDER,) defines the texture array at the mipmap level
4376specified by LEVEL. INTERNALFORMAT specifies the internal format of the
4377texture array.
4378
4379The pixels in the row are processed exactly as if `glCopyPixels' had
4380been called, but the process stops just before final conversion. At this
4381point all pixel component values are clamped to the range [0,1] and then
4382converted to the texture's internal format for storage in the texel
4383array.
4384
4385Pixel ordering is such that lower X screen coordinates correspond to
4386lower texture coordinates.
4387
4388If any of the pixels within the specified row of the current
4389`GL_READ_BUFFER' are outside the window associated with the current
4390rendering context, then the values obtained for those pixels are
4391undefined.
4392
4393`glCopyTexImage1D' defines a one-dimensional texture image with pixels
4394from the current `GL_READ_BUFFER'.
4395
4396When INTERNALFORMAT is one of the sRGB types, the GL does not
4397automatically convert the source pixels to the sRGB color space. In this
4398case, the `glPixelMap' function can be used to accomplish the
4399conversion.
4400
4401`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
4402values.
4403
4404`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4405
4406`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2\u2062MAX ,
4407where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
4408
4409`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not an allowable
4410value.
4411
4412`GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than
44132 + `GL_MAX_TEXTURE_SIZE'.
4414
4415`GL_INVALID_VALUE' is generated if non-power-of-two textures are not
4416supported and the WIDTH cannot be represented as 2^N+2\u2061(BORDER,) for
4417some integer value of N.
4418
4419`GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
4420
4421`GL_INVALID_OPERATION' is generated if `glCopyTexImage1D' is executed
4422between the execution of `glBegin' and the corresponding execution of
4423`glEnd'.
4424
4425`GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
4426`GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
4427`GL_DEPTH_COMPONENT32' and there is no depth buffer.")
8925f36f 4428
7ec693ed 4429(define-foreign-procedure
bb894c9d
AW
4430 ((glCopyTexImage2D
4431 (target GLenum)
4432 (level GLint)
4433 (internalformat GLenum)
4434 (x GLint)
4435 (y GLint)
4436 (width GLsizei)
4437 (height GLsizei)
4438 (border GLint)
4439 ->
4440 void))
3c9b6116
AW
4441 "Copy pixels into a 2D texture image.
4442
4443TARGET
4444 Specifies the target texture. Must be `GL_TEXTURE_2D',
4445 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4446 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4447 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
4448 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4449
4450LEVEL
4451 Specifies the level-of-detail number. Level 0 is the base image
4452 level. Level N is the Nth mipmap reduction image.
4453
4454INTERNALFORMAT
4455 Specifies the internal format of the texture. Must be one of the
4456 following symbolic constants: `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8',
4457 `GL_ALPHA12', `GL_ALPHA16', `GL_COMPRESSED_ALPHA',
4458 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
4459 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB',
4460 `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
4461 `GL_DEPTH_COMPONENT24', `GL_DEPTH_COMPONENT32', `GL_LUMINANCE',
4462 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
4463 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
4464 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
4465 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
4466 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
4467 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_RGB',
4468 `GL_R3_G3_B2', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10',
4469 `GL_RGB12', `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4',
4470 `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
4471 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
4472 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
4473 `GL_SRGB8_ALPHA8'.
4474
4475X
4476 Y
4477
4478 Specify the window coordinates of the lower left corner of the
4479 rectangular region of pixels to be copied.
4480
4481WIDTH
4482 Specifies the width of the texture image. Must be 0 or
4483 2^N+2\u2061(BORDER,) for some integer N .
4484
4485HEIGHT
4486 Specifies the height of the texture image. Must be 0 or
4487 2^M+2\u2061(BORDER,) for some integer M .
4488
4489BORDER
4490 Specifies the width of the border. Must be either 0 or 1.
4491
4492`glCopyTexImage2D' defines a two-dimensional texture image, or cube-map
4493texture image with pixels from the current `GL_READ_BUFFER'.
4494
4495The screen-aligned pixel rectangle with lower left corner at (X, Y) and
4496with a width of WIDTH+2\u2061(BORDER,) and a height of HEIGHT+2\u2061(BORDER,)
4497defines the texture array at the mipmap level specified by LEVEL.
4498INTERNALFORMAT specifies the internal format of the texture array.
4499
4500The pixels in the rectangle are processed exactly as if `glCopyPixels'
4501had been called, but the process stops just before final conversion. At
4502this point all pixel component values are clamped to the range [0,1] and
4503then converted to the texture's internal format for storage in the texel
4504array.
4505
4506Pixel ordering is such that lower X and Y screen coordinates correspond
4507to lower S and T texture coordinates.
4508
4509If any of the pixels within the specified rectangle of the current
4510`GL_READ_BUFFER' are outside the window associated with the current
4511rendering context, then the values obtained for those pixels are
4512undefined.
4513
4514When INTERNALFORMAT is one of the sRGB types, the GL does not
4515automatically convert the source pixels to the sRGB color space. In this
4516case, the `glPixelMap' function can be used to accomplish the
4517conversion.
4518
4519`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
4520`GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4521`GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4522`GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4523
4524`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4525
4526`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2\u2062MAX ,
4527where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
4528
4529`GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than
45302 + `GL_MAX_TEXTURE_SIZE'.
4531
4532`GL_INVALID_VALUE' is generated if non-power-of-two textures are not
4533supported and the WIDTH or DEPTH cannot be represented as
45342^K+2\u2061(BORDER,) for some integer K .
4535
4536`GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
4537
4538`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not an accepted
4539format.
4540
4541`GL_INVALID_OPERATION' is generated if `glCopyTexImage2D' is executed
4542between the execution of `glBegin' and the corresponding execution of
4543`glEnd'.
4544
4545`GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
4546`GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
4547`GL_DEPTH_COMPONENT32' and there is no depth buffer.")
8925f36f 4548
7ec693ed 4549(define-foreign-procedure
bb894c9d
AW
4550 ((glCopyTexSubImage1D
4551 (target GLenum)
4552 (level GLint)
4553 (xoffset GLint)
4554 (x GLint)
4555 (y GLint)
4556 (width GLsizei)
4557 ->
4558 void))
3c9b6116
AW
4559 "Copy a one-dimensional texture subimage.
4560
4561TARGET
4562 Specifies the target texture. Must be `GL_TEXTURE_1D'.
4563
4564LEVEL
4565 Specifies the level-of-detail number. Level 0 is the base image
4566 level. Level N is the Nth mipmap reduction image.
4567
4568XOFFSET
4569 Specifies the texel offset within the texture array.
4570
4571X
4572 Y
4573
4574 Specify the window coordinates of the left corner of the row of
4575 pixels to be copied.
4576
4577WIDTH
4578 Specifies the width of the texture subimage.
4579
4580`glCopyTexSubImage1D' replaces a portion of a one-dimensional texture
4581image with pixels from the current `GL_READ_BUFFER' (rather than from
4582main memory, as is the case for `glTexSubImage1D').
4583
4584The screen-aligned pixel row with left corner at (X,\\ Y), and with
4585length WIDTH replaces the portion of the texture array with x indices
4586XOFFSET through XOFFSET+WIDTH-1 , inclusive. The destination in the
4587texture array may not include any texels outside the texture array as it
4588was originally specified.
4589
4590The pixels in the row are processed exactly as if `glCopyPixels' had
4591been called, but the process stops just before final conversion. At this
4592point, all pixel component values are clamped to the range [0,1] and
4593then converted to the texture's internal format for storage in the texel
4594array.
4595
4596It is not an error to specify a subtexture with zero width, but such a
4597specification has no effect. If any of the pixels within the specified
4598row of the current `GL_READ_BUFFER' are outside the read window
4599associated with the current rendering context, then the values obtained
4600for those pixels are undefined.
4601
4602No change is made to the INTERNALFORMAT, WIDTH, or BORDER parameters of
4603the specified texture array or to texel values outside the specified
4604subregion.
4605
4606`GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_1D'.
4607
4608`GL_INVALID_OPERATION' is generated if the texture array has not been
4609defined by a previous `glTexImage1D' or `glCopyTexImage1D' operation.
4610
4611`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4612
4613`GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is
4614the returned value of `GL_MAX_TEXTURE_SIZE'.
4615
4616`GL_INVALID_VALUE' is generated if XOFFSET<-B , or
4617(XOFFSET+WIDTH,)>(W-B,) , where W is the `GL_TEXTURE_WIDTH' and B is the
4618`GL_TEXTURE_BORDER' of the texture image being modified. Note that W
4619includes twice the border width.")
8925f36f 4620
7ec693ed 4621(define-foreign-procedure
bb894c9d
AW
4622 ((glCopyTexSubImage2D
4623 (target GLenum)
4624 (level GLint)
4625 (xoffset GLint)
4626 (yoffset GLint)
4627 (x GLint)
4628 (y GLint)
4629 (width GLsizei)
4630 (height GLsizei)
4631 ->
4632 void))
3c9b6116
AW
4633 "Copy a two-dimensional texture subimage.
4634
4635TARGET
4636 Specifies the target texture. Must be `GL_TEXTURE_2D',
4637 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4638 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4639 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
4640 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4641
4642LEVEL
4643 Specifies the level-of-detail number. Level 0 is the base image
4644 level. Level N is the Nth mipmap reduction image.
4645
4646XOFFSET
4647 Specifies a texel offset in the x direction within the texture
4648 array.
4649
4650YOFFSET
4651 Specifies a texel offset in the y direction within the texture
4652 array.
4653
4654X
4655 Y
4656
4657 Specify the window coordinates of the lower left corner of the
4658 rectangular region of pixels to be copied.
4659
4660WIDTH
4661 Specifies the width of the texture subimage.
4662
4663HEIGHT
4664 Specifies the height of the texture subimage.
4665
4666`glCopyTexSubImage2D' replaces a rectangular portion of a
4667two-dimensional texture image or cube-map texture image with pixels from
4668the current `GL_READ_BUFFER' (rather than from main memory, as is the
4669case for `glTexSubImage2D').
4670
4671The screen-aligned pixel rectangle with lower left corner at (X,Y) and
4672with width WIDTH and height HEIGHT replaces the portion of the texture
4673array with x indices XOFFSET through XOFFSET+WIDTH-1 , inclusive, and y
4674indices YOFFSET through YOFFSET+HEIGHT-1 , inclusive, at the mipmap
4675level specified by LEVEL.
4676
4677The pixels in the rectangle are processed exactly as if `glCopyPixels'
4678had been called, but the process stops just before final conversion. At
4679this point, all pixel component values are clamped to the range [0,1]
4680and then converted to the texture's internal format for storage in the
4681texel array.
4682
4683The destination rectangle in the texture array may not include any
4684texels outside the texture array as it was originally specified. It is
4685not an error to specify a subtexture with zero width or height, but such
4686a specification has no effect.
4687
4688If any of the pixels within the specified rectangle of the current
4689`GL_READ_BUFFER' are outside the read window associated with the current
4690rendering context, then the values obtained for those pixels are
4691undefined.
4692
4693No change is made to the INTERNALFORMAT, WIDTH, HEIGHT, or BORDER
4694parameters of the specified texture array or to texel values outside the
4695specified subregion.
4696
4697`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
4698`GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4699`GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4700`GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4701
4702`GL_INVALID_OPERATION' is generated if the texture array has not been
4703defined by a previous `glTexImage2D' or `glCopyTexImage2D' operation.
4704
4705`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4706
4707`GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is
4708the returned value of `GL_MAX_TEXTURE_SIZE'.
4709
4710`GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
4711, YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , where W is the
4712`GL_TEXTURE_WIDTH', H is the `GL_TEXTURE_HEIGHT', and B is the
4713`GL_TEXTURE_BORDER' of the texture image being modified. Note that W and
4714H include twice the border width.
4715
4716`GL_INVALID_OPERATION' is generated if `glCopyTexSubImage2D' is executed
4717between the execution of `glBegin' and the corresponding execution of
4718`glEnd'.")
8925f36f 4719
7ec693ed 4720(define-foreign-procedure
bb894c9d
AW
4721 ((glCopyTexSubImage3D
4722 (target GLenum)
4723 (level GLint)
4724 (xoffset GLint)
4725 (yoffset GLint)
4726 (zoffset GLint)
4727 (x GLint)
4728 (y GLint)
4729 (width GLsizei)
4730 (height GLsizei)
4731 ->
4732 void))
3c9b6116
AW
4733 "Copy a three-dimensional texture subimage.
4734
4735TARGET
4736 Specifies the target texture. Must be `GL_TEXTURE_3D'
4737
4738LEVEL
4739 Specifies the level-of-detail number. Level 0 is the base image
4740 level. Level N is the Nth mipmap reduction image.
4741
4742XOFFSET
4743 Specifies a texel offset in the x direction within the texture
4744 array.
4745
4746YOFFSET
4747 Specifies a texel offset in the y direction within the texture
4748 array.
4749
4750ZOFFSET
4751 Specifies a texel offset in the z direction within the texture
4752 array.
4753
4754X
4755 Y
4756
4757 Specify the window coordinates of the lower left corner of the
4758 rectangular region of pixels to be copied.
4759
4760WIDTH
4761 Specifies the width of the texture subimage.
4762
4763HEIGHT
4764 Specifies the height of the texture subimage.
4765
4766`glCopyTexSubImage3D' replaces a rectangular portion of a
4767three-dimensional texture image with pixels from the current
4768`GL_READ_BUFFER' (rather than from main memory, as is the case for
4769`glTexSubImage3D').
4770
4771The screen-aligned pixel rectangle with lower left corner at (X,\\ Y) and
4772with width WIDTH and height HEIGHT replaces the portion of the texture
4773array with x indices XOFFSET through XOFFSET+WIDTH-1 , inclusive, and y
4774indices YOFFSET through YOFFSET+HEIGHT-1 , inclusive, at z index ZOFFSET
4775and at the mipmap level specified by LEVEL.
4776
4777The pixels in the rectangle are processed exactly as if `glCopyPixels'
4778had been called, but the process stops just before final conversion. At
4779this point, all pixel component values are clamped to the range [0,1]
4780and then converted to the texture's internal format for storage in the
4781texel array.
4782
4783The destination rectangle in the texture array may not include any
4784texels outside the texture array as it was originally specified. It is
4785not an error to specify a subtexture with zero width or height, but such
4786a specification has no effect.
4787
4788If any of the pixels within the specified rectangle of the current
4789`GL_READ_BUFFER' are outside the read window associated with the current
4790rendering context, then the values obtained for those pixels are
4791undefined.
4792
4793No change is made to the INTERNALFORMAT, WIDTH, HEIGHT, DEPTH, or BORDER
4794parameters of the specified texture array or to texel values outside the
4795specified subregion.
4796
4797`GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_3D'.
4798
4799`GL_INVALID_OPERATION' is generated if the texture array has not been
4800defined by a previous `glTexImage3D' operation.
4801
4802`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4803
4804`GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is
4805the returned value of `GL_MAX_3D_TEXTURE_SIZE'.
4806
4807`GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
4808, YOFFSET<-B , (YOFFSET+HEIGHT,)>(H-B,) , ZOFFSET<-B , or
4809(ZOFFSET+1,)>(D-B,) , where W is the `GL_TEXTURE_WIDTH', H is the
4810`GL_TEXTURE_HEIGHT', D is the `GL_TEXTURE_DEPTH', and B is the
4811`GL_TEXTURE_BORDER' of the texture image being modified. Note that W , H
4812, and D include twice the border width.
4813
4814`GL_INVALID_OPERATION' is generated if `glCopyTexSubImage3D' is executed
4815between the execution of `glBegin' and the corresponding execution of
4816`glEnd'.")
8925f36f 4817
7ec693ed 4818(define-foreign-procedure
bb894c9d 4819 ((glCreateProgram -> GLuint))
3c9b6116
AW
4820 "Creates a program object.
4821
4822`glCreateProgram' creates an empty program object and returns a non-zero
4823value by which it can be referenced. A program object is an object to
4824which shader objects can be attached. This provides a mechanism to
4825specify the shader objects that will be linked to create a program. It
4826also provides a means for checking the compatibility of the shaders that
4827will be used to create a program (for instance, checking the
4828compatibility between a vertex shader and a fragment shader). When no
4829longer needed as part of a program object, shader objects can be
4830detached.
4831
4832One or more executables are created in a program object by successfully
4833attaching shader objects to it with `glAttachShader', successfully
4834compiling the shader objects with `glCompileShader', and successfully
4835linking the program object with `glLinkProgram'. These executables are
4836made part of current state when `glUseProgram' is called. Program
4837objects can be deleted by calling `glDeleteProgram'. The memory
4838associated with the program object will be deleted when it is no longer
4839part of current rendering state for any context.
4840
4841This function returns 0 if an error occurs creating the program object.
4842
4843`GL_INVALID_OPERATION' is generated if `glCreateProgram' is executed
4844between the execution of `glBegin' and the corresponding execution of
4845`glEnd'.")
8925f36f 4846
7ec693ed 4847(define-foreign-procedure
bb894c9d 4848 ((glCreateShader (shaderType GLenum) -> GLuint))
3c9b6116
AW
4849 "Creates a shader object.
4850
4851SHADERTYPE
4852 Specifies the type of shader to be created. Must be either
4853 `GL_VERTEX_SHADER' or `GL_FRAGMENT_SHADER'.
4854
4855`glCreateShader' creates an empty shader object and returns a non-zero
4856value by which it can be referenced. A shader object is used to maintain
4857the source code strings that define a shader. SHADERTYPE indicates the
4858type of shader to be created. Two types of shaders are supported. A
4859shader of type `GL_VERTEX_SHADER' is a shader that is intended to run on
4860the programmable vertex processor and replace the fixed functionality
4861vertex processing in OpenGL. A shader of type `GL_FRAGMENT_SHADER' is a
4862shader that is intended to run on the programmable fragment processor
4863and replace the fixed functionality fragment processing in OpenGL.
4864
4865When created, a shader object's `GL_SHADER_TYPE' parameter is set to
4866either `GL_VERTEX_SHADER' or `GL_FRAGMENT_SHADER', depending on the
4867value of SHADERTYPE.
4868
4869This function returns 0 if an error occurs creating the shader object.
4870
4871`GL_INVALID_ENUM' is generated if SHADERTYPE is not an accepted value.
4872
4873`GL_INVALID_OPERATION' is generated if `glCreateShader' is executed
4874between the execution of `glBegin' and the corresponding execution of
4875`glEnd'.")
8925f36f 4876
7ec693ed 4877(define-foreign-procedure
bb894c9d 4878 ((glCullFace (mode GLenum) -> void))
3c9b6116
AW
4879 "Specify whether front- or back-facing facets can be culled.
4880
4881MODE
4882 Specifies whether front- or back-facing facets are candidates for
4883 culling. Symbolic constants `GL_FRONT', `GL_BACK', and
4884 `GL_FRONT_AND_BACK' are accepted. The initial value is `GL_BACK'.
4885
4886`glCullFace' specifies whether front- or back-facing facets are culled
4887(as specified by MODE) when facet culling is enabled. Facet culling is
4888initially disabled. To enable and disable facet culling, call the
4889`glEnable' and `glDisable' commands with the argument `GL_CULL_FACE'.
4890Facets include triangles, quadrilaterals, polygons, and rectangles.
4891
4892`glFrontFace' specifies which of the clockwise and counterclockwise
4893facets are front-facing and back-facing. See `glFrontFace'.
4894
4895`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
4896
4897`GL_INVALID_OPERATION' is generated if `glCullFace' is executed between
4898the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 4899
7ec693ed 4900(define-foreign-procedure
bb894c9d 4901 ((glDeleteBuffers (n GLsizei) (buffers *) -> void))
3c9b6116
AW
4902 "Delete named buffer objects.
4903
4904N
4905 Specifies the number of buffer objects to be deleted.
4906
4907BUFFERS
4908 Specifies an array of buffer objects to be deleted.
4909
4910`glDeleteBuffers' deletes N buffer objects named by the elements of the
4911array BUFFERS. After a buffer object is deleted, it has no contents, and
4912its name is free for reuse (for example by `glGenBuffers'). If a buffer
4913object that is currently bound is deleted, the binding reverts to 0 (the
4914absence of any buffer object, which reverts to client memory usage).
4915
4916`glDeleteBuffers' silently ignores 0's and names that do not correspond
4917to existing buffer objects.
4918
4919`GL_INVALID_VALUE' is generated if N is negative.
4920
4921`GL_INVALID_OPERATION' is generated if `glDeleteBuffers' is executed
4922between the execution of `glBegin' and the corresponding execution of
4923`glEnd'.")
8925f36f 4924
7ec693ed 4925(define-foreign-procedure
bb894c9d
AW
4926 ((glDeleteLists
4927 (list GLuint)
4928 (range GLsizei)
4929 ->
4930 void))
3c9b6116
AW
4931 "Delete a contiguous group of display lists.
4932
4933LIST
4934 Specifies the integer name of the first display list to delete.
4935
4936RANGE
4937 Specifies the number of display lists to delete.
4938
4939`glDeleteLists' causes a contiguous group of display lists to be
4940deleted. LIST is the name of the first display list to be deleted, and
4941RANGE is the number of display lists to delete. All display lists D with
4942LIST<=D<=LIST+RANGE-1 are deleted.
4943
4944All storage locations allocated to the specified display lists are
4945freed, and the names are available for reuse at a later time. Names
4946within the range that do not have an associated display list are
4947ignored. If RANGE is 0, nothing happens.
4948
4949`GL_INVALID_VALUE' is generated if RANGE is negative.
4950
4951`GL_INVALID_OPERATION' is generated if `glDeleteLists' is executed
4952between the execution of `glBegin' and the corresponding execution of
4953`glEnd'.")
8925f36f 4954
7ec693ed 4955(define-foreign-procedure
bb894c9d 4956 ((glDeleteProgram (program GLuint) -> void))
3c9b6116
AW
4957 "Deletes a program object.
4958
4959PROGRAM
4960 Specifies the program object to be deleted.
4961
4962`glDeleteProgram' frees the memory and invalidates the name associated
4963with the program object specified by PROGRAM. This command effectively
4964undoes the effects of a call to `glCreateProgram'.
4965
4966If a program object is in use as part of current rendering state, it
4967will be flagged for deletion, but it will not be deleted until it is no
4968longer part of current state for any rendering context. If a program
4969object to be deleted has shader objects attached to it, those shader
4970objects will be automatically detached but not deleted unless they have
4971already been flagged for deletion by a previous call to
4972`glDeleteShader'. A value of 0 for PROGRAM will be silently ignored.
4973
4974To determine whether a program object has been flagged for deletion,
4975call `glGetProgram' with arguments PROGRAM and `GL_DELETE_STATUS'.
4976
4977`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
4978OpenGL.
4979
4980`GL_INVALID_OPERATION' is generated if `glDeleteProgram' is executed
4981between the execution of `glBegin' and the corresponding execution of
4982`glEnd'.")
8925f36f 4983
7ec693ed 4984(define-foreign-procedure
bb894c9d 4985 ((glDeleteQueries (n GLsizei) (ids *) -> void))
3c9b6116
AW
4986 "Delete named query objects.
4987
4988N
4989 Specifies the number of query objects to be deleted.
4990
4991IDS
4992 Specifies an array of query objects to be deleted.
4993
4994`glDeleteQueries' deletes N query objects named by the elements of the
4995array IDS. After a query object is deleted, it has no contents, and its
4996name is free for reuse (for example by `glGenQueries').
4997
4998`glDeleteQueries' silently ignores 0's and names that do not correspond
4999to existing query objects.
5000
5001`GL_INVALID_VALUE' is generated if N is negative.
5002
5003`GL_INVALID_OPERATION' is generated if `glDeleteQueries' is executed
5004between the execution of `glBegin' and the corresponding execution of
5005`glEnd'.")
8925f36f 5006
7ec693ed 5007(define-foreign-procedure
bb894c9d 5008 ((glDeleteShader (shader GLuint) -> void))
3c9b6116
AW
5009 "Deletes a shader object.
5010
5011SHADER
5012 Specifies the shader object to be deleted.
5013
5014`glDeleteShader' frees the memory and invalidates the name associated
5015with the shader object specified by SHADER. This command effectively
5016undoes the effects of a call to `glCreateShader'.
5017
5018If a shader object to be deleted is attached to a program object, it
5019will be flagged for deletion, but it will not be deleted until it is no
5020longer attached to any program object, for any rendering context (i.e.,
5021it must be detached from wherever it was attached before it will be
5022deleted). A value of 0 for SHADER will be silently ignored.
5023
5024To determine whether an object has been flagged for deletion, call
5025`glGetShader' with arguments SHADER and `GL_DELETE_STATUS'.
5026
5027`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
5028OpenGL.
5029
5030`GL_INVALID_OPERATION' is generated if `glDeleteShader' is executed
5031between the execution of `glBegin' and the corresponding execution of
5032`glEnd'.")
8925f36f 5033
7ec693ed 5034(define-foreign-procedure
bb894c9d
AW
5035 ((glDeleteTextures
5036 (n GLsizei)
5037 (textures *)
5038 ->
5039 void))
3c9b6116
AW
5040 "Delete named textures.
5041
5042N
5043 Specifies the number of textures to be deleted.
5044
5045TEXTURES
5046 Specifies an array of textures to be deleted.
5047
5048`glDeleteTextures' deletes N textures named by the elements of the array
5049TEXTURES. After a texture is deleted, it has no contents or
5050dimensionality, and its name is free for reuse (for example by
5051`glGenTextures'). If a texture that is currently bound is deleted, the
5052binding reverts to 0 (the default texture).
5053
5054`glDeleteTextures' silently ignores 0's and names that do not correspond
5055to existing textures.
5056
5057`GL_INVALID_VALUE' is generated if N is negative.
5058
5059`GL_INVALID_OPERATION' is generated if `glDeleteTextures' is executed
5060between the execution of `glBegin' and the corresponding execution of
5061`glEnd'.")
8925f36f 5062
7ec693ed 5063(define-foreign-procedure
bb894c9d 5064 ((glDepthFunc (func GLenum) -> void))
3c9b6116
AW
5065 "Specify the value used for depth buffer comparisons.
5066
5067FUNC
5068 Specifies the depth comparison function. Symbolic constants
5069 `GL_NEVER', `GL_LESS', `GL_EQUAL', `GL_LEQUAL', `GL_GREATER',
5070 `GL_NOTEQUAL', `GL_GEQUAL', and `GL_ALWAYS' are accepted. The
5071 initial value is `GL_LESS'.
5072
5073`glDepthFunc' specifies the function used to compare each incoming pixel
5074depth value with the depth value present in the depth buffer. The
5075comparison is performed only if depth testing is enabled. (See
5076`glEnable' and `glDisable' of `GL_DEPTH_TEST'.)
5077
5078FUNC specifies the conditions under which the pixel will be drawn. The
5079comparison functions are as follows:
5080
5081`GL_NEVER'
5082 Never passes.
5083
5084`GL_LESS'
5085 Passes if the incoming depth value is less than the stored depth
5086 value.
5087
5088`GL_EQUAL'
5089 Passes if the incoming depth value is equal to the stored depth
5090 value.
5091
5092`GL_LEQUAL'
5093 Passes if the incoming depth value is less than or equal to the
5094 stored depth value.
5095
5096`GL_GREATER'
5097 Passes if the incoming depth value is greater than the stored depth
5098 value.
5099
5100`GL_NOTEQUAL'
5101 Passes if the incoming depth value is not equal to the stored depth
5102 value.
5103
5104`GL_GEQUAL'
5105 Passes if the incoming depth value is greater than or equal to the
5106 stored depth value.
5107
5108`GL_ALWAYS'
5109 Always passes.
5110
5111The initial value of FUNC is `GL_LESS'. Initially, depth testing is
5112disabled. If depth testing is disabled or if no depth buffer exists, it
5113is as if the depth test always passes.
5114
5115`GL_INVALID_ENUM' is generated if FUNC is not an accepted value.
5116
5117`GL_INVALID_OPERATION' is generated if `glDepthFunc' is executed between
5118the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 5119
7ec693ed 5120(define-foreign-procedure
bb894c9d 5121 ((glDepthMask (flag GLboolean) -> void))
3c9b6116
AW
5122 "Enable or disable writing into the depth buffer.
5123
5124FLAG
5125 Specifies whether the depth buffer is enabled for writing. If FLAG
5126 is `GL_FALSE', depth buffer writing is disabled. Otherwise, it is
5127 enabled. Initially, depth buffer writing is enabled.
5128
5129`glDepthMask' specifies whether the depth buffer is enabled for writing.
5130If FLAG is `GL_FALSE', depth buffer writing is disabled. Otherwise, it
5131is enabled. Initially, depth buffer writing is enabled.
5132
5133`GL_INVALID_OPERATION' is generated if `glDepthMask' is executed between
5134the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 5135
7ec693ed 5136(define-foreign-procedure
bb894c9d
AW
5137 ((glDepthRange
5138 (nearVal GLclampd)
5139 (farVal GLclampd)
5140 ->
5141 void))
3c9b6116
AW
5142 "Specify mapping of depth values from normalized device coordinates to
5143window coordinates.
5144
5145NEARVAL
5146 Specifies the mapping of the near clipping plane to window
5147 coordinates. The initial value is 0.
5148
5149FARVAL
5150 Specifies the mapping of the far clipping plane to window
5151 coordinates. The initial value is 1.
5152
5153After clipping and division by W, depth coordinates range from -1 to 1,
5154corresponding to the near and far clipping planes. `glDepthRange'
5155specifies a linear mapping of the normalized depth coordinates in this
5156range to window depth coordinates. Regardless of the actual depth buffer
5157implementation, window coordinate depth values are treated as though
5158they range from 0 through 1 (like color components). Thus, the values
5159accepted by `glDepthRange' are both clamped to this range before they
5160are accepted.
5161
5162The setting of (0,1) maps the near plane to 0 and the far plane to 1.
5163With this mapping, the depth buffer range is fully utilized.
5164
5165`GL_INVALID_OPERATION' is generated if `glDepthRange' is executed
5166between the execution of `glBegin' and the corresponding execution of
5167`glEnd'.")
8925f36f 5168
7ec693ed 5169(define-foreign-procedure
bb894c9d
AW
5170 ((glDetachShader
5171 (program GLuint)
5172 (shader GLuint)
5173 ->
5174 void))
3c9b6116
AW
5175 "Detaches a shader object from a program object to which it is attached.
5176
5177PROGRAM
5178 Specifies the program object from which to detach the shader
5179 object.
5180
5181SHADER
5182 Specifies the shader object to be detached.
5183
5184`glDetachShader' detaches the shader object specified by SHADER from the
5185program object specified by PROGRAM. This command can be used to undo
5186the effect of the command `glAttachShader'.
5187
5188If SHADER has already been flagged for deletion by a call to
5189`glDeleteShader' and it is not attached to any other program object, it
5190will be deleted after it has been detached.
5191
5192`GL_INVALID_VALUE' is generated if either PROGRAM or SHADER is a value
5193that was not generated by OpenGL.
5194
5195`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
5196
5197`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
5198
5199`GL_INVALID_OPERATION' is generated if SHADER is not attached to
5200PROGRAM.
5201
5202`GL_INVALID_OPERATION' is generated if `glDetachShader' is executed
5203between the execution of `glBegin' and the corresponding execution of
5204`glEnd'.")
8925f36f 5205
7ec693ed 5206(define-foreign-procedure
bb894c9d
AW
5207 ((glDrawArrays
5208 (mode GLenum)
5209 (first GLint)
5210 (count GLsizei)
5211 ->
5212 void))
3c9b6116
AW
5213 "Render primitives from array data.
5214
5215MODE
5216 Specifies what kind of primitives to render. Symbolic constants
5217 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
5218 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
5219 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
5220
5221FIRST
5222 Specifies the starting index in the enabled arrays.
5223
5224COUNT
5225 Specifies the number of indices to be rendered.
5226
5227`glDrawArrays' specifies multiple geometric primitives with very few
5228subroutine calls. Instead of calling a GL procedure to pass each
5229individual vertex, normal, texture coordinate, edge flag, or color, you
5230can prespecify separate arrays of vertices, normals, and colors and use
5231them to construct a sequence of primitives with a single call to
5232`glDrawArrays'.
5233
5234When `glDrawArrays' is called, it uses COUNT sequential elements from
5235each enabled array to construct a sequence of geometric primitives,
5236beginning with element FIRST. MODE specifies what kind of primitives are
5237constructed and how the array elements construct those primitives. If
5238`GL_VERTEX_ARRAY' is not enabled, no geometric primitives are generated.
5239
5240Vertex attributes that are modified by `glDrawArrays' have an
5241unspecified value after `glDrawArrays' returns. For example, if
5242`GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
5243after `glDrawArrays' executes. Attributes that aren't modified remain
5244well defined.
5245
5246`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5247
5248`GL_INVALID_VALUE' is generated if COUNT is negative.
5249
5250`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5251bound to an enabled array and the buffer object's data store is
5252currently mapped.
5253
5254`GL_INVALID_OPERATION' is generated if `glDrawArrays' is executed
5255between the execution of `glBegin' and the corresponding `glEnd'.")
8925f36f 5256
7ec693ed 5257(define-foreign-procedure
bb894c9d 5258 ((glDrawBuffers (n GLsizei) (bufs *) -> void))
3c9b6116
AW
5259 "Specifies a list of color buffers to be drawn into.
5260
5261N
5262 Specifies the number of buffers in BUFS.
5263
5264BUFS
5265 Points to an array of symbolic constants specifying the buffers
5266 into which fragment colors or data values will be written.
5267
5268`glDrawBuffers' defines an array of buffers into which fragment color
5269values or fragment data will be written. If no fragment shader is
5270active, rendering operations will generate only one fragment color per
5271fragment and it will be written into each of the buffers specified by
5272BUFS. If a fragment shader is active and it writes a value to the output
5273variable `gl_FragColor', then that value will be written into each of
5274the buffers specified by BUFS. If a fragment shader is active and it
5275writes a value to one or more elements of the output array variable
5276`gl_FragData[]', then the value of `gl_FragData[0] ' will be written
5277into the first buffer specified by BUFS, the value of `gl_FragData[1] '
5278will be written into the second buffer specified by BUFS, and so on up
5279to `gl_FragData[n-1]'. The draw buffer used for `gl_FragData[n]' and
5280beyond is implicitly set to be `GL_NONE'.
5281
5282The symbolic constants contained in BUFS may be any of the following:
5283
5284`GL_NONE'
5285 The fragment color/data value is not written into any color buffer.
5286
5287`GL_FRONT_LEFT'
5288 The fragment color/data value is written into the front left color
5289 buffer.
5290
5291`GL_FRONT_RIGHT'
5292 The fragment color/data value is written into the front right color
5293 buffer.
5294
5295`GL_BACK_LEFT'
5296 The fragment color/data value is written into the back left color
5297 buffer.
5298
5299`GL_BACK_RIGHT'
5300 The fragment color/data value is written into the back right color
5301 buffer.
5302
5303`GL_AUXi'
5304 The fragment color/data value is written into auxiliary buffer `i'.
5305
5306Except for `GL_NONE', the preceding symbolic constants may not appear
5307more than once in BUFS. The maximum number of draw buffers supported is
5308implementation dependent and can be queried by calling `glGet' with the
5309argument `GL_MAX_DRAW_BUFFERS'. The number of auxiliary buffers can be
5310queried by calling `glGet' with the argument `GL_AUX_BUFFERS'.
5311
5312`GL_INVALID_ENUM' is generated if one of the values in BUFS is not an
5313accepted value.
5314
5315`GL_INVALID_ENUM' is generated if N is less than 0.
5316
5317`GL_INVALID_OPERATION' is generated if a symbolic constant other than
5318`GL_NONE' appears more than once in BUFS.
5319
5320`GL_INVALID_OPERATION' is generated if any of the entries in BUFS (other
5321than `GL_NONE' ) indicates a color buffer that does not exist in the
5322current GL context.
5323
5324`GL_INVALID_VALUE' is generated if N is greater than
5325`GL_MAX_DRAW_BUFFERS'.
5326
5327`GL_INVALID_OPERATION' is generated if `glDrawBuffers' is executed
5328between the execution of `glBegin' and the corresponding execution of
5329`glEnd'.")
8925f36f 5330
7ec693ed 5331(define-foreign-procedure
bb894c9d 5332 ((glDrawBuffer (mode GLenum) -> void))
3c9b6116
AW
5333 "Specify which color buffers are to be drawn into.
5334
5335MODE
5336 Specifies up to four color buffers to be drawn into. Symbolic
5337 constants `GL_NONE', `GL_FRONT_LEFT', `GL_FRONT_RIGHT',
5338 `GL_BACK_LEFT', `GL_BACK_RIGHT', `GL_FRONT', `GL_BACK', `GL_LEFT',
5339 `GL_RIGHT', `GL_FRONT_AND_BACK', and `GL_AUX'I, where I is between
5340 0 and the value of `GL_AUX_BUFFERS' minus 1, are accepted.
5341 (`GL_AUX_BUFFERS' is not the upper limit; use `glGet' to query the
5342 number of available aux buffers.) The initial value is `GL_FRONT'
5343 for single-buffered contexts, and `GL_BACK' for double-buffered
5344 contexts.
5345
5346When colors are written to the frame buffer, they are written into the
5347color buffers specified by `glDrawBuffer'. The specifications are as
5348follows:
5349
5350`GL_NONE'
5351 No color buffers are written.
5352
5353`GL_FRONT_LEFT'
5354 Only the front left color buffer is written.
5355
5356`GL_FRONT_RIGHT'
5357 Only the front right color buffer is written.
5358
5359`GL_BACK_LEFT'
5360 Only the back left color buffer is written.
5361
5362`GL_BACK_RIGHT'
5363 Only the back right color buffer is written.
5364
5365`GL_FRONT'
5366 Only the front left and front right color buffers are written. If
5367 there is no front right color buffer, only the front left color
5368 buffer is written.
5369
5370`GL_BACK'
5371 Only the back left and back right color buffers are written. If
5372 there is no back right color buffer, only the back left color
5373 buffer is written.
5374
5375`GL_LEFT'
5376 Only the front left and back left color buffers are written. If
5377 there is no back left color buffer, only the front left color
5378 buffer is written.
5379
5380`GL_RIGHT'
5381 Only the front right and back right color buffers are written. If
5382 there is no back right color buffer, only the front right color
5383 buffer is written.
5384
5385`GL_FRONT_AND_BACK'
5386 All the front and back color buffers (front left, front right, back
5387 left, back right) are written. If there are no back color buffers,
5388 only the front left and front right color buffers are written. If
5389 there are no right color buffers, only the front left and back left
5390 color buffers are written. If there are no right or back color
5391 buffers, only the front left color buffer is written.
5392
5393`GL_AUX'I
5394 Only auxiliary color buffer I is written.
5395
5396If more than one color buffer is selected for drawing, then blending or
5397logical operations are computed and applied independently for each color
5398buffer and can produce different results in each buffer.
5399
5400Monoscopic contexts include only LEFT buffers, and stereoscopic contexts
5401include both LEFT and RIGHT buffers. Likewise, single-buffered contexts
5402include only FRONT buffers, and double-buffered contexts include both
5403FRONT and BACK buffers. The context is selected at GL initialization.
5404
5405`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5406
5407`GL_INVALID_OPERATION' is generated if none of the buffers indicated by
5408MODE exists.
5409
5410`GL_INVALID_OPERATION' is generated if `glDrawBuffer' is executed
5411between the execution of `glBegin' and the corresponding execution of
5412`glEnd'.")
8925f36f 5413
7ec693ed 5414(define-foreign-procedure
bb894c9d
AW
5415 ((glDrawElements
5416 (mode GLenum)
5417 (count GLsizei)
5418 (type GLenum)
5419 (indices *)
5420 ->
5421 void))
3c9b6116
AW
5422 "Render primitives from array data.
5423
5424MODE
5425 Specifies what kind of primitives to render. Symbolic constants
5426 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
5427 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
5428 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
5429
5430COUNT
5431 Specifies the number of elements to be rendered.
5432
5433TYPE
5434 Specifies the type of the values in INDICES. Must be one of
5435 `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'.
5436
5437INDICES
5438 Specifies a pointer to the location where the indices are stored.
5439
5440`glDrawElements' specifies multiple geometric primitives with very few
5441subroutine calls. Instead of calling a GL function to pass each
5442individual vertex, normal, texture coordinate, edge flag, or color, you
5443can prespecify separate arrays of vertices, normals, and so on, and use
5444them to construct a sequence of primitives with a single call to
5445`glDrawElements'.
5446
5447When `glDrawElements' is called, it uses COUNT sequential elements from
5448an enabled array, starting at INDICES to construct a sequence of
5449geometric primitives. MODE specifies what kind of primitives are
5450constructed and how the array elements construct these primitives. If
5451more than one array is enabled, each is used. If `GL_VERTEX_ARRAY' is
5452not enabled, no geometric primitives are constructed.
5453
5454Vertex attributes that are modified by `glDrawElements' have an
5455unspecified value after `glDrawElements' returns. For example, if
5456`GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
5457after `glDrawElements' executes. Attributes that aren't modified
5458maintain their previous values.
5459
5460`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5461
5462`GL_INVALID_VALUE' is generated if COUNT is negative.
5463
5464`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5465bound to an enabled array or the element array and the buffer object's
5466data store is currently mapped.
5467
5468`GL_INVALID_OPERATION' is generated if `glDrawElements' is executed
5469between the execution of `glBegin' and the corresponding `glEnd'.")
8925f36f 5470
7ec693ed 5471(define-foreign-procedure
bb894c9d
AW
5472 ((glDrawPixels
5473 (width GLsizei)
5474 (height GLsizei)
5475 (format GLenum)
5476 (type GLenum)
5477 (data *)
5478 ->
5479 void))
3c9b6116 5480 "Write a block of pixels to the frame buffer.
8925f36f 5481
3c9b6116
AW
5482WIDTH
5483 HEIGHT
8925f36f 5484
3c9b6116
AW
5485 Specify the dimensions of the pixel rectangle to be written into
5486 the frame buffer.
8925f36f 5487
3c9b6116
AW
5488FORMAT
5489 Specifies the format of the pixel data. Symbolic constants
5490 `GL_COLOR_INDEX', `GL_STENCIL_INDEX', `GL_DEPTH_COMPONENT',
5491 `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_RED', `GL_GREEN',
5492 `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA' are
5493 accepted.
8925f36f 5494
3c9b6116
AW
5495TYPE
5496 Specifies the data type for DATA. Symbolic constants
5497 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
5498 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
5499 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
5500 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
5501 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
5502 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
5503 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
5504 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
5505 are accepted.
8925f36f 5506
3c9b6116
AW
5507DATA
5508 Specifies a pointer to the pixel data.
8925f36f 5509
3c9b6116
AW
5510`glDrawPixels' reads pixel data from memory and writes it into the frame
5511buffer relative to the current raster position, provided that the raster
5512position is valid. Use `glRasterPos' or `glWindowPos' to set the current
5513raster position; use `glGet' with argument
5514`GL_CURRENT_RASTER_POSITION_VALID' to determine if the specified raster
5515position is valid, and `glGet' with argument
5516`GL_CURRENT_RASTER_POSITION' to query the raster position.
8925f36f 5517
3c9b6116
AW
5518Several parameters define the encoding of pixel data in memory and
5519control the processing of the pixel data before it is placed in the
5520frame buffer. These parameters are set with four commands:
5521`glPixelStore', `glPixelTransfer', `glPixelMap', and `glPixelZoom'. This
5522reference page describes the effects on `glDrawPixels' of many, but not
5523all, of the parameters specified by these four commands.
8925f36f 5524
3c9b6116
AW
5525Data is read from DATA as a sequence of signed or unsigned bytes, signed
5526or unsigned shorts, signed or unsigned integers, or single-precision
5527floating-point values, depending on TYPE. When TYPE is one of
5528`GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
5529`GL_UNSIGNED_INT', `GL_INT', or `GL_FLOAT' each of these bytes, shorts,
5530integers, or floating-point values is interpreted as one color or depth
5531component, or one index, depending on FORMAT. When TYPE is one of
5532`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_SHORT_5_6_5',
5533`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_5_5_5_1',
5534`GL_UNSIGNED_INT_8_8_8_8', or `GL_UNSIGNED_INT_10_10_10_2', each
5535unsigned value is interpreted as containing all the components for a
5536single pixel, with the color components arranged according to FORMAT.
5537When TYPE is one of `GL_UNSIGNED_BYTE_2_3_3_REV',
5538`GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
5539`GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8_REV', or
5540`GL_UNSIGNED_INT_2_10_10_10_REV', each unsigned value is interpreted as
5541containing all color components, specified by FORMAT, for a single pixel
5542in a reversed order. Indices are always treated individually. Color
5543components are treated as groups of one, two, three, or four values,
5544again based on FORMAT. Both individual indices and groups of components
5545are referred to as pixels. If TYPE is `GL_BITMAP', the data must be
5546unsigned bytes, and FORMAT must be either `GL_COLOR_INDEX' or
5547`GL_STENCIL_INDEX'. Each unsigned byte is treated as eight 1-bit pixels,
5548with bit ordering determined by `GL_UNPACK_LSB_FIRST' (see
5549`glPixelStore').
8925f36f 5550
3c9b6116
AW
5551WIDTH×HEIGHT pixels are read from memory, starting at location DATA. By
5552default, these pixels are taken from adjacent memory locations, except
5553that after all WIDTH pixels are read, the read pointer is advanced to
5554the next four-byte boundary. The four-byte row alignment is specified by
5555`glPixelStore' with argument `GL_UNPACK_ALIGNMENT', and it can be set to
5556one, two, four, or eight bytes. Other pixel store parameters specify
5557different read pointer advancements, both before the first pixel is read
5558and after all WIDTH pixels are read. See the `glPixelStore' reference
5559page for details on these options.
5560
5561If a non-zero named buffer object is bound to the
5562`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a block of
5563pixels is specified, DATA is treated as a byte offset into the buffer
5564object's data store.
5565
5566The WIDTH×HEIGHT pixels that are read from memory are each operated on
5567in the same way, based on the values of several parameters specified by
5568`glPixelTransfer' and `glPixelMap'. The details of these operations, as
5569well as the target buffer into which the pixels are drawn, are specific
5570to the format of the pixels, as specified by FORMAT. FORMAT can assume
5571one of 13 symbolic values:
5572
5573`GL_COLOR_INDEX'
5574 Each pixel is a single value, a color index. It is converted to
5575 fixed-point format, with an unspecified number of bits to the right
5576 of the binary point, regardless of the memory data type.
5577 Floating-point values convert to true fixed-point values. Signed
5578 and unsigned integer data is converted with all fraction bits set
5579 to 0. Bitmap data convert to either 0 or 1.
5580
5581 Each fixed-point index is then shifted left by `GL_INDEX_SHIFT'
5582 bits and added to `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is
5583 negative, the shift is to the right. In either case, zero bits fill
5584 otherwise unspecified bit locations in the result.
5585
5586 If the GL is in RGBA mode, the resulting index is converted to an
5587 RGBA pixel with the help of the `GL_PIXEL_MAP_I_TO_R',
5588 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
5589 `GL_PIXEL_MAP_I_TO_A' tables. If the GL is in color index mode, and
5590 if `GL_MAP_COLOR' is true, the index is replaced with the value
5591 that it references in lookup table `GL_PIXEL_MAP_I_TO_I'. Whether
5592 the lookup replacement of the index is done or not, the integer
5593 part of the index is then ANDed with 2^B-1 , where B is the number
5594 of bits in a color index buffer.
5595
5596 The GL then converts the resulting indices or RGBA colors to
5597 fragments by attaching the current raster position Z coordinate and
5598 texture coordinates to each pixel, then assigning X and Y window
5599 coordinates to the N th fragment such that X_N=X_R+N%WIDTH
5600 Y_N=Y_R+⌊N/WIDTH,⌋
5601
5602 where (X_R,Y_R) is the current raster position. These pixel
5603 fragments are then treated just like the fragments generated by
5604 rasterizing points, lines, or polygons. Texture mapping, fog, and
5605 all the fragment operations are applied before the fragments are
5606 written to the frame buffer.
5607
5608`GL_STENCIL_INDEX'
5609 Each pixel is a single value, a stencil index. It is converted to
5610 fixed-point format, with an unspecified number of bits to the right
5611 of the binary point, regardless of the memory data type.
5612 Floating-point values convert to true fixed-point values. Signed
5613 and unsigned integer data is converted with all fraction bits set
5614 to 0. Bitmap data convert to either 0 or 1.
5615
5616 Each fixed-point index is then shifted left by `GL_INDEX_SHIFT'
5617 bits, and added to `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is
5618 negative, the shift is to the right. In either case, zero bits fill
5619 otherwise unspecified bit locations in the result. If
5620 `GL_MAP_STENCIL' is true, the index is replaced with the value that
5621 it references in lookup table `GL_PIXEL_MAP_S_TO_S'. Whether the
5622 lookup replacement of the index is done or not, the integer part of
5623 the index is then ANDed with 2^B-1 , where B is the number of bits
5624 in the stencil buffer. The resulting stencil indices are then
5625 written to the stencil buffer such that the N th index is written
5626 to location
5627
5628 X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋
5629
5630 where (X_R,Y_R) is the current raster position. Only the pixel
5631 ownership test, the scissor test, and the stencil writemask affect
5632 these write operations.
5633
5634`GL_DEPTH_COMPONENT'
5635 Each pixel is a single-depth component. Floating-point data is
5636 converted directly to an internal floating-point format with
5637 unspecified precision. Signed integer data is mapped linearly to
5638 the internal floating-point format such that the most positive
5639 representable integer value maps to 1.0, and the most negative
5640 representable value maps to -1.0 . Unsigned integer data is mapped
5641 similarly: the largest integer value maps to 1.0, and 0 maps to
5642 0.0. The resulting floating-point depth value is then multiplied by
5643 `GL_DEPTH_SCALE' and added to `GL_DEPTH_BIAS'. The result is
5644 clamped to the range [0,1] .
5645
5646 The GL then converts the resulting depth components to fragments by
5647 attaching the current raster position color or color index and
5648 texture coordinates to each pixel, then assigning X and Y window
5649 coordinates to the N th fragment such that
5650
5651 X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋
5652
5653 where (X_R,Y_R) is the current raster position. These pixel
5654 fragments are then treated just like the fragments generated by
5655 rasterizing points, lines, or polygons. Texture mapping, fog, and
5656 all the fragment operations are applied before the fragments are
5657 written to the frame buffer.
5658
5659`GL_RGBA'
5660`GL_BGRA'
5661 Each pixel is a four-component group: For `GL_RGBA', the red
5662 component is first, followed by green, followed by blue, followed
5663 by alpha; for `GL_BGRA' the order is blue, green, red and then
5664 alpha. Floating-point values are converted directly to an internal
5665 floating-point format with unspecified precision. Signed integer
5666 values are mapped linearly to the internal floating-point format
5667 such that the most positive representable integer value maps to
5668 1.0, and the most negative representable value maps to -1.0 . (Note
5669 that this mapping does not convert 0 precisely to 0.0.) Unsigned
5670 integer data is mapped similarly: The largest integer value maps to
5671 1.0, and 0 maps to 0.0. The resulting floating-point color values
5672 are then multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where
5673 C is RED, GREEN, BLUE, and ALPHA for the respective color
5674 components. The results are clamped to the range [0,1] .
5675
5676 If `GL_MAP_COLOR' is true, each color component is scaled by the
5677 size of lookup table `GL_PIXEL_MAP_c_TO_c', then replaced by the
5678 value that it references in that table. C is R, G, B, or A
5679 respectively.
5680
5681 The GL then converts the resulting RGBA colors to fragments by
5682 attaching the current raster position Z coordinate and texture
5683 coordinates to each pixel, then assigning X and Y window
5684 coordinates to the N th fragment such that
5685
5686 X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋
5687
5688 where (X_R,Y_R) is the current raster position. These pixel
5689 fragments are then treated just like the fragments generated by
5690 rasterizing points, lines, or polygons. Texture mapping, fog, and
5691 all the fragment operations are applied before the fragments are
5692 written to the frame buffer.
5693
5694`GL_RED'
5695 Each pixel is a single red component. This component is converted
5696 to the internal floating-point format in the same way the red
5697 component of an RGBA pixel is. It is then converted to an RGBA
5698 pixel with green and blue set to 0, and alpha set to 1. After this
5699 conversion, the pixel is treated as if it had been read as an RGBA
5700 pixel.
5701
5702`GL_GREEN'
5703 Each pixel is a single green component. This component is converted
5704 to the internal floating-point format in the same way the green
5705 component of an RGBA pixel is. It is then converted to an RGBA
5706 pixel with red and blue set to 0, and alpha set to 1. After this
5707 conversion, the pixel is treated as if it had been read as an RGBA
5708 pixel.
5709
5710`GL_BLUE'
5711 Each pixel is a single blue component. This component is converted
5712 to the internal floating-point format in the same way the blue
5713 component of an RGBA pixel is. It is then converted to an RGBA
5714 pixel with red and green set to 0, and alpha set to 1. After this
5715 conversion, the pixel is treated as if it had been read as an RGBA
5716 pixel.
5717
5718`GL_ALPHA'
5719 Each pixel is a single alpha component. This component is converted
5720 to the internal floating-point format in the same way the alpha
5721 component of an RGBA pixel is. It is then converted to an RGBA
5722 pixel with red, green, and blue set to 0. After this conversion,
5723 the pixel is treated as if it had been read as an RGBA pixel.
5724
5725`GL_RGB'
5726`GL_BGR'
5727 Each pixel is a three-component group: red first, followed by
5728 green, followed by blue; for `GL_BGR', the first component is blue,
5729 followed by green and then red. Each component is converted to the
5730 internal floating-point format in the same way the red, green, and
5731 blue components of an RGBA pixel are. The color triple is converted
5732 to an RGBA pixel with alpha set to 1. After this conversion, the
5733 pixel is treated as if it had been read as an RGBA pixel.
5734
5735`GL_LUMINANCE'
5736 Each pixel is a single luminance component. This component is
5737 converted to the internal floating-point format in the same way the
5738 red component of an RGBA pixel is. It is then converted to an RGBA
5739 pixel with red, green, and blue set to the converted luminance
5740 value, and alpha set to 1. After this conversion, the pixel is
5741 treated as if it had been read as an RGBA pixel.
5742
5743`GL_LUMINANCE_ALPHA'
5744 Each pixel is a two-component group: luminance first, followed by
5745 alpha. The two components are converted to the internal
5746 floating-point format in the same way the red component of an RGBA
5747 pixel is. They are then converted to an RGBA pixel with red, green,
5748 and blue set to the converted luminance value, and alpha set to the
5749 converted alpha value. After this conversion, the pixel is treated
5750 as if it had been read as an RGBA pixel.
5751
5752The following table summarizes the meaning of the valid constants for
5753the TYPE parameter:
5754
5755
5756
5757*Type*
5758 *Corresponding Type*
5759
5760`GL_UNSIGNED_BYTE'
5761 unsigned 8-bit integer
5762
5763`GL_BYTE'
5764 signed 8-bit integer
5765
5766`GL_BITMAP'
5767 single bits in unsigned 8-bit integers
5768
5769`GL_UNSIGNED_SHORT'
5770 unsigned 16-bit integer
5771
5772`GL_SHORT'
5773 signed 16-bit integer
5774
5775`GL_UNSIGNED_INT'
5776 unsigned 32-bit integer
5777
5778`GL_INT'
5779 32-bit integer
5780
5781`GL_FLOAT'
5782 single-precision floating-point
5783
5784`GL_UNSIGNED_BYTE_3_3_2'
5785 unsigned 8-bit integer
5786
5787`GL_UNSIGNED_BYTE_2_3_3_REV'
5788 unsigned 8-bit integer with reversed component ordering
5789
5790`GL_UNSIGNED_SHORT_5_6_5'
5791 unsigned 16-bit integer
5792
5793`GL_UNSIGNED_SHORT_5_6_5_REV'
5794 unsigned 16-bit integer with reversed component ordering
5795
5796`GL_UNSIGNED_SHORT_4_4_4_4'
5797 unsigned 16-bit integer
5798
5799`GL_UNSIGNED_SHORT_4_4_4_4_REV'
5800 unsigned 16-bit integer with reversed component ordering
5801
5802`GL_UNSIGNED_SHORT_5_5_5_1'
5803 unsigned 16-bit integer
5804
5805`GL_UNSIGNED_SHORT_1_5_5_5_REV'
5806 unsigned 16-bit integer with reversed component ordering
5807
5808`GL_UNSIGNED_INT_8_8_8_8'
5809 unsigned 32-bit integer
5810
5811`GL_UNSIGNED_INT_8_8_8_8_REV'
5812 unsigned 32-bit integer with reversed component ordering
5813
5814`GL_UNSIGNED_INT_10_10_10_2'
5815 unsigned 32-bit integer
5816
5817`GL_UNSIGNED_INT_2_10_10_10_REV'
5818 unsigned 32-bit integer with reversed component ordering
5819
5820
5821
5822The rasterization described so far assumes pixel zoom factors of 1. If
5823`glPixelZoom' is used to change the X and Y pixel zoom factors, pixels
5824are converted to fragments as follows. If (X_R,Y_R) is the current
5825raster position, and a given pixel is in the N th column and M th row of
5826the pixel rectangle, then fragments are generated for pixels whose
5827centers are in the rectangle with corners at
5828
5829(X_R+ZOOM_X,\u2062N,Y_R+ZOOM_Y,\u2062M) (X_R+ZOOM_X,\u2061(N+1,),Y_R+ZOOM_Y,\u2061(M+1,))
5830
5831where ZOOM_X is the value of `GL_ZOOM_X' and ZOOM_Y is the value of
5832`GL_ZOOM_Y'.
5833
5834`GL_INVALID_ENUM' is generated if FORMAT or TYPE is not one of the
5835accepted values.
5836
5837`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
5838either `GL_COLOR_INDEX' or `GL_STENCIL_INDEX'.
5839
5840`GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
5841
5842`GL_INVALID_OPERATION' is generated if FORMAT is `GL_STENCIL_INDEX' and
5843there is no stencil buffer.
5844
5845`GL_INVALID_OPERATION' is generated if FORMAT is `GL_RED', `GL_GREEN',
5846`GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_RGBA', `GL_BGR', `GL_BGRA',
5847`GL_LUMINANCE', or `GL_LUMINANCE_ALPHA', and the GL is in color index
5848mode.
5849
5850`GL_INVALID_OPERATION' is generated if FORMAT is one of
5851`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
5852`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
5853is not `GL_RGB'.
5854
5855`GL_INVALID_OPERATION' is generated if FORMAT is one of
5856`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
5857`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
5858`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
5859`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
5860FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
5861
5862`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5863bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
5864data store is currently mapped.
5865
5866`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5867bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
5868unpacked from the buffer object such that the memory reads required
5869would exceed the data store size.
5870
5871`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5872bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
5873divisible into the number of bytes needed to store in memory a datum
5874indicated by TYPE.
5875
5876`GL_INVALID_OPERATION' is generated if `glDrawPixels' is executed
5877between the execution of `glBegin' and the corresponding execution of
5878`glEnd'.")
8925f36f 5879
7ec693ed 5880(define-foreign-procedure
bb894c9d
AW
5881 ((glDrawRangeElements
5882 (mode GLenum)
5883 (start GLuint)
5884 (end GLuint)
5885 (count GLsizei)
5886 (type GLenum)
5887 (indices *)
5888 ->
5889 void))
3c9b6116 5890 "Render primitives from array data.
8925f36f 5891
3c9b6116
AW
5892MODE
5893 Specifies what kind of primitives to render. Symbolic constants
5894 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
5895 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
5896 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
8925f36f 5897
3c9b6116
AW
5898START
5899 Specifies the minimum array index contained in INDICES.
5900
5901END
5902 Specifies the maximum array index contained in INDICES.
5903
5904COUNT
5905 Specifies the number of elements to be rendered.
5906
5907TYPE
5908 Specifies the type of the values in INDICES. Must be one of
5909 `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'.
5910
5911INDICES
5912 Specifies a pointer to the location where the indices are stored.
5913
5914`glDrawRangeElements' is a restricted form of `glDrawElements'. MODE,
5915START, END, and COUNT match the corresponding arguments to
5916`glDrawElements', with the additional constraint that all values in the
5917arrays COUNT must lie between START and END, inclusive.
5918
5919Implementations denote recommended maximum amounts of vertex and index
5920data, which may be queried by calling `glGet' with argument
5921`GL_MAX_ELEMENTS_VERTICES' and `GL_MAX_ELEMENTS_INDICES'. If END-START+1
5922is greater than the value of `GL_MAX_ELEMENTS_VERTICES', or if COUNT is
5923greater than the value of `GL_MAX_ELEMENTS_INDICES', then the call may
5924operate at reduced performance. There is no requirement that all
5925vertices in the range [START,END] be referenced. However, the
5926implementation may partially process unused vertices, reducing
5927performance from what could be achieved with an optimal index set.
5928
5929When `glDrawRangeElements' is called, it uses COUNT sequential elements
5930from an enabled array, starting at START to construct a sequence of
5931geometric primitives. MODE specifies what kind of primitives are
5932constructed, and how the array elements construct these primitives. If
5933more than one array is enabled, each is used. If `GL_VERTEX_ARRAY' is
5934not enabled, no geometric primitives are constructed.
5935
5936Vertex attributes that are modified by `glDrawRangeElements' have an
5937unspecified value after `glDrawRangeElements' returns. For example, if
5938`GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
5939after `glDrawRangeElements' executes. Attributes that aren't modified
5940maintain their previous values.
5941
5942It is an error for indices to lie outside the range [START,END] , but
5943implementations may not check for this situation. Such indices cause
5944implementation-dependent behavior.
5945
5946`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5947
5948`GL_INVALID_VALUE' is generated if COUNT is negative.
5949
5950`GL_INVALID_VALUE' is generated if END<START .
5951
5952`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5953bound to an enabled array or the element array and the buffer object's
5954data store is currently mapped.
5955
5956`GL_INVALID_OPERATION' is generated if `glDrawRangeElements' is executed
5957between the execution of `glBegin' and the corresponding `glEnd'.")
8925f36f 5958
7ec693ed 5959(define-foreign-procedure
bb894c9d
AW
5960 ((glEdgeFlagPointer
5961 (stride GLsizei)
5962 (pointer *)
5963 ->
5964 void))
3c9b6116 5965 "Define an array of edge flags.
8925f36f 5966
3c9b6116
AW
5967STRIDE
5968 Specifies the byte offset between consecutive edge flags. If STRIDE
5969 is 0, the edge flags are understood to be tightly packed in the
5970 array. The initial value is 0.
8925f36f 5971
3c9b6116
AW
5972POINTER
5973 Specifies a pointer to the first edge flag in the array. The
5974 initial value is 0.
8925f36f 5975
3c9b6116
AW
5976`glEdgeFlagPointer' specifies the location and data format of an array
5977of boolean edge flags to use when rendering. STRIDE specifies the byte
5978stride from one edge flag to the next, allowing vertices and attributes
5979to be packed into a single array or stored in separate arrays.
8925f36f 5980
3c9b6116
AW
5981If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
5982target (see `glBindBuffer') while an edge flag array is specified,
5983POINTER is treated as a byte offset into the buffer object's data store.
5984Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
5985edge flag vertex array client-side state
5986(`GL_EDGE_FLAG_ARRAY_BUFFER_BINDING').
8925f36f 5987
3c9b6116
AW
5988When an edge flag array is specified, STRIDE and POINTER are saved as
5989client-side state, in addition to the current vertex array buffer object
5990binding.
5991
5992To enable and disable the edge flag array, call `glEnableClientState'
5993and `glDisableClientState' with the argument `GL_EDGE_FLAG_ARRAY'. If
5994enabled, the edge flag array is used when `glDrawArrays',
5995`glMultiDrawArrays', `glDrawElements', `glMultiDrawElements',
5996`glDrawRangeElements', or `glArrayElement' is called.
5997
5998`GL_INVALID_ENUM' is generated if STRIDE is negative.")
8925f36f 5999
7ec693ed 6000(define-foreign-procedure
bb894c9d 6001 ((glEdgeFlag (flag GLboolean) -> void))
3c9b6116
AW
6002 "Flag edges as either boundary or nonboundary.
6003
6004FLAG
6005 Specifies the current edge flag value, either `GL_TRUE' or
6006 `GL_FALSE'. The initial value is `GL_TRUE'.
6007
6008Each vertex of a polygon, separate triangle, or separate quadrilateral
6009specified between a `glBegin'/`glEnd' pair is marked as the start of
6010either a boundary or nonboundary edge. If the current edge flag is true
6011when the vertex is specified, the vertex is marked as the start of a
6012boundary edge. Otherwise, the vertex is marked as the start of a
6013nonboundary edge. `glEdgeFlag' sets the edge flag bit to `GL_TRUE' if
6014FLAG is `GL_TRUE' and to `GL_FALSE' otherwise.
6015
6016The vertices of connected triangles and connected quadrilaterals are
6017always marked as boundary, regardless of the value of the edge flag.
6018
6019Boundary and nonboundary edge flags on vertices are significant only if
6020`GL_POLYGON_MODE' is set to `GL_POINT' or `GL_LINE'. See
6021`glPolygonMode'.")
8925f36f 6022
7ec693ed 6023(define-foreign-procedure
bb894c9d
AW
6024 ((glEnableClientState (cap GLenum) -> void)
6025 (glDisableClientState (cap GLenum) -> void))
3c9b6116
AW
6026 "Enable or disable client-side capability.
6027
6028CAP
6029 Specifies the capability to enable. Symbolic constants
6030 `GL_COLOR_ARRAY', `GL_EDGE_FLAG_ARRAY', `GL_FOG_COORD_ARRAY',
6031 `GL_INDEX_ARRAY', `GL_NORMAL_ARRAY', `GL_SECONDARY_COLOR_ARRAY',
6032 `GL_TEXTURE_COORD_ARRAY', and `GL_VERTEX_ARRAY' are accepted.
6033
6034`glEnableClientState' and `glDisableClientState' enable or disable
6035individual client-side capabilities. By default, all client-side
6036capabilities are disabled. Both `glEnableClientState' and
6037`glDisableClientState' take a single argument, CAP, which can assume one
6038of the following values:
6039
6040`GL_COLOR_ARRAY'
6041 If enabled, the color array is enabled for writing and used during
6042 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6043 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6044 is called. See `glColorPointer'.
6045
6046`GL_EDGE_FLAG_ARRAY'
6047 If enabled, the edge flag array is enabled for writing and used
6048 during rendering when `glArrayElement', `glDrawArrays',
6049 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6050 `glMultiDrawElements' is called. See `glEdgeFlagPointer'.
6051
6052`GL_FOG_COORD_ARRAY'
6053 If enabled, the fog coordinate array is enabled for writing and
6054 used during rendering when `glArrayElement', `glDrawArrays',
6055 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6056 `glMultiDrawElements' is called. See `glFogCoordPointer'.
6057
6058`GL_INDEX_ARRAY'
6059 If enabled, the index array is enabled for writing and used during
6060 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6061 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6062 is called. See `glIndexPointer'.
6063
6064`GL_NORMAL_ARRAY'
6065 If enabled, the normal array is enabled for writing and used during
6066 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6067 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6068 is called. See `glNormalPointer'.
6069
6070`GL_SECONDARY_COLOR_ARRAY'
6071 If enabled, the secondary color array is enabled for writing and
6072 used during rendering when `glArrayElement', `glDrawArrays',
6073 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6074 `glMultiDrawElements' is called. See `glColorPointer'.
6075
6076`GL_TEXTURE_COORD_ARRAY'
6077 If enabled, the texture coordinate array is enabled for writing and
6078 used during rendering when `glArrayElement', `glDrawArrays',
6079 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6080 `glMultiDrawElements' is called. See `glTexCoordPointer'.
6081
6082`GL_VERTEX_ARRAY'
6083 If enabled, the vertex array is enabled for writing and used during
6084 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6085 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6086 is called. See `glVertexPointer'.
6087
6088`GL_INVALID_ENUM' is generated if CAP is not an accepted value.
6089
6090`glEnableClientState' is not allowed between the execution of `glBegin'
6091and the corresponding `glEnd', but an error may or may not be generated.
6092If no error is generated, the behavior is undefined.")
8925f36f 6093
7ec693ed 6094(define-foreign-procedure
bb894c9d
AW
6095 ((glEnableVertexAttribArray
6096 (index GLuint)
6097 ->
6098 void)
6099 (glDisableVertexAttribArray
6100 (index GLuint)
6101 ->
6102 void))
3c9b6116
AW
6103 "Enable or disable a generic vertex attribute array.
6104
6105INDEX
6106 Specifies the index of the generic vertex attribute to be enabled
6107 or disabled.
6108
6109`glEnableVertexAttribArray' enables the generic vertex attribute array
6110specified by INDEX. `glDisableVertexAttribArray' disables the generic
6111vertex attribute array specified by INDEX. By default, all client-side
6112capabilities are disabled, including all generic vertex attribute
6113arrays. If enabled, the values in the generic vertex attribute array
6114will be accessed and used for rendering when calls are made to vertex
6115array commands such as `glDrawArrays', `glDrawElements',
6116`glDrawRangeElements', `glArrayElement', `glMultiDrawElements', or
6117`glMultiDrawArrays'.
6118
6119`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
6120`GL_MAX_VERTEX_ATTRIBS'.
6121
6122`GL_INVALID_OPERATION' is generated if either `glEnableVertexAttribArray
6123' or `glDisableVertexAttribArray ' is executed between the execution of
6124`glBegin' and the corresponding execution of `glEnd'.")
8925f36f 6125
7ec693ed 6126(define-foreign-procedure
bb894c9d
AW
6127 ((glEnable (cap GLenum) -> void)
6128 (glDisable (cap GLenum) -> void))
3c9b6116
AW
6129 "Enable or disable server-side GL capabilities.
6130
6131CAP
6132 Specifies a symbolic constant indicating a GL capability.
6133
6134`glEnable' and `glDisable' enable and disable various capabilities. Use
6135`glIsEnabled' or `glGet' to determine the current setting of any
6136capability. The initial value for each capability with the exception of
6137`GL_DITHER' and `GL_MULTISAMPLE' is `GL_FALSE'. The initial value for
6138`GL_DITHER' and `GL_MULTISAMPLE' is `GL_TRUE'.
6139
6140Both `glEnable' and `glDisable' take a single argument, CAP, which can
6141assume one of the following values:
6142
6143`GL_ALPHA_TEST'
6144
6145
6146 If enabled, do alpha testing. See `glAlphaFunc'.
6147
6148`GL_AUTO_NORMAL'
6149
6150
6151 If enabled, generate normal vectors when either `GL_MAP2_VERTEX_3'
6152 or `GL_MAP2_VERTEX_4' is used to generate vertices. See `glMap2'.
6153
6154`GL_BLEND'
6155
6156
6157 If enabled, blend the computed fragment color values with the
6158 values in the color buffers. See `glBlendFunc'.
6159
6160`GL_CLIP_PLANE'I
6161
6162
6163 If enabled, clip geometry against user-defined clipping plane I.
6164 See `glClipPlane'.
6165
6166`GL_COLOR_LOGIC_OP'
6167
6168
6169 If enabled, apply the currently selected logical operation to the
6170 computed fragment color and color buffer values. See `glLogicOp'.
6171
6172`GL_COLOR_MATERIAL'
6173
6174
6175 If enabled, have one or more material parameters track the current
6176 color. See `glColorMaterial'.
6177
6178`GL_COLOR_SUM'
6179
6180
6181 If enabled and no fragment shader is active, add the secondary
6182 color value to the computed fragment color. See `glSecondaryColor'.
6183
6184`GL_COLOR_TABLE'
6185
6186
6187 If enabled, perform a color table lookup on the incoming RGBA color
6188 values. See `glColorTable'.
6189
6190`GL_CONVOLUTION_1D'
6191
6192
6193 If enabled, perform a 1D convolution operation on incoming RGBA
6194 color values. See `glConvolutionFilter1D'.
6195
6196`GL_CONVOLUTION_2D'
6197
6198
6199 If enabled, perform a 2D convolution operation on incoming RGBA
6200 color values. See `glConvolutionFilter2D'.
6201
6202`GL_CULL_FACE'
6203
6204
6205 If enabled, cull polygons based on their winding in window
6206 coordinates. See `glCullFace'.
6207
6208`GL_DEPTH_TEST'
6209
6210
6211 If enabled, do depth comparisons and update the depth buffer. Note
6212 that even if the depth buffer exists and the depth mask is
6213 non-zero, the depth buffer is not updated if the depth test is
6214 disabled. See `glDepthFunc' and `glDepthRange'.
6215
6216`GL_DITHER'
6217
6218
6219 If enabled, dither color components or indices before they are
6220 written to the color buffer.
6221
6222`GL_FOG'
6223
6224
6225 If enabled and no fragment shader is active, blend a fog color into
6226 the post-texturing color. See `glFog'.
6227
6228`GL_HISTOGRAM'
6229
6230
6231 If enabled, histogram incoming RGBA color values. See
6232 `glHistogram'.
6233
6234`GL_INDEX_LOGIC_OP'
6235
6236
6237 If enabled, apply the currently selected logical operation to the
6238 incoming index and color buffer indices. See `glLogicOp'.
6239
6240`GL_LIGHT'I
6241
6242
6243 If enabled, include light I in the evaluation of the lighting
6244 equation. See `glLightModel' and `glLight'.
6245
6246`GL_LIGHTING'
6247
6248
6249 If enabled and no vertex shader is active, use the current lighting
6250 parameters to compute the vertex color or index. Otherwise, simply
6251 associate the current color or index with each vertex. See
6252 `glMaterial', `glLightModel', and `glLight'.
6253
6254`GL_LINE_SMOOTH'
6255
6256
6257 If enabled, draw lines with correct filtering. Otherwise, draw
6258 aliased lines. See `glLineWidth'.
6259
6260`GL_LINE_STIPPLE'
6261
6262
6263 If enabled, use the current line stipple pattern when drawing
6264 lines. See `glLineStipple'.
6265
6266`GL_MAP1_COLOR_4'
6267
6268
6269 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6270 `glEvalPoint1' generate RGBA values. See `glMap1'.
6271
6272`GL_MAP1_INDEX'
6273
6274
6275 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6276 `glEvalPoint1' generate color indices. See `glMap1'.
6277
6278`GL_MAP1_NORMAL'
6279
6280
6281 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6282 `glEvalPoint1' generate normals. See `glMap1'.
6283
6284`GL_MAP1_TEXTURE_COORD_1'
6285
6286
6287 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6288 `glEvalPoint1' generate S texture coordinates. See `glMap1'.
6289
6290`GL_MAP1_TEXTURE_COORD_2'
6291
6292
6293 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6294 `glEvalPoint1' generate S and T texture coordinates. See `glMap1'.
6295
6296`GL_MAP1_TEXTURE_COORD_3'
6297
6298
6299 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6300 `glEvalPoint1' generate S, T, and R texture coordinates. See
6301 `glMap1'.
6302
6303`GL_MAP1_TEXTURE_COORD_4'
6304
6305
6306 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6307 `glEvalPoint1' generate S, T, R, and Q texture coordinates. See
6308 `glMap1'.
6309
6310`GL_MAP1_VERTEX_3'
6311
6312
6313 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6314 `glEvalPoint1' generate X, Y, and Z vertex coordinates. See
6315 `glMap1'.
6316
6317`GL_MAP1_VERTEX_4'
6318
6319
6320 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6321 `glEvalPoint1' generate homogeneous X, Y, Z, and W vertex
6322 coordinates. See `glMap1'.
6323
6324`GL_MAP2_COLOR_4'
6325
6326
6327 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6328 `glEvalPoint2' generate RGBA values. See `glMap2'.
6329
6330`GL_MAP2_INDEX'
6331
6332
6333 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6334 `glEvalPoint2' generate color indices. See `glMap2'.
6335
6336`GL_MAP2_NORMAL'
6337
6338
6339 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6340 `glEvalPoint2' generate normals. See `glMap2'.
6341
6342`GL_MAP2_TEXTURE_COORD_1'
6343
6344
6345 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6346 `glEvalPoint2' generate S texture coordinates. See `glMap2'.
6347
6348`GL_MAP2_TEXTURE_COORD_2'
6349
6350
6351 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6352 `glEvalPoint2' generate S and T texture coordinates. See `glMap2'.
6353
6354`GL_MAP2_TEXTURE_COORD_3'
6355
6356
6357 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6358 `glEvalPoint2' generate S, T, and R texture coordinates. See
6359 `glMap2'.
6360
6361`GL_MAP2_TEXTURE_COORD_4'
6362
6363
6364 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6365 `glEvalPoint2' generate S, T, R, and Q texture coordinates. See
6366 `glMap2'.
6367
6368`GL_MAP2_VERTEX_3'
6369
6370
6371 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6372 `glEvalPoint2' generate X, Y, and Z vertex coordinates. See
6373 `glMap2'.
6374
6375`GL_MAP2_VERTEX_4'
6376
6377
6378 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6379 `glEvalPoint2' generate homogeneous X, Y, Z, and W vertex
6380 coordinates. See `glMap2'.
6381
6382`GL_MINMAX'
6383
6384
6385 If enabled, compute the minimum and maximum values of incoming RGBA
6386 color values. See `glMinmax'.
6387
6388`GL_MULTISAMPLE'
6389
6390
6391 If enabled, use multiple fragment samples in computing the final
6392 color of a pixel. See `glSampleCoverage'.
6393
6394`GL_NORMALIZE'
6395
6396
6397 If enabled and no vertex shader is active, normal vectors are
6398 normalized to unit length after transformation and before lighting.
6399 This method is generally less efficient than `GL_RESCALE_NORMAL'.
6400 See `glNormal' and `glNormalPointer'.
6401
6402`GL_POINT_SMOOTH'
6403
6404
6405 If enabled, draw points with proper filtering. Otherwise, draw
6406 aliased points. See `glPointSize'.
6407
6408`GL_POINT_SPRITE'
6409
6410
6411 If enabled, calculate texture coordinates for points based on
6412 texture environment and point parameter settings. Otherwise texture
6413 coordinates are constant across points.
6414
6415`GL_POLYGON_OFFSET_FILL'
6416
6417
6418 If enabled, and if the polygon is rendered in `GL_FILL' mode, an
6419 offset is added to depth values of a polygon's fragments before the
6420 depth comparison is performed. See `glPolygonOffset'.
6421
6422`GL_POLYGON_OFFSET_LINE'
6423
6424
6425 If enabled, and if the polygon is rendered in `GL_LINE' mode, an
6426 offset is added to depth values of a polygon's fragments before the
6427 depth comparison is performed. See `glPolygonOffset'.
6428
6429`GL_POLYGON_OFFSET_POINT'
6430
6431
6432 If enabled, an offset is added to depth values of a polygon's
6433 fragments before the depth comparison is performed, if the polygon
6434 is rendered in `GL_POINT' mode. See `glPolygonOffset'.
6435
6436`GL_POLYGON_SMOOTH'
6437
6438
6439 If enabled, draw polygons with proper filtering. Otherwise, draw
6440 aliased polygons. For correct antialiased polygons, an alpha buffer
6441 is needed and the polygons must be sorted front to back.
6442
6443`GL_POLYGON_STIPPLE'
6444
6445
6446 If enabled, use the current polygon stipple pattern when rendering
6447 polygons. See `glPolygonStipple'.
6448
6449`GL_POST_COLOR_MATRIX_COLOR_TABLE'
6450
6451
6452 If enabled, perform a color table lookup on RGBA color values after
6453 color matrix transformation. See `glColorTable'.
6454
6455`GL_POST_CONVOLUTION_COLOR_TABLE'
6456
6457
6458 If enabled, perform a color table lookup on RGBA color values after
6459 convolution. See `glColorTable'.
6460
6461`GL_RESCALE_NORMAL'
6462
6463
6464 If enabled and no vertex shader is active, normal vectors are
6465 scaled after transformation and before lighting by a factor
6466 computed from the modelview matrix. If the modelview matrix scales
6467 space uniformly, this has the effect of restoring the transformed
6468 normal to unit length. This method is generally more efficient than
6469 `GL_NORMALIZE'. See `glNormal' and `glNormalPointer'.
6470
6471`GL_SAMPLE_ALPHA_TO_COVERAGE'
6472
6473
6474 If enabled, compute a temporary coverage value where each bit is
6475 determined by the alpha value at the corresponding sample location.
6476 The temporary coverage value is then ANDed with the fragment
6477 coverage value.
6478
6479`GL_SAMPLE_ALPHA_TO_ONE'
6480
6481
6482 If enabled, each sample alpha value is replaced by the maximum
6483 representable alpha value.
6484
6485`GL_SAMPLE_COVERAGE'
6486
6487
6488 If enabled, the fragment's coverage is ANDed with the temporary
6489 coverage value. If `GL_SAMPLE_COVERAGE_INVERT' is set to `GL_TRUE',
6490 invert the coverage value. See `glSampleCoverage'.
6491
6492`GL_SEPARABLE_2D'
6493
6494
6495 If enabled, perform a two-dimensional convolution operation using a
6496 separable convolution filter on incoming RGBA color values. See
6497 `glSeparableFilter2D'.
6498
6499`GL_SCISSOR_TEST'
6500
6501
6502 If enabled, discard fragments that are outside the scissor
6503 rectangle. See `glScissor'.
6504
6505`GL_STENCIL_TEST'
6506
6507
6508 If enabled, do stencil testing and update the stencil buffer. See
6509 `glStencilFunc' and `glStencilOp'.
6510
6511`GL_TEXTURE_1D'
6512
6513
6514 If enabled and no fragment shader is active, one-dimensional
6515 texturing is performed (unless two- or three-dimensional or
6516 cube-mapped texturing is also enabled). See `glTexImage1D'.
6517
6518`GL_TEXTURE_2D'
6519
6520
6521 If enabled and no fragment shader is active, two-dimensional
6522 texturing is performed (unless three-dimensional or cube-mapped
6523 texturing is also enabled). See `glTexImage2D'.
6524
6525`GL_TEXTURE_3D'
6526
6527
6528 If enabled and no fragment shader is active, three-dimensional
6529 texturing is performed (unless cube-mapped texturing is also
6530 enabled). See `glTexImage3D'.
6531
6532`GL_TEXTURE_CUBE_MAP'
6533
6534
6535 If enabled and no fragment shader is active, cube-mapped texturing
6536 is performed. See `glTexImage2D'.
6537
6538`GL_TEXTURE_GEN_Q'
6539
6540
6541 If enabled and no vertex shader is active, the Q texture coordinate
6542 is computed using the texture generation function defined with
6543 `glTexGen'. Otherwise, the current Q texture coordinate is used.
6544 See `glTexGen'.
6545
6546`GL_TEXTURE_GEN_R'
6547
6548
6549 If enabled and no vertex shader is active, the R texture coordinate
6550 is computed using the texture generation function defined with
6551 `glTexGen'. Otherwise, the current R texture coordinate is used.
6552 See `glTexGen'.
6553
6554`GL_TEXTURE_GEN_S'
6555
6556
6557 If enabled and no vertex shader is active, the S texture coordinate
6558 is computed using the texture generation function defined with
6559 `glTexGen'. Otherwise, the current S texture coordinate is used.
6560 See `glTexGen'.
6561
6562`GL_TEXTURE_GEN_T'
6563
6564
6565 If enabled and no vertex shader is active, the T texture coordinate
6566 is computed using the texture generation function defined with
6567 `glTexGen'. Otherwise, the current T texture coordinate is used.
6568 See `glTexGen'.
6569
6570`GL_VERTEX_PROGRAM_POINT_SIZE'
6571
6572
6573 If enabled and a vertex shader is active, then the derived point
6574 size is taken from the (potentially clipped) shader builtin
6575 `gl_PointSize' and clamped to the implementation-dependent point
6576 size range.
6577
6578`GL_VERTEX_PROGRAM_TWO_SIDE'
6579
6580
6581 If enabled and a vertex shader is active, it specifies that the GL
6582 will choose between front and back colors based on the polygon's
6583 face direction of which the vertex being shaded is a part. It has
6584 no effect on points or lines.
6585
6586`GL_INVALID_ENUM' is generated if CAP is not one of the values listed
6587previously.
6588
6589`GL_INVALID_OPERATION' is generated if `glEnable' or `glDisable' is
6590executed between the execution of `glBegin' and the corresponding
6591execution of `glEnd'.")
6592
7ec693ed 6593(define-foreign-procedure
bb894c9d
AW
6594 ((glEvalCoord1d (u GLdouble) -> void)
6595 (glEvalCoord2d (u GLdouble) (v GLdouble) -> void))
3c9b6116
AW
6596 "Evaluate enabled one- and two-dimensional maps.
6597
6598U
6599 Specifies a value that is the domain coordinate U to the basis
6600 function defined in a previous `glMap1' or `glMap2' command.
6601
6602V
6603 Specifies a value that is the domain coordinate V to the basis
6604 function defined in a previous `glMap2' command. This argument is
6605 not present in a `glEvalCoord1' command.
6606
6607`glEvalCoord1' evaluates enabled one-dimensional maps at argument U.
6608`glEvalCoord2' does the same for two-dimensional maps using two domain
6609values, U and V. To define a map, call `glMap1' and `glMap2'; to enable
6610and disable it, call `glEnable' and `glDisable'.
6611
6612When one of the `glEvalCoord' commands is issued, all currently enabled
6613maps of the indicated dimension are evaluated. Then, for each enabled
6614map, it is as if the corresponding GL command had been issued with the
6615computed value. That is, if `GL_MAP1_INDEX' or `GL_MAP2_INDEX' is
6616enabled, a `glIndex' command is simulated. If `GL_MAP1_COLOR_4' or
6617`GL_MAP2_COLOR_4' is enabled, a `glColor' command is simulated. If
6618`GL_MAP1_NORMAL' or `GL_MAP2_NORMAL' is enabled, a normal vector is
6619produced, and if any of `GL_MAP1_TEXTURE_COORD_1',
6620`GL_MAP1_TEXTURE_COORD_2', `GL_MAP1_TEXTURE_COORD_3',
6621`GL_MAP1_TEXTURE_COORD_4', `GL_MAP2_TEXTURE_COORD_1',
6622`GL_MAP2_TEXTURE_COORD_2', `GL_MAP2_TEXTURE_COORD_3', or
6623`GL_MAP2_TEXTURE_COORD_4' is enabled, then an appropriate `glTexCoord'
6624command is simulated.
6625
6626For color, color index, normal, and texture coordinates the GL uses
6627evaluated values instead of current values for those evaluations that
6628are enabled, and current values otherwise, However, the evaluated values
6629do not update the current values. Thus, if `glVertex' commands are
6630interspersed with `glEvalCoord' commands, the color, normal, and texture
6631coordinates associated with the `glVertex' commands are not affected by
6632the values generated by the `glEvalCoord' commands, but only by the most
6633recent `glColor', `glIndex', `glNormal', and `glTexCoord' commands.
6634
6635No commands are issued for maps that are not enabled. If more than one
6636texture evaluation is enabled for a particular dimension (for example,
6637`GL_MAP2_TEXTURE_COORD_1' and `GL_MAP2_TEXTURE_COORD_2'), then only the
6638evaluation of the map that produces the larger number of coordinates (in
6639this case, `GL_MAP2_TEXTURE_COORD_2') is carried out. `GL_MAP1_VERTEX_4'
6640overrides `GL_MAP1_VERTEX_3', and `GL_MAP2_VERTEX_4' overrides
6641`GL_MAP2_VERTEX_3', in the same manner. If neither a three- nor a
6642four-component vertex map is enabled for the specified dimension, the
6643`glEvalCoord' command is ignored.
6644
6645If you have enabled automatic normal generation, by calling `glEnable'
6646with argument `GL_AUTO_NORMAL', `glEvalCoord2' generates surface normals
6647analytically, regardless of the contents or enabling of the
6648`GL_MAP2_NORMAL' map. Let
6649
6650`m'=∂`p',/∂U,,×∂`p',/∂V,,
6651
6652Then the generated normal `n' is `n'=`m'/∥`m',∥,
6653
6654If automatic normal generation is disabled, the corresponding normal map
6655`GL_MAP2_NORMAL', if enabled, is used to produce a normal. If neither
6656automatic normal generation nor a normal map is enabled, no normal is
6657generated for `glEvalCoord2' commands.")
6658
7ec693ed 6659(define-foreign-procedure
bb894c9d
AW
6660 ((glEvalMesh1
6661 (mode GLenum)
6662 (i1 GLint)
6663 (i2 GLint)
6664 ->
6665 void)
6666 (glEvalMesh2
6667 (mode GLenum)
6668 (i1 GLint)
6669 (i2 GLint)
6670 (j1 GLint)
6671 (j2 GLint)
6672 ->
6673 void))
3c9b6116
AW
6674 "Compute a one- or two-dimensional grid of points or lines.
6675
6676MODE
6677 In `glEvalMesh1', specifies whether to compute a one-dimensional
6678 mesh of points or lines. Symbolic constants `GL_POINT' and
6679 `GL_LINE' are accepted.
6680
6681I1
6682 I2
6683
6684 Specify the first and last integer values for grid domain variable
6685 I .
6686
6687`glMapGrid' and `glEvalMesh' are used in tandem to efficiently generate
6688and evaluate a series of evenly-spaced map domain values. `glEvalMesh'
6689steps through the integer domain of a one- or two-dimensional grid,
6690whose range is the domain of the evaluation maps specified by `glMap1'
6691and `glMap2'. MODE determines whether the resulting vertices are
6692connected as points, lines, or filled polygons.
6693
6694In the one-dimensional case, `glEvalMesh1', the mesh is generated as if
6695the following code fragment were executed:
6696
6697where
6698
6699
6700 glBegin( TYPE );
6701 for ( i = I1; i <= I2; i += 1 )
6702 glEvalCoord1( i·ΔU+U_1
6703
6704 );
6705 glEnd();
6706
6707ΔU=(U_2-U_1,)/N
6708
6709and N , U_1 , and U_2 are the arguments to the most recent `glMapGrid1'
6710command. TYPE is `GL_POINTS' if MODE is `GL_POINT', or `GL_LINES' if
6711MODE is `GL_LINE'.
6712
6713The one absolute numeric requirement is that if I=N , then the value
6714computed from I·ΔU+U_1 is exactly U_2 .
6715
6716In the two-dimensional case, `glEvalMesh2', let .cp ΔU=(U_2-U_1,)/N
6717
6718ΔV=(V_2-V_1,)/M
6719
6720where N , U_1 , U_2 , M , V_1 , and V_2 are the arguments to the most
6721recent `glMapGrid2' command. Then, if MODE is `GL_FILL', the
6722`glEvalMesh2' command is equivalent to:
6723
6724
6725
6726
6727 for ( j = J1; j < J2; j += 1 ) {
6728 glBegin( GL_QUAD_STRIP );
6729 for ( i = I1; i <= I2; i += 1 ) {
6730 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6731
6732 );
6733 glEvalCoord2( i·ΔU+U_1,(j+1,)·ΔV+V_1
6734
6735 );
6736 }
6737 glEnd();
6738 }
6739
6740If MODE is `GL_LINE', then a call to `glEvalMesh2' is equivalent to:
6741
6742
6743
6744
6745 for ( j = J1; j <= J2; j += 1 ) {
6746 glBegin( GL_LINE_STRIP );
6747 for ( i = I1; i <= I2; i += 1 )
6748 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6749
6750 );
6751 glEnd();
6752 }
6753
6754 for ( i = I1; i <= I2; i += 1 ) {
6755 glBegin( GL_LINE_STRIP );
6756 for ( j = J1; j <= J1; j += 1 )
6757 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6758
6759 );
6760 glEnd();
6761 }
6762
6763And finally, if MODE is `GL_POINT', then a call to `glEvalMesh2' is
6764equivalent to:
6765
6766
6767
6768
6769 glBegin( GL_POINTS );
6770 for ( j = J1; j <= J2; j += 1 )
6771 for ( i = I1; i <= I2; i += 1 )
6772 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6773
6774 );
6775 glEnd();
6776
6777In all three cases, the only absolute numeric requirements are that if
6778I=N , then the value computed from I·ΔU+U_1 is exactly U_2 , and if J=M
6779, then the value computed from J·ΔV+V_1 is exactly V_2 .
6780
6781`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
6782
6783`GL_INVALID_OPERATION' is generated if `glEvalMesh' is executed between
6784the execution of `glBegin' and the corresponding execution of `glEnd'.")
6785
7ec693ed 6786(define-foreign-procedure
bb894c9d
AW
6787 ((glEvalPoint1 (i GLint) -> void)
6788 (glEvalPoint2 (i GLint) (j GLint) -> void))
3c9b6116
AW
6789 "Generate and evaluate a single point in a mesh.
6790
6791I
6792 Specifies the integer value for grid domain variable I .
6793
6794J
6795 Specifies the integer value for grid domain variable J
6796 (`glEvalPoint2' only).
6797
6798`glMapGrid' and `glEvalMesh' are used in tandem to efficiently generate
6799and evaluate a series of evenly spaced map domain values. `glEvalPoint'
6800can be used to evaluate a single grid point in the same gridspace that
6801is traversed by `glEvalMesh'. Calling `glEvalPoint1' is equivalent to
6802calling where ΔU=(U_2-U_1,)/N
6803
6804
6805 glEvalCoord1( i·ΔU+U_1
6806
6807 );
6808
6809and N , U_1 , and U_2 are the arguments to the most recent `glMapGrid1'
6810command. The one absolute numeric requirement is that if I=N , then the
6811value computed from I·ΔU+U_1 is exactly U_2 .
6812
6813In the two-dimensional case, `glEvalPoint2', let
6814
6815ΔU=(U_2-U_1,)/N ΔV=(V_2-V_1,)/M
6816
6817where N , U_1 , U_2 , M , V_1 , and V_2 are the arguments to the most
6818recent `glMapGrid2' command. Then the `glEvalPoint2' command is
6819equivalent to calling The only absolute numeric requirements are that if
6820I=N , then the value computed from I·ΔU+U_1 is exactly U_2 , and if J=M
6821, then the value computed from J·ΔV+V_1 is exactly V_2 .
6822
6823
6824 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6825
6826 );")
6827
7ec693ed 6828(define-foreign-procedure
bb894c9d
AW
6829 ((glFeedbackBuffer
6830 (size GLsizei)
6831 (type GLenum)
6832 (buffer *)
6833 ->
6834 void))
3c9b6116
AW
6835 "Controls feedback mode.
6836
6837SIZE
6838 Specifies the maximum number of values that can be written into
6839 BUFFER.
6840
6841TYPE
6842 Specifies a symbolic constant that describes the information that
6843 will be returned for each vertex. `GL_2D', `GL_3D', `GL_3D_COLOR',
6844 `GL_3D_COLOR_TEXTURE', and `GL_4D_COLOR_TEXTURE' are accepted.
6845
6846BUFFER
6847 Returns the feedback data.
6848
6849The `glFeedbackBuffer' function controls feedback. Feedback, like
6850selection, is a GL mode. The mode is selected by calling `glRenderMode'
6851with `GL_FEEDBACK'. When the GL is in feedback mode, no pixels are
6852produced by rasterization. Instead, information about primitives that
6853would have been rasterized is fed back to the application using the GL.
6854
6855`glFeedbackBuffer' has three arguments: BUFFER is a pointer to an array
6856of floating-point values into which feedback information is placed. SIZE
6857indicates the size of the array. TYPE is a symbolic constant describing
6858the information that is fed back for each vertex. `glFeedbackBuffer'
6859must be issued before feedback mode is enabled (by calling
6860`glRenderMode' with argument `GL_FEEDBACK'). Setting `GL_FEEDBACK'
6861without establishing the feedback buffer, or calling `glFeedbackBuffer'
6862while the GL is in feedback mode, is an error.
6863
6864When `glRenderMode' is called while in feedback mode, it returns the
6865number of entries placed in the feedback array and resets the feedback
6866array pointer to the base of the feedback buffer. The returned value
6867never exceeds SIZE. If the feedback data required more room than was
6868available in BUFFER, `glRenderMode' returns a negative value. To take
6869the GL out of feedback mode, call `glRenderMode' with a parameter value
6870other than `GL_FEEDBACK'.
6871
6872While in feedback mode, each primitive, bitmap, or pixel rectangle that
6873would be rasterized generates a block of values that are copied into the
6874feedback array. If doing so would cause the number of entries to exceed
6875the maximum, the block is partially written so as to fill the array (if
6876there is any room left at all), and an overflow flag is set. Each block
6877begins with a code indicating the primitive type, followed by values
6878that describe the primitive's vertices and associated data. Entries are
6879also written for bitmaps and pixel rectangles. Feedback occurs after
6880polygon culling and `glPolygonMode' interpretation of polygons has taken
6881place, so polygons that are culled are not returned in the feedback
6882buffer. It can also occur after polygons with more than three edges are
6883broken up into triangles, if the GL implementation renders polygons by
6884performing this decomposition.
6885
6886The `glPassThrough' command can be used to insert a marker into the
6887feedback buffer. See `glPassThrough'.
6888
6889Following is the grammar for the blocks of values written into the
6890feedback buffer. Each primitive is indicated with a unique identifying
6891value followed by some number of vertices. Polygon entries include an
6892integer value indicating how many vertices follow. A vertex is fed back
6893as some number of floating-point values, as determined by TYPE. Colors
6894are fed back as four values in RGBA mode and one value in color index
6895mode.
6896
6897feedbackList ← feedbackItem feedbackList | feedbackItem feedbackItem ←
6898point | lineSegment | polygon | bitmap | pixelRectangle | passThru point
6899← `GL_POINT_TOKEN' vertex lineSegment ← `GL_LINE_TOKEN' vertex vertex |
6900`GL_LINE_RESET_TOKEN' vertex vertex polygon ← `GL_POLYGON_TOKEN' n
6901polySpec polySpec ← polySpec vertex | vertex vertex vertex bitmap ←
6902`GL_BITMAP_TOKEN' vertex pixelRectangle ← `GL_DRAW_PIXEL_TOKEN' vertex |
6903`GL_COPY_PIXEL_TOKEN' vertex passThru ← `GL_PASS_THROUGH_TOKEN' value
6904vertex ← 2d | 3d | 3dColor | 3dColorTexture | 4dColorTexture 2d ← value
6905value 3d ← value value value 3dColor ← value value value color
69063dColorTexture ← value value value color tex 4dColorTexture ← value
6907value value value color tex color ← rgba | index rgba ← value value
6908value value index ← value tex ← value value value value
6909
6910VALUE is a floating-point number, and N is a floating-point integer
6911giving the number of vertices in the polygon. `GL_POINT_TOKEN',
6912`GL_LINE_TOKEN', `GL_LINE_RESET_TOKEN', `GL_POLYGON_TOKEN',
6913`GL_BITMAP_TOKEN', `GL_DRAW_PIXEL_TOKEN', `GL_COPY_PIXEL_TOKEN' and
6914`GL_PASS_THROUGH_TOKEN' are symbolic floating-point constants.
6915`GL_LINE_RESET_TOKEN' is returned whenever the line stipple pattern is
6916reset. The data returned as a vertex depends on the feedback TYPE.
6917
6918The following table gives the correspondence between TYPE and the number
6919of values per vertex. K is 1 in color index mode and 4 in RGBA mode.
6920
6921
6922
6923*Type*
6924 *Coordinates*, *Color*, *Texture*, *Total Number of Values*
6925
6926`GL_2D'
6927 X, Y, , , 2
6928
6929`GL_3D'
6930 X, Y, Z, , , 3
6931
6932`GL_3D_COLOR'
6933 X, Y, Z, K , , 3+K
6934
6935`GL_3D_COLOR_TEXTURE'
6936 X, Y, Z, K , 4 , 7+K
6937
6938`GL_4D_COLOR_TEXTURE'
6939 X, Y, Z, W, K , 4 , 8+K
6940
6941Feedback vertex coordinates are in window coordinates, except W, which
6942is in clip coordinates. Feedback colors are lighted, if lighting is
6943enabled. Feedback texture coordinates are generated, if texture
6944coordinate generation is enabled. They are always transformed by the
6945texture matrix.
6946
6947`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
6948
6949`GL_INVALID_VALUE' is generated if SIZE is negative.
6950
6951`GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is called
6952while the render mode is `GL_FEEDBACK', or if `glRenderMode' is called
6953with argument `GL_FEEDBACK' before `glFeedbackBuffer' is called at least
6954once.
6955
6956`GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is executed
6957between the execution of `glBegin' and the corresponding execution of
6958`glEnd'.")
6959
7ec693ed 6960(define-foreign-procedure
bb894c9d 6961 ((glFinish -> void))
3c9b6116
AW
6962 "Block until all GL execution is complete.
6963
6964`glFinish' does not return until the effects of all previously called GL
6965commands are complete. Such effects include all changes to GL state, all
6966changes to connection state, and all changes to the frame buffer
6967contents.
6968
6969`GL_INVALID_OPERATION' is generated if `glFinish' is executed between
6970the execution of `glBegin' and the corresponding execution of `glEnd'.")
6971
7ec693ed 6972(define-foreign-procedure
bb894c9d 6973 ((glFlush -> void))
3c9b6116
AW
6974 "Force execution of GL commands in finite time.
6975
6976Different GL implementations buffer commands in several different
6977locations, including network buffers and the graphics accelerator
6978itself. `glFlush' empties all of these buffers, causing all issued
6979commands to be executed as quickly as they are accepted by the actual
6980rendering engine. Though this execution may not be completed in any
6981particular time period, it does complete in finite time.
6982
6983Because any GL program might be executed over a network, or on an
6984accelerator that buffers commands, all programs should call `glFlush'
6985whenever they count on having all of their previously issued commands
6986completed. For example, call `glFlush' before waiting for user input
6987that depends on the generated image.
6988
6989`GL_INVALID_OPERATION' is generated if `glFlush' is executed between the
6990execution of `glBegin' and the corresponding execution of `glEnd'.")
6991
7ec693ed 6992(define-foreign-procedure
bb894c9d
AW
6993 ((glFogCoordPointer
6994 (type GLenum)
6995 (stride GLsizei)
6996 (pointer *)
6997 ->
6998 void))
3c9b6116
AW
6999 "Define an array of fog coordinates.
7000
7001TYPE
7002 Specifies the data type of each fog coordinate. Symbolic constants
7003 `GL_FLOAT', or `GL_DOUBLE' are accepted. The initial value is
7004 `GL_FLOAT'.
7005
7006STRIDE
7007 Specifies the byte offset between consecutive fog coordinates. If
7008 STRIDE is 0, the array elements are understood to be tightly
7009 packed. The initial value is 0.
7010
7011POINTER
7012 Specifies a pointer to the first coordinate of the first fog
7013 coordinate in the array. The initial value is 0.
7014
7015`glFogCoordPointer' specifies the location and data format of an array
7016of fog coordinates to use when rendering. TYPE specifies the data type
7017of each fog coordinate, and STRIDE specifies the byte stride from one
7018fog coordinate to the next, allowing vertices and attributes to be
7019packed into a single array or stored in separate arrays.
7020
7021If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
7022target (see `glBindBuffer') while a fog coordinate array is specified,
7023POINTER is treated as a byte offset into the buffer object's data store.
7024Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
7025fog coordinate vertex array client-side state
7026(`GL_FOG_COORD_ARRAY_BUFFER_BINDING').
7027
7028When a fog coordinate array is specified, TYPE, STRIDE, and POINTER are
7029saved as client-side state, in addition to the current vertex array
7030buffer object binding.
7031
7032To enable and disable the fog coordinate array, call
7033`glEnableClientState' and `glDisableClientState' with the argument
7034`GL_FOG_COORD_ARRAY'. If enabled, the fog coordinate array is used when
7035`glDrawArrays', `glMultiDrawArrays', `glDrawElements',
7036`glMultiDrawElements', `glDrawRangeElements', or `glArrayElement' is
7037called.
7038
7039`GL_INVALID_ENUM' is generated if TYPE is not either `GL_FLOAT' or
7040`GL_DOUBLE'.
7041
7042`GL_INVALID_VALUE' is generated if STRIDE is negative.")
7043
7ec693ed 7044(define-foreign-procedure
bb894c9d 7045 ((glFogCoordd (coord GLdouble) -> void))
3c9b6116
AW
7046 "Set the current fog coordinates.
7047
7048COORD
7049 Specify the fog distance.
7050
7051`glFogCoord' specifies the fog coordinate that is associated with each
7052vertex and the current raster position. The value specified is
7053interpolated and used in computing the fog color (see `glFog').")
7054
7ec693ed 7055(define-foreign-procedure
bb894c9d
AW
7056 ((glFogf (pname GLenum) (param GLfloat) -> void)
7057 (glFogi (pname GLenum) (param GLint) -> void))
3c9b6116
AW
7058 "Specify fog parameters.
7059
7060PNAME
7061 Specifies a single-valued fog parameter. `GL_FOG_MODE',
7062 `GL_FOG_DENSITY', `GL_FOG_START', `GL_FOG_END', `GL_FOG_INDEX', and
7063 `GL_FOG_COORD_SRC' are accepted.
7064
7065PARAM
7066 Specifies the value that PNAME will be set to.
7067
7068Fog is initially disabled. While enabled, fog affects rasterized
7069geometry, bitmaps, and pixel blocks, but not buffer clear operations. To
7070enable and disable fog, call `glEnable' and `glDisable' with argument
7071`GL_FOG'.
7072
7073`glFog' assigns the value or values in PARAMS to the fog parameter
7074specified by PNAME. The following values are accepted for PNAME:
7075
7076`GL_FOG_MODE'
7077 PARAMS is a single integer or floating-point value that specifies
7078 the equation to be used to compute the fog blend factor, F . Three
7079 symbolic constants are accepted: `GL_LINEAR', `GL_EXP', and
7080 `GL_EXP2'. The equations corresponding to these symbolic constants
7081 are defined below. The initial fog mode is `GL_EXP'.
7082
7083`GL_FOG_DENSITY'
7084 PARAMS is a single integer or floating-point value that specifies
7085 DENSITY , the fog density used in both exponential fog equations.
7086 Only nonnegative densities are accepted. The initial fog density is
7087 1.
7088
7089`GL_FOG_START'
7090 PARAMS is a single integer or floating-point value that specifies
7091 START , the near distance used in the linear fog equation. The
7092 initial near distance is 0.
7093
7094`GL_FOG_END'
7095 PARAMS is a single integer or floating-point value that specifies
7096 END , the far distance used in the linear fog equation. The initial
7097 far distance is 1.
7098
7099`GL_FOG_INDEX'
7100 PARAMS is a single integer or floating-point value that specifies
7101 I_F , the fog color index. The initial fog index is 0.
7102
7103`GL_FOG_COLOR'
7104 PARAMS contains four integer or floating-point values that specify
7105 C_F , the fog color. Integer values are mapped linearly such that
7106 the most positive representable value maps to 1.0, and the most
7107 negative representable value maps to -1.0 . Floating-point values
7108 are mapped directly. After conversion, all color components are
7109 clamped to the range [0,1] . The initial fog color is (0, 0, 0, 0).
7110
7111`GL_FOG_COORD_SRC'
7112 PARAMS contains either of the following symbolic constants:
7113 `GL_FOG_COORD' or `GL_FRAGMENT_DEPTH'. `GL_FOG_COORD' specifies
7114 that the current fog coordinate should be used as distance value in
7115 the fog color computation. `GL_FRAGMENT_DEPTH' specifies that the
7116 current fragment depth should be used as distance value in the fog
7117 computation.
7118
7119Fog blends a fog color with each rasterized pixel fragment's
7120post-texturing color using a blending factor F . Factor F is computed in
7121one of three ways, depending on the fog mode. Let C be either the
7122distance in eye coordinate from the origin (in the case that the
7123`GL_FOG_COORD_SRC' is `GL_FRAGMENT_DEPTH') or the current fog coordinate
7124(in the case that `GL_FOG_COORD_SRC' is `GL_FOG_COORD'). The equation
7125for `GL_LINEAR' fog is F=END-C,/END-START,
7126
7127The equation for `GL_EXP' fog is F=E^-(DENSITY·C,),
7128
7129The equation for `GL_EXP2' fog is F=E^-(DENSITY·C,),^2
7130
7131Regardless of the fog mode, F is clamped to the range [0,1] after it is
7132computed. Then, if the GL is in RGBA color mode, the fragment's red,
7133green, and blue colors, represented by C_R , are replaced by
7134
7135C_R,^″=F×C_R+(1-F,)×C_F
7136
7137Fog does not affect a fragment's alpha component.
7138
7139In color index mode, the fragment's color index I_R is replaced by
7140
7141I_R,^″=I_R+(1-F,)×I_F
7142
7143
7144
7145`GL_INVALID_ENUM' is generated if PNAME is not an accepted value, or if
7146PNAME is `GL_FOG_MODE' and PARAMS is not an accepted value.
7147
7148`GL_INVALID_VALUE' is generated if PNAME is `GL_FOG_DENSITY' and PARAMS
7149is negative.
7150
7151`GL_INVALID_OPERATION' is generated if `glFog' is executed between the
7152execution of `glBegin' and the corresponding execution of `glEnd'.")
7153
7ec693ed 7154(define-foreign-procedure
bb894c9d 7155 ((glFrontFace (mode GLenum) -> void))
3c9b6116
AW
7156 "Define front- and back-facing polygons.
7157
7158MODE
7159 Specifies the orientation of front-facing polygons. `GL_CW' and
7160 `GL_CCW' are accepted. The initial value is `GL_CCW'.
7161
7162In a scene composed entirely of opaque closed surfaces, back-facing
7163polygons are never visible. Eliminating these invisible polygons has the
7164obvious benefit of speeding up the rendering of the image. To enable and
7165disable elimination of back-facing polygons, call `glEnable' and
7166`glDisable' with argument `GL_CULL_FACE'.
7167
7168The projection of a polygon to window coordinates is said to have
7169clockwise winding if an imaginary object following the path from its
7170first vertex, its second vertex, and so on, to its last vertex, and
7171finally back to its first vertex, moves in a clockwise direction about
7172the interior of the polygon. The polygon's winding is said to be
7173counterclockwise if the imaginary object following the same path moves
7174in a counterclockwise direction about the interior of the polygon.
7175`glFrontFace' specifies whether polygons with clockwise winding in
7176window coordinates, or counterclockwise winding in window coordinates,
7177are taken to be front-facing. Passing `GL_CCW' to MODE selects
7178counterclockwise polygons as front-facing; `GL_CW' selects clockwise
7179polygons as front-facing. By default, counterclockwise polygons are
7180taken to be front-facing.
7181
7182`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
7183
7184`GL_INVALID_OPERATION' is generated if `glFrontFace' is executed between
7185the execution of `glBegin' and the corresponding execution of `glEnd'.")
7186
7ec693ed 7187(define-foreign-procedure
bb894c9d
AW
7188 ((glFrustum
7189 (left GLdouble)
7190 (right GLdouble)
7191 (bottom GLdouble)
7192 (top GLdouble)
7193 (nearVal GLdouble)
7194 (farVal GLdouble)
7195 ->
7196 void))
3c9b6116
AW
7197 "Multiply the current matrix by a perspective matrix.
7198
7199LEFT
7200 RIGHT
7201
7202 Specify the coordinates for the left and right vertical clipping
7203 planes.
7204
7205BOTTOM
7206 TOP
7207
7208 Specify the coordinates for the bottom and top horizontal clipping
7209 planes.
7210
7211NEARVAL
7212 FARVAL
7213
7214 Specify the distances to the near and far depth clipping planes.
7215 Both distances must be positive.
7216
7217`glFrustum' describes a perspective matrix that produces a perspective
7218projection. The current matrix (see `glMatrixMode') is multiplied by
7219this matrix and the result replaces the current matrix, as if
7220`glMultMatrix' were called with the following matrix as its argument:
7221
7222
7223
7224[(2\u2062NEARVAL,/RIGHT-LEFT,, 0 A 0), (0 2\u2062NEARVAL,/TOP-BOTTOM,, B 0), (0 0
7225C D), (0 0 -1 0),]
7226
7227A=RIGHT+LEFT,/RIGHT-LEFT,
7228
7229B=TOP+BOTTOM,/TOP-BOTTOM,
7230
7231C=-FARVAL+NEARVAL,/FARVAL-NEARVAL,,
7232
7233D=-2\u2062FARVAL\u2062NEARVAL,/FARVAL-NEARVAL,,
7234
7235
7236
7237Typically, the matrix mode is `GL_PROJECTION', and (LEFT,BOTTOM-NEARVAL)
7238and (RIGHT,TOP-NEARVAL) specify the points on the near clipping plane
7239that are mapped to the lower left and upper right corners of the window,
7240assuming that the eye is located at (0, 0, 0). -FARVAL specifies the
7241location of the far clipping plane. Both NEARVAL and FARVAL must be
7242positive.
7243
7244Use `glPushMatrix' and `glPopMatrix' to save and restore the current
7245matrix stack.
7246
7247`GL_INVALID_VALUE' is generated if NEARVAL or FARVAL is not positive, or
7248if LEFT = RIGHT, or BOTTOM = TOP, or NEAR = FAR.
7249
7250`GL_INVALID_OPERATION' is generated if `glFrustum' is executed between
7251the execution of `glBegin' and the corresponding execution of `glEnd'.")
7252
7ec693ed 7253(define-foreign-procedure
bb894c9d 7254 ((glGenBuffers (n GLsizei) (buffers *) -> void))
3c9b6116
AW
7255 "Generate buffer object names.
7256
7257N
7258 Specifies the number of buffer object names to be generated.
7259
7260BUFFERS
7261 Specifies an array in which the generated buffer object names are
7262 stored.
7263
7264`glGenBuffers' returns N buffer object names in BUFFERS. There is no
7265guarantee that the names form a contiguous set of integers; however, it
7266is guaranteed that none of the returned names was in use immediately
7267before the call to `glGenBuffers'.
7268
7269Buffer object names returned by a call to `glGenBuffers' are not
7270returned by subsequent calls, unless they are first deleted with
7271`glDeleteBuffers'.
7272
7273No buffer objects are associated with the returned buffer object names
7274until they are first bound by calling `glBindBuffer'.
7275
7276`GL_INVALID_VALUE' is generated if N is negative.
7277
7278`GL_INVALID_OPERATION' is generated if `glGenBuffers' is executed
7279between the execution of `glBegin' and the corresponding execution of
7280`glEnd'.")
7281
7ec693ed 7282(define-foreign-procedure
bb894c9d 7283 ((glGenLists (range GLsizei) -> GLuint))
3c9b6116
AW
7284 "Generate a contiguous set of empty display lists.
7285
7286RANGE
7287 Specifies the number of contiguous empty display lists to be
7288 generated.
7289
7290`glGenLists' has one argument, RANGE. It returns an integer N such that
7291RANGE contiguous empty display lists, named N , N+1 , ... , N+RANGE-1 ,
7292are created. If RANGE is 0, if there is no group of RANGE contiguous
7293names available, or if any error is generated, no display lists are
7294generated, and 0 is returned.
7295
7296`GL_INVALID_VALUE' is generated if RANGE is negative.
7297
7298`GL_INVALID_OPERATION' is generated if `glGenLists' is executed between
7299the execution of `glBegin' and the corresponding execution of `glEnd'.")
7300
7ec693ed 7301(define-foreign-procedure
bb894c9d 7302 ((glGenQueries (n GLsizei) (ids *) -> void))
3c9b6116
AW
7303 "Generate query object names.
7304
7305N
7306 Specifies the number of query object names to be generated.
7307
7308IDS
7309 Specifies an array in which the generated query object names are
7310 stored.
7311
7312`glGenQueries' returns N query object names in IDS. There is no
7313guarantee that the names form a contiguous set of integers; however, it
7314is guaranteed that none of the returned names was in use immediately
7315before the call to `glGenQueries'.
7316
7317Query object names returned by a call to `glGenQueries' are not returned
7318by subsequent calls, unless they are first deleted with
7319`glDeleteQueries'.
7320
7321No query objects are associated with the returned query object names
7322until they are first used by calling `glBeginQuery'.
7323
7324`GL_INVALID_VALUE' is generated if N is negative.
7325
7326`GL_INVALID_OPERATION' is generated if `glGenQueries' is executed
7327between the execution of `glBegin' and the corresponding execution of
7328`glEnd'.")
7329
7ec693ed 7330(define-foreign-procedure
bb894c9d 7331 ((glGenTextures (n GLsizei) (textures *) -> void))
3c9b6116
AW
7332 "Generate texture names.
7333
7334N
7335 Specifies the number of texture names to be generated.
7336
7337TEXTURES
7338 Specifies an array in which the generated texture names are stored.
7339
7340`glGenTextures' returns N texture names in TEXTURES. There is no
7341guarantee that the names form a contiguous set of integers; however, it
7342is guaranteed that none of the returned names was in use immediately
7343before the call to `glGenTextures'.
7344
7345The generated textures have no dimensionality; they assume the
7346dimensionality of the texture target to which they are first bound (see
7347`glBindTexture').
7348
7349Texture names returned by a call to `glGenTextures' are not returned by
7350subsequent calls, unless they are first deleted with `glDeleteTextures'.
7351
7352`GL_INVALID_VALUE' is generated if N is negative.
7353
7354`GL_INVALID_OPERATION' is generated if `glGenTextures' is executed
7355between the execution of `glBegin' and the corresponding execution of
7356`glEnd'.")
7357
7ec693ed 7358(define-foreign-procedure
bb894c9d
AW
7359 ((glGetActiveAttrib
7360 (program GLuint)
7361 (index GLuint)
7362 (bufSize GLsizei)
7363 (length *)
7364 (size *)
7365 (type *)
7366 (name *)
7367 ->
7368 void))
3c9b6116
AW
7369 "Returns information about an active attribute variable for the specified
7370program object.
7371
7372PROGRAM
7373 Specifies the program object to be queried.
7374
7375INDEX
7376 Specifies the index of the attribute variable to be queried.
7377
7378BUFSIZE
7379 Specifies the maximum number of characters OpenGL is allowed to
7380 write in the character buffer indicated by NAME.
7381
7382LENGTH
7383 Returns the number of characters actually written by OpenGL in the
7384 string indicated by NAME (excluding the null terminator) if a value
7385 other than `NULL' is passed.
7386
7387SIZE
7388 Returns the size of the attribute variable.
7389
7390TYPE
7391 Returns the data type of the attribute variable.
7392
7393NAME
7394 Returns a null terminated string containing the name of the
7395 attribute variable.
7396
7397`glGetActiveAttrib' returns information about an active attribute
7398variable in the program object specified by PROGRAM. The number of
7399active attributes can be obtained by calling `glGetProgram' with the
7400value `GL_ACTIVE_ATTRIBUTES'. A value of 0 for INDEX selects the first
7401active attribute variable. Permissible values for INDEX range from 0 to
7402the number of active attribute variables minus 1.
7403
7404A vertex shader may use either built-in attribute variables,
7405user-defined attribute variables, or both. Built-in attribute variables
7406have a prefix of \"gl_\" and reference conventional OpenGL vertex
7407attribtes (e.g., GL_VERTEX, GL_NORMAL, etc., see the OpenGL Shading
7408Language specification for a complete list.) User-defined attribute
7409variables have arbitrary names and obtain their values through numbered
7410generic vertex attributes. An attribute variable (either built-in or
7411user-defined) is considered active if it is determined during the link
7412operation that it may be accessed during program execution. Therefore,
7413PROGRAM should have previously been the target of a call to
7414`glLinkProgram', but it is not necessary for it to have been linked
7415successfully.
7416
7417The size of the character buffer required to store the longest attribute
7418variable name in PROGRAM can be obtained by calling `glGetProgram' with
7419the value `GL_ACTIVE_ATTRIBUTE_MAX_LENGTH'. This value should be used to
7420allocate a buffer of sufficient size to store the returned attribute
7421name. The size of this character buffer is passed in BUFSIZE, and a
7422pointer to this character buffer is passed in NAME.
7423
7424`glGetActiveAttrib' returns the name of the attribute variable indicated
7425by INDEX, storing it in the character buffer specified by NAME. The
7426string returned will be null terminated. The actual number of characters
7427written into this buffer is returned in LENGTH, and this count does not
7428include the null termination character. If the length of the returned
7429string is not required, a value of `NULL' can be passed in the LENGTH
7430argument.
7431
7432The TYPE argument will return a pointer to the attribute variable's data
7433type. The symbolic constants `GL_FLOAT', `GL_FLOAT_VEC2',
7434`GL_FLOAT_VEC3', `GL_FLOAT_VEC4', `GL_FLOAT_MAT2', `GL_FLOAT_MAT3',
7435`GL_FLOAT_MAT4', `GL_FLOAT_MAT2x3', `GL_FLOAT_MAT2x4',
7436`GL_FLOAT_MAT3x2', `GL_FLOAT_MAT3x4', `GL_FLOAT_MAT4x2', or
7437`GL_FLOAT_MAT4x3' may be returned. The SIZE argument will return the
7438size of the attribute, in units of the type returned in TYPE.
7439
7440The list of active attribute variables may include both built-in
7441attribute variables (which begin with the prefix \"gl_\") as well as
7442user-defined attribute variable names.
7443
7444This function will return as much information as it can about the
7445specified active attribute variable. If no information is available,
7446LENGTH will be 0, and NAME will be an empty string. This situation could
7447occur if this function is called after a link operation that failed. If
7448an error occurs, the return values LENGTH, SIZE, TYPE, and NAME will be
7449unmodified.
7450
7451`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
7452OpenGL.
7453
7454`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7455
7456`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to the
7457number of active attribute variables in PROGRAM.
7458
7459`GL_INVALID_OPERATION' is generated if `glGetActiveAttrib' is executed
7460between the execution of `glBegin' and the corresponding execution of
7461`glEnd'.
7462
7463`GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.")
7464
7ec693ed 7465(define-foreign-procedure
bb894c9d
AW
7466 ((glGetActiveUniform
7467 (program GLuint)
7468 (index GLuint)
7469 (bufSize GLsizei)
7470 (length *)
7471 (size *)
7472 (type *)
7473 (name *)
7474 ->
7475 void))
3c9b6116
AW
7476 "Returns information about an active uniform variable for the specified
7477program object.
7478
7479PROGRAM
7480 Specifies the program object to be queried.
7481
7482INDEX
7483 Specifies the index of the uniform variable to be queried.
7484
7485BUFSIZE
7486 Specifies the maximum number of characters OpenGL is allowed to
7487 write in the character buffer indicated by NAME.
7488
7489LENGTH
7490 Returns the number of characters actually written by OpenGL in the
7491 string indicated by NAME (excluding the null terminator) if a value
7492 other than `NULL' is passed.
7493
7494SIZE
7495 Returns the size of the uniform variable.
7496
7497TYPE
7498 Returns the data type of the uniform variable.
7499
7500NAME
7501 Returns a null terminated string containing the name of the uniform
7502 variable.
7503
7504`glGetActiveUniform' returns information about an active uniform
7505variable in the program object specified by PROGRAM. The number of
7506active uniform variables can be obtained by calling `glGetProgram' with
7507the value `GL_ACTIVE_UNIFORMS'. A value of 0 for INDEX selects the first
7508active uniform variable. Permissible values for INDEX range from 0 to
7509the number of active uniform variables minus 1.
7510
7511Shaders may use either built-in uniform variables, user-defined uniform
7512variables, or both. Built-in uniform variables have a prefix of \"gl_\"
7513and reference existing OpenGL state or values derived from such state
7514(e.g., GL_FOG, GL_MODELVIEWMATRIX, etc., see the OpenGL Shading Language
7515specification for a complete list.) User-defined uniform variables have
7516arbitrary names and obtain their values from the application through
7517calls to `glUniform'. A uniform variable (either built-in or
7518user-defined) is considered active if it is determined during the link
7519operation that it may be accessed during program execution. Therefore,
7520PROGRAM should have previously been the target of a call to
7521`glLinkProgram', but it is not necessary for it to have been linked
7522successfully.
7523
7524The size of the character buffer required to store the longest uniform
7525variable name in PROGRAM can be obtained by calling `glGetProgram' with
7526the value `GL_ACTIVE_UNIFORM_MAX_LENGTH'. This value should be used to
7527allocate a buffer of sufficient size to store the returned uniform
7528variable name. The size of this character buffer is passed in BUFSIZE,
7529and a pointer to this character buffer is passed in NAME.
7530
7531`glGetActiveUniform' returns the name of the uniform variable indicated
7532by INDEX, storing it in the character buffer specified by NAME. The
7533string returned will be null terminated. The actual number of characters
7534written into this buffer is returned in LENGTH, and this count does not
7535include the null termination character. If the length of the returned
7536string is not required, a value of `NULL' can be passed in the LENGTH
7537argument.
7538
7539The TYPE argument will return a pointer to the uniform variable's data
7540type. The symbolic constants `GL_FLOAT', `GL_FLOAT_VEC2',
7541`GL_FLOAT_VEC3', `GL_FLOAT_VEC4', `GL_INT', `GL_INT_VEC2',
7542`GL_INT_VEC3', `GL_INT_VEC4', `GL_BOOL', `GL_BOOL_VEC2', `GL_BOOL_VEC3',
7543`GL_BOOL_VEC4', `GL_FLOAT_MAT2', `GL_FLOAT_MAT3', `GL_FLOAT_MAT4',
7544`GL_FLOAT_MAT2x3', `GL_FLOAT_MAT2x4', `GL_FLOAT_MAT3x2',
7545`GL_FLOAT_MAT3x4', `GL_FLOAT_MAT4x2', `GL_FLOAT_MAT4x3',
7546`GL_SAMPLER_1D', `GL_SAMPLER_2D', `GL_SAMPLER_3D', `GL_SAMPLER_CUBE',
7547`GL_SAMPLER_1D_SHADOW', or `GL_SAMPLER_2D_SHADOW' may be returned.
7548
7549If one or more elements of an array are active, the name of the array is
7550returned in NAME, the type is returned in TYPE, and the SIZE parameter
7551returns the highest array element index used, plus one, as determined by
7552the compiler and/or linker. Only one active uniform variable will be
7553reported for a uniform array.
7554
7555Uniform variables that are declared as structures or arrays of
7556structures will not be returned directly by this function. Instead, each
7557of these uniform variables will be reduced to its fundamental components
7558containing the \".\" and \"[]\" operators such that each of the names is
7559valid as an argument to `glGetUniformLocation'. Each of these reduced
7560uniform variables is counted as one active uniform variable and is
7561assigned an index. A valid name cannot be a structure, an array of
7562structures, or a subcomponent of a vector or matrix.
7563
7564The size of the uniform variable will be returned in SIZE. Uniform
7565variables other than arrays will have a size of 1. Structures and arrays
7566of structures will be reduced as described earlier, such that each of
7567the names returned will be a data type in the earlier list. If this
7568reduction results in an array, the size returned will be as described
7569for uniform arrays; otherwise, the size returned will be 1.
7570
7571The list of active uniform variables may include both built-in uniform
7572variables (which begin with the prefix \"gl_\") as well as user-defined
7573uniform variable names.
7574
7575This function will return as much information as it can about the
7576specified active uniform variable. If no information is available,
7577LENGTH will be 0, and NAME will be an empty string. This situation could
7578occur if this function is called after a link operation that failed. If
7579an error occurs, the return values LENGTH, SIZE, TYPE, and NAME will be
7580unmodified.
7581
7582`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
7583OpenGL.
7584
7585`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7586
7587`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to the
7588number of active uniform variables in PROGRAM.
7589
7590`GL_INVALID_OPERATION' is generated if `glGetActiveUniform' is executed
7591between the execution of `glBegin' and the corresponding execution of
7592`glEnd'.
7593
7594`GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.")
7595
7ec693ed 7596(define-foreign-procedure
bb894c9d
AW
7597 ((glGetAttachedShaders
7598 (program GLuint)
7599 (maxCount GLsizei)
7600 (count *)
7601 (shaders *)
7602 ->
7603 void))
3c9b6116
AW
7604 "Returns the handles of the shader objects attached to a program object.
7605
7606PROGRAM
7607 Specifies the program object to be queried.
7608
7609MAXCOUNT
7610 Specifies the size of the array for storing the returned object
7611 names.
7612
7613COUNT
7614 Returns the number of names actually returned in OBJECTS.
7615
7616SHADERS
7617 Specifies an array that is used to return the names of attached
7618 shader objects.
7619
7620`glGetAttachedShaders' returns the names of the shader objects attached
7621to PROGRAM. The names of shader objects that are attached to PROGRAM
7622will be returned in SHADERS. The actual number of shader names written
7623into SHADERS is returned in COUNT. If no shader objects are attached to
7624PROGRAM, COUNT is set to 0. The maximum number of shader names that may
7625be returned in SHADERS is specified by MAXCOUNT.
7626
7627If the number of names actually returned is not required (for instance,
7628if it has just been obtained by calling `glGetProgram'), a value of
7629`NULL' may be passed for count. If no shader objects are attached to
7630PROGRAM, a value of 0 will be returned in COUNT. The actual number of
7631attached shaders can be obtained by calling `glGetProgram' with the
7632value `GL_ATTACHED_SHADERS'.
7633
7634`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
7635OpenGL.
7636
7637`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7638
7639`GL_INVALID_VALUE' is generated if MAXCOUNT is less than 0.
7640
7641`GL_INVALID_OPERATION' is generated if `glGetAttachedShaders' is
7642executed between the execution of `glBegin' and the corresponding
7643execution of `glEnd'.")
7644
7ec693ed 7645(define-foreign-procedure
bb894c9d
AW
7646 ((glGetAttribLocation
7647 (program GLuint)
7648 (name *)
7649 ->
7650 GLint))
3c9b6116
AW
7651 "Returns the location of an attribute variable.
7652
7653PROGRAM
7654 Specifies the program object to be queried.
7655
7656NAME
7657 Points to a null terminated string containing the name of the
7658 attribute variable whose location is to be queried.
7659
7660`glGetAttribLocation' queries the previously linked program object
7661specified by PROGRAM for the attribute variable specified by NAME and
7662returns the index of the generic vertex attribute that is bound to that
7663attribute variable. If NAME is a matrix attribute variable, the index of
7664the first column of the matrix is returned. If the named attribute
7665variable is not an active attribute in the specified program object or
7666if NAME starts with the reserved prefix \"gl_\", a value of -1 is
7667returned.
7668
7669The association between an attribute variable name and a generic
7670attribute index can be specified at any time by calling
7671`glBindAttribLocation'. Attribute bindings do not go into effect until
7672`glLinkProgram' is called. After a program object has been linked
7673successfully, the index values for attribute variables remain fixed
7674until the next link command occurs. The attribute values can only be
7675queried after a link if the link was successful. `glGetAttribLocation'
7676returns the binding that actually went into effect the last time
7677`glLinkProgram' was called for the specified program object. Attribute
7678bindings that have been specified since the last link operation are not
7679returned by `glGetAttribLocation'.
7680
7681`GL_INVALID_OPERATION' is generated if PROGRAM is not a value generated
7682by OpenGL.
7683
7684`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7685
7686`GL_INVALID_OPERATION' is generated if PROGRAM has not been successfully
7687linked.
7688
7689`GL_INVALID_OPERATION' is generated if `glGetAttribLocation' is executed
7690between the execution of `glBegin' and the corresponding execution of
7691`glEnd'.")
7692
7ec693ed 7693(define-foreign-procedure
bb894c9d
AW
7694 ((glGetBufferSubData
7695 (target GLenum)
7696 (offset GLintptr)
7697 (size GLsizeiptr)
7698 (data *)
7699 ->
7700 void))
3c9b6116
AW
7701 "Returns a subset of a buffer object's data store.
7702
7703TARGET
7704 Specifies the target buffer object. The symbolic constant must be
7705 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
7706 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
7707
7708OFFSET
7709 Specifies the offset into the buffer object's data store from which
7710 data will be returned, measured in bytes.
7711
7712SIZE
7713 Specifies the size in bytes of the data store region being
7714 returned.
7715
7716DATA
7717 Specifies a pointer to the location where buffer object data is
7718 returned.
7719
7720`glGetBufferSubData' returns some or all of the data from the buffer
7721object currently bound to TARGET. Data starting at byte offset OFFSET
7722and extending for SIZE bytes is copied from the data store to the memory
7723pointed to by DATA. An error is thrown if the buffer object is currently
7724mapped, or if OFFSET and SIZE together define a range beyond the bounds
7725of the buffer object's data store.
7726
7727`GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
7728`GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
7729`GL_PIXEL_UNPACK_BUFFER'.
7730
7731`GL_INVALID_VALUE' is generated if OFFSET or SIZE is negative, or if
7732together they define a region of memory that extends beyond the buffer
7733object's allocated data store.
7734
7735`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
7736is bound to TARGET.
7737
7738`GL_INVALID_OPERATION' is generated if the buffer object being queried
7739is mapped.
7740
7741`GL_INVALID_OPERATION' is generated if `glGetBufferSubData' is executed
7742between the execution of `glBegin' and the corresponding execution of
7743`glEnd'.")
7744
7ec693ed 7745(define-foreign-procedure
bb894c9d
AW
7746 ((glGetClipPlane
7747 (plane GLenum)
7748 (equation *)
7749 ->
7750 void))
3c9b6116
AW
7751 "Return the coefficients of the specified clipping plane.
7752
7753PLANE
7754 Specifies a clipping plane. The number of clipping planes depends
7755 on the implementation, but at least six clipping planes are
7756 supported. They are identified by symbolic names of the form
7757 `GL_CLIP_PLANE' I where i ranges from 0 to the value of
7758 `GL_MAX_CLIP_PLANES' - 1.
7759
7760EQUATION
7761 Returns four double-precision values that are the coefficients of
7762 the plane equation of PLANE in eye coordinates. The initial value
7763 is (0, 0, 0, 0).
7764
7765`glGetClipPlane' returns in EQUATION the four coefficients of the plane
7766equation for PLANE.
7767
7768`GL_INVALID_ENUM' is generated if PLANE is not an accepted value.
7769
7770`GL_INVALID_OPERATION' is generated if `glGetClipPlane' is executed
7771between the execution of `glBegin' and the corresponding execution of
7772`glEnd'.")
7773
7ec693ed 7774(define-foreign-procedure
bb894c9d
AW
7775 ((glGetColorTable
7776 (target GLenum)
7777 (format GLenum)
7778 (type GLenum)
7779 (table *)
7780 ->
7781 void))
3c9b6116
AW
7782 "Retrieve contents of a color lookup table.
7783
7784TARGET
7785 Must be `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', or
7786 `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
7787
7788FORMAT
7789 The format of the pixel data in TABLE. The possible values are
7790 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE',
7791 `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'.
7792
7793TYPE
7794 The type of the pixel data in TABLE. Symbolic constants
7795 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
7796 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
7797 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
7798 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
7799 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
7800 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
7801 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
7802 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
7803 are accepted.
7804
7805TABLE
7806 Pointer to a one-dimensional array of pixel data containing the
7807 contents of the color table.
7808
7809`glGetColorTable' returns in TABLE the contents of the color table
7810specified by TARGET. No pixel transfer operations are performed, but
7811pixel storage modes that are applicable to `glReadPixels' are performed.
7812
7813If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
7814target (see `glBindBuffer') while a histogram table is requested, TABLE
7815is treated as a byte offset into the buffer object's data store.
7816
7817Color components that are requested in the specified FORMAT, but which
7818are not included in the internal format of the color lookup table, are
7819returned as zero. The assignments of internal color components to the
7820components requested by FORMAT are
7821
7822*Internal Component*
7823 *Resulting Component*
7824
7825Red
7826 Red
7827
7828Green
7829 Green
7830
7831Blue
7832 Blue
7833
7834Alpha
7835 Alpha
7836
7837Luminance
7838 Red
7839
7840Intensity
7841 Red
7842
7843
7844
7845`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
7846values.
7847
7848`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
7849values.
7850
7851`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
7852values.
7853
7854`GL_INVALID_OPERATION' is generated if TYPE is one of
7855`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
7856`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
7857is not `GL_RGB'.
7858
7859`GL_INVALID_OPERATION' is generated if TYPE is one of
7860`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
7861`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
7862`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
7863`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
7864FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
7865
7866`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
7867bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
7868store is currently mapped.
7869
7870`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
7871bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
7872to the buffer object such that the memory writes required would exceed
7873the data store size.
7874
7875`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
7876bound to the `GL_PIXEL_PACK_BUFFER' target and TABLE is not evenly
7877divisible into the number of bytes needed to store in memory a datum
7878indicated by TYPE.
7879
7880`GL_INVALID_OPERATION' is generated if `glGetColorTable' is executed
7881between the execution of `glBegin' and the corresponding execution of
7882`glEnd'.")
7883
7ec693ed 7884(define-foreign-procedure
bb894c9d
AW
7885 ((glGetCompressedTexImage
7886 (target GLenum)
7887 (lod GLint)
7888 (img *)
7889 ->
7890 void))
3c9b6116
AW
7891 "Return a compressed texture image.
7892
7893TARGET
7894 Specifies which texture is to be obtained. `GL_TEXTURE_1D',
7895 `GL_TEXTURE_2D', and
7896 `GL_TEXTURE_3D'`GL_TEXTURE_CUBE_MAP_POSITIVE_X',
7897 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
7898 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
7899 and `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z' are accepted.
7900
7901LOD
7902 Specifies the level-of-detail number of the desired image. Level 0
7903 is the base image level. Level N is the N th mipmap reduction
7904 image.
7905
7906IMG
7907 Returns the compressed texture image.
7908
7909`glGetCompressedTexImage' returns the compressed texture image
7910associated with TARGET and LOD into IMG. IMG should be an array of
7911`GL_TEXTURE_COMPRESSED_IMAGE_SIZE' bytes. TARGET specifies whether the
7912desired texture image was one specified by `glTexImage1D'
7913(`GL_TEXTURE_1D'), `glTexImage2D' (`GL_TEXTURE_2D' or any of
7914`GL_TEXTURE_CUBE_MAP_*'), or `glTexImage3D' (`GL_TEXTURE_3D'). LOD
7915specifies the level-of-detail number of the desired image.
7916
7917If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
7918target (see `glBindBuffer') while a texture image is requested, IMG is
7919treated as a byte offset into the buffer object's data store.
7920
7921To minimize errors, first verify that the texture is compressed by
7922calling `glGetTexLevelParameter' with argument `GL_TEXTURE_COMPRESSED'.
7923If the texture is compressed, then determine the amount of memory
7924required to store the compressed texture by calling
7925`glGetTexLevelParameter' with argument
7926`GL_TEXTURE_COMPRESSED_IMAGE_SIZE'. Finally, retrieve the internal
7927format of the texture by calling `glGetTexLevelParameter' with argument
7928`GL_TEXTURE_INTERNAL_FORMAT'. To store the texture for later use,
7929associate the internal format and size with the retrieved texture image.
7930These data can be used by the respective texture or subtexture loading
7931routine used for loading TARGET textures.
7932
7933`GL_INVALID_VALUE' is generated if LOD is less than zero or greater than
7934the maximum number of LODs permitted by the implementation.
7935
7936`GL_INVALID_OPERATION' is generated if `glGetCompressedTexImage' is used
7937to retrieve a texture that is in an uncompressed internal format.
7938
7939`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
7940bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
7941store is currently mapped.
7942
7943`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
7944bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
7945to the buffer object such that the memory writes required would exceed
7946the data store size.
7947
7948`GL_INVALID_OPERATION' is generated if `glGetCompressedTexImage' is
7949executed between the execution of `glBegin' and the corresponding
7950execution of `glEnd'.")
7951
7ec693ed 7952(define-foreign-procedure
bb894c9d
AW
7953 ((glGetConvolutionFilter
7954 (target GLenum)
7955 (format GLenum)
7956 (type GLenum)
7957 (image *)
7958 ->
7959 void))
3c9b6116
AW
7960 "Get current 1D or 2D convolution filter kernel.
7961
7962TARGET
7963 The filter to be retrieved. Must be one of `GL_CONVOLUTION_1D' or
7964 `GL_CONVOLUTION_2D'.
7965
7966FORMAT
7967 Format of the output image. Must be one of `GL_RED', `GL_GREEN',
7968 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
7969 `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
7970
7971TYPE
7972 Data type of components in the output image. Symbolic constants
7973 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
7974 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
7975 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
7976 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
7977 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
7978 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
7979 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
7980 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
7981 are accepted.
7982
7983IMAGE
7984 Pointer to storage for the output image.
7985
7986`glGetConvolutionFilter' returns the current 1D or 2D convolution filter
7987kernel as an image. The one- or two-dimensional image is placed in IMAGE
7988according to the specifications in FORMAT and TYPE. No pixel transfer
7989operations are performed on this image, but the relevant pixel storage
7990modes are applied.
7991
7992If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
7993target (see `glBindBuffer') while a convolution filter is requested,
7994IMAGE is treated as a byte offset into the buffer object's data store.
7995
7996Color components that are present in FORMAT but not included in the
7997internal format of the filter are returned as zero. The assignments of
7998internal color components to the components of FORMAT are as follows.
7999
8000*Internal Component*
8001 *Resulting Component*
8002
8003Red
8004 Red
8005
8006Green
8007 Green
8008
8009Blue
8010 Blue
8011
8012Alpha
8013 Alpha
8014
8015Luminance
8016 Red
8017
8018Intensity
8019 Red
8020
8021
8022
8023`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
8024values.
8025
8026`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8027values.
8028
8029`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
8030values.
8031
8032`GL_INVALID_OPERATION' is generated if TYPE is one of
8033`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8034`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8035is not `GL_RGB'.
8036
8037`GL_INVALID_OPERATION' is generated if TYPE is one of
8038`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8039`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8040`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8041`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8042FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8043
8044`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8045bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8046store is currently mapped.
8047
8048`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8049bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8050to the buffer object such that the memory writes required would exceed
8051the data store size.
8052
8053`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8054bound to the `GL_PIXEL_PACK_BUFFER' target and IMAGE is not evenly
8055divisible into the number of bytes needed to store in memory a datum
8056indicated by TYPE.
8057
8058`GL_INVALID_OPERATION' is generated if `glGetConvolutionFilter' is
8059executed between the execution of `glBegin' and the corresponding
8060execution of `glEnd'.")
8061
7ec693ed 8062(define-foreign-procedure
bb894c9d 8063 ((glGetError -> GLenum))
3c9b6116
AW
8064 "Return error information.
8065
8066`glGetError' returns the value of the error flag. Each detectable error
8067is assigned a numeric code and symbolic name. When an error occurs, the
8068error flag is set to the appropriate error code value. No other errors
8069are recorded until `glGetError' is called, the error code is returned,
8070and the flag is reset to `GL_NO_ERROR'. If a call to `glGetError'
8071returns `GL_NO_ERROR', there has been no detectable error since the last
8072call to `glGetError', or since the GL was initialized.
8073
8074To allow for distributed implementations, there may be several error
8075flags. If any single error flag has recorded an error, the value of that
8076flag is returned and that flag is reset to `GL_NO_ERROR' when
8077`glGetError' is called. If more than one flag has recorded an error,
8078`glGetError' returns and clears an arbitrary error flag value. Thus,
8079`glGetError' should always be called in a loop, until it returns
8080`GL_NO_ERROR', if all error flags are to be reset.
8081
8082Initially, all error flags are set to `GL_NO_ERROR'.
8083
8084The following errors are currently defined:
8085
8086`GL_NO_ERROR'
8087 No error has been recorded. The value of this symbolic constant is
8088 guaranteed to be 0.
8089
8090`GL_INVALID_ENUM'
8091 An unacceptable value is specified for an enumerated argument. The
8092 offending command is ignored and has no other side effect than to
8093 set the error flag.
8094
8095`GL_INVALID_VALUE'
8096 A numeric argument is out of range. The offending command is
8097 ignored and has no other side effect than to set the error flag.
8098
8099`GL_INVALID_OPERATION'
8100 The specified operation is not allowed in the current state. The
8101 offending command is ignored and has no other side effect than to
8102 set the error flag.
8103
8104`GL_STACK_OVERFLOW'
8105 This command would cause a stack overflow. The offending command is
8106 ignored and has no other side effect than to set the error flag.
8107
8108`GL_STACK_UNDERFLOW'
8109 This command would cause a stack underflow. The offending command
8110 is ignored and has no other side effect than to set the error flag.
8111
8112`GL_OUT_OF_MEMORY'
8113 There is not enough memory left to execute the command. The state
8114 of the GL is undefined, except for the state of the error flags,
8115 after this error is recorded.
8116
8117`GL_TABLE_TOO_LARGE'
8118 The specified table exceeds the implementation's maximum supported
8119 table size. The offending command is ignored and has no other side
8120 effect than to set the error flag.
8121
8122When an error flag is set, results of a GL operation are undefined only
8123if `GL_OUT_OF_MEMORY' has occurred. In all other cases, the command
8124generating the error is ignored and has no effect on the GL state or
8125frame buffer contents. If the generating command returns a value, it
8126returns 0. If `glGetError' itself generates an error, it returns 0.
8127
8128`GL_INVALID_OPERATION' is generated if `glGetError' is executed between
8129the execution of `glBegin' and the corresponding execution of `glEnd'.
8130In this case, `glGetError' returns 0.")
8131
7ec693ed 8132(define-foreign-procedure
bb894c9d
AW
8133 ((glGetHistogram
8134 (target GLenum)
8135 (reset GLboolean)
8136 (format GLenum)
8137 (type GLenum)
8138 (values *)
8139 ->
8140 void))
3c9b6116
AW
8141 "Get histogram table.
8142
8143TARGET
8144 Must be `GL_HISTOGRAM'.
8145
8146RESET
8147 If `GL_TRUE', each component counter that is actually returned is
8148 reset to zero. (Other counters are unaffected.) If `GL_FALSE', none
8149 of the counters in the histogram table is modified.
8150
8151FORMAT
8152 The format of values to be returned in VALUES. Must be one of
8153 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR',
8154 `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
8155
8156TYPE
8157 The type of values to be returned in VALUES. Symbolic constants
8158 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
8159 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
8160 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8161 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8162 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8163 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8164 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8165 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8166 are accepted.
8167
8168VALUES
8169 A pointer to storage for the returned histogram table.
8170
8171`glGetHistogram' returns the current histogram table as a
8172one-dimensional image with the same width as the histogram. No pixel
8173transfer operations are performed on this image, but pixel storage modes
8174that are applicable to 1D images are honored.
8175
8176If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8177target (see `glBindBuffer') while a histogram table is requested, VALUES
8178is treated as a byte offset into the buffer object's data store.
8179
8180Color components that are requested in the specified FORMAT, but which
8181are not included in the internal format of the histogram, are returned
8182as zero. The assignments of internal color components to the components
8183requested by FORMAT are:
8184
8185*Internal Component*
8186 *Resulting Component*
8187
8188Red
8189 Red
8190
8191Green
8192 Green
8193
8194Blue
8195 Blue
8196
8197Alpha
8198 Alpha
8199
8200Luminance
8201 Red
8202
8203
8204
8205`GL_INVALID_ENUM' is generated if TARGET is not `GL_HISTOGRAM'.
8206
8207`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8208values.
8209
8210`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
8211values.
8212
8213`GL_INVALID_OPERATION' is generated if TYPE is one of
8214`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8215`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8216is not `GL_RGB'.
8217
8218`GL_INVALID_OPERATION' is generated if TYPE is one of
8219`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8220`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8221`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8222`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8223FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8224
8225`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8226bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8227store is currently mapped.
8228
8229`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8230bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8231to the buffer object such that the memory writes required would exceed
8232the data store size.
8233
8234`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8235bound to the `GL_PIXEL_PACK_BUFFER' target and VALUES is not evenly
8236divisible into the number of bytes needed to store in memory a datum
8237indicated by TYPE.
8238
8239`GL_INVALID_OPERATION' is generated if `glGetHistogram' is executed
8240between the execution of `glBegin' and the corresponding execution of
8241`glEnd'.")
8242
7ec693ed 8243(define-foreign-procedure
bb894c9d
AW
8244 ((glGetMinmax
8245 (target GLenum)
8246 (reset GLboolean)
8247 (format GLenum)
8248 (types GLenum)
8249 (values *)
8250 ->
8251 void))
8252 "Get minimum and maximum pixel values.
3c9b6116 8253
bb894c9d
AW
8254TARGET
8255 Must be `GL_MINMAX'.
3c9b6116 8256
bb894c9d
AW
8257RESET
8258 If `GL_TRUE', all entries in the minmax table that are actually
8259 returned are reset to their initial values. (Other entries are
8260 unaltered.) If `GL_FALSE', the minmax table is unaltered.
3c9b6116 8261
bb894c9d
AW
8262FORMAT
8263 The format of the data to be returned in VALUES. Must be one of
8264 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR',
8265 `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
3c9b6116 8266
bb894c9d
AW
8267TYPES
8268 The type of the data to be returned in VALUES. Symbolic constants
8269 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
8270 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
8271 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8272 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8273 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8274 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8275 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8276 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8277 are accepted.
3c9b6116 8278
bb894c9d
AW
8279VALUES
8280 A pointer to storage for the returned values.
3c9b6116 8281
bb894c9d
AW
8282`glGetMinmax' returns the accumulated minimum and maximum pixel values
8283(computed on a per-component basis) in a one-dimensional image of width
82842. The first set of return values are the minima, and the second set of
8285return values are the maxima. The format of the return values is
8286determined by FORMAT, and their type is determined by TYPES.
3c9b6116 8287
bb894c9d
AW
8288If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8289target (see `glBindBuffer') while minimum and maximum pixel values are
8290requested, VALUES is treated as a byte offset into the buffer object's
8291data store.
3c9b6116 8292
bb894c9d
AW
8293No pixel transfer operations are performed on the return values, but
8294pixel storage modes that are applicable to one-dimensional images are
8295performed. Color components that are requested in the specified FORMAT,
8296but that are not included in the internal format of the minmax table,
8297are returned as zero. The assignment of internal color components to the
8298components requested by FORMAT are as follows:
3c9b6116 8299
3c9b6116 8300
3c9b6116 8301
bb894c9d
AW
8302*Internal Component*
8303 *Resulting Component*
3c9b6116 8304
bb894c9d
AW
8305Red
8306 Red
3c9b6116 8307
bb894c9d
AW
8308Green
8309 Green
3c9b6116 8310
bb894c9d
AW
8311Blue
8312 Blue
3c9b6116 8313
bb894c9d
AW
8314Alpha
8315 Alpha
3c9b6116 8316
bb894c9d
AW
8317Luminance
8318 Red
3c9b6116 8319
bb894c9d
AW
8320If RESET is `GL_TRUE', the minmax table entries corresponding to the
8321return values are reset to their initial values. Minimum and maximum
8322values that are not returned are not modified, even if RESET is
8323`GL_TRUE'.
3c9b6116 8324
bb894c9d 8325`GL_INVALID_ENUM' is generated if TARGET is not `GL_MINMAX'.
3c9b6116
AW
8326
8327`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8328values.
8329
8330`GL_INVALID_ENUM' is generated if TYPES is not one of the allowable
8331values.
8332
8333`GL_INVALID_OPERATION' is generated if TYPES is one of
8334`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8335`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8336is not `GL_RGB'.
8337
8338`GL_INVALID_OPERATION' is generated if TYPES is one of
8339`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8340`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8341`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8342`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8343FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8344
8345`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8346bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8347store is currently mapped.
8348
8349`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8350bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8351to the buffer object such that the memory writes required would exceed
8352the data store size.
8353
8354`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8355bound to the `GL_PIXEL_PACK_BUFFER' target and VALUES is not evenly
8356divisible into the number of bytes needed to store in memory a datum
8357indicated by TYPE.
8358
8359`GL_INVALID_OPERATION' is generated if `glGetMinmax' is executed between
8360the execution of `glBegin' and the corresponding execution of `glEnd'.")
8361
7ec693ed 8362(define-foreign-procedure
bb894c9d 8363 ((glGetPolygonStipple (pattern *) -> void))
3c9b6116
AW
8364 "Return the polygon stipple pattern.
8365
8366PATTERN
8367 Returns the stipple pattern. The initial value is all 1's.
8368
8369`glGetPolygonStipple' returns to PATTERN a 32×32 polygon stipple
8370pattern. The pattern is packed into memory as if `glReadPixels' with
8371both HEIGHT and WIDTH of 32, TYPE of `GL_BITMAP', and FORMAT of
8372`GL_COLOR_INDEX' were called, and the stipple pattern were stored in an
8373internal 32×32 color index buffer. Unlike `glReadPixels', however, pixel
8374transfer operations (shift, offset, pixel map) are not applied to the
8375returned stipple image.
8376
8377If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8378target (see `glBindBuffer') while a polygon stipple pattern is
8379requested, PATTERN is treated as a byte offset into the buffer object's
8380data store.
8381
8382`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8383bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8384store is currently mapped.
8385
8386`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8387bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8388to the buffer object such that the memory writes required would exceed
8389the data store size.
8390
8391`GL_INVALID_OPERATION' is generated if `glGetPolygonStipple' is executed
8392between the execution of `glBegin' and the corresponding execution of
8393`glEnd'.")
8394
7ec693ed 8395(define-foreign-procedure
bb894c9d
AW
8396 ((glGetProgramInfoLog
8397 (program GLuint)
8398 (maxLength GLsizei)
8399 (length *)
8400 (infoLog *)
8401 ->
8402 void))
3c9b6116
AW
8403 "Returns the information log for a program object.
8404
8405PROGRAM
8406 Specifies the program object whose information log is to be
8407 queried.
8408
8409MAXLENGTH
8410 Specifies the size of the character buffer for storing the returned
8411 information log.
8412
8413LENGTH
8414 Returns the length of the string returned in INFOLOG (excluding the
8415 null terminator).
8416
8417INFOLOG
8418 Specifies an array of characters that is used to return the
8419 information log.
8420
8421`glGetProgramInfoLog' returns the information log for the specified
8422program object. The information log for a program object is modified
8423when the program object is linked or validated. The string that is
8424returned will be null terminated.
8425
8426`glGetProgramInfoLog' returns in INFOLOG as much of the information log
8427as it can, up to a maximum of MAXLENGTH characters. The number of
8428characters actually returned, excluding the null termination character,
8429is specified by LENGTH. If the length of the returned string is not
8430required, a value of `NULL' can be passed in the LENGTH argument. The
8431size of the buffer required to store the returned information log can be
8432obtained by calling `glGetProgram' with the value `GL_INFO_LOG_LENGTH'.
8433
8434The information log for a program object is either an empty string, or a
8435string containing information about the last link operation, or a string
8436containing information about the last validation operation. It may
8437contain diagnostic messages, warning messages, and other information.
8438When a program object is created, its information log will be a string
8439of length 0.
8440
8441`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
8442OpenGL.
8443
8444`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
8445
8446`GL_INVALID_VALUE' is generated if MAXLENGTH is less than 0.
8447
8448`GL_INVALID_OPERATION' is generated if `glGetProgramInfoLog' is executed
8449between the execution of `glBegin' and the corresponding execution of
8450`glEnd'.")
8451
7ec693ed 8452(define-foreign-procedure
bb894c9d
AW
8453 ((glGetSeparableFilter
8454 (target GLenum)
8455 (format GLenum)
8456 (type GLenum)
8457 (row *)
8458 (column *)
8459 (span *)
8460 ->
8461 void))
8462 "Get separable convolution filter kernel images.
3c9b6116 8463
bb894c9d
AW
8464TARGET
8465 The separable filter to be retrieved. Must be `GL_SEPARABLE_2D'.
3c9b6116 8466
bb894c9d
AW
8467FORMAT
8468 Format of the output images. Must be one of `GL_RED', `GL_GREEN',
8469 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR'`GL_RGBA', `GL_BGRA',
8470 `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
3c9b6116 8471
bb894c9d
AW
8472TYPE
8473 Data type of components in the output images. Symbolic constants
8474 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
8475 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
8476 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8477 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8478 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8479 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8480 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8481 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8482 are accepted.
3c9b6116 8483
bb894c9d
AW
8484ROW
8485 Pointer to storage for the row filter image.
3c9b6116 8486
bb894c9d
AW
8487COLUMN
8488 Pointer to storage for the column filter image.
3c9b6116 8489
bb894c9d
AW
8490SPAN
8491 Pointer to storage for the span filter image (currently unused).
3c9b6116 8492
bb894c9d
AW
8493`glGetSeparableFilter' returns the two one-dimensional filter kernel
8494images for the current separable 2D convolution filter. The row image is
8495placed in ROW and the column image is placed in COLUMN according to the
8496specifications in FORMAT and TYPE. (In the current implementation, SPAN
8497is not affected in any way.) No pixel transfer operations are performed
8498on the images, but the relevant pixel storage modes are applied.
3c9b6116 8499
bb894c9d
AW
8500If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8501target (see `glBindBuffer') while a separable convolution filter is
8502requested, ROW, COLUMN, and SPAN are treated as a byte offset into the
8503buffer object's data store.
3c9b6116 8504
bb894c9d
AW
8505Color components that are present in FORMAT but not included in the
8506internal format of the filters are returned as zero. The assignments of
8507internal color components to the components of FORMAT are as follows:
3c9b6116 8508
3c9b6116 8509
3c9b6116 8510
bb894c9d
AW
8511*Internal Component*
8512 *Resulting Component*
3c9b6116 8513
bb894c9d
AW
8514Red
8515 Red
3c9b6116 8516
bb894c9d
AW
8517Green
8518 Green
3c9b6116 8519
bb894c9d
AW
8520Blue
8521 Blue
3c9b6116 8522
bb894c9d
AW
8523Alpha
8524 Alpha
3c9b6116 8525
bb894c9d
AW
8526Luminance
8527 Red
3c9b6116 8528
bb894c9d
AW
8529Intensity
8530 Red
3c9b6116 8531
3c9b6116 8532
3c9b6116 8533
bb894c9d 8534`GL_INVALID_ENUM' is generated if TARGET is not `GL_SEPARABLE_2D'.
3c9b6116 8535
bb894c9d
AW
8536`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8537values.
3c9b6116 8538
bb894c9d
AW
8539`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
8540values.
3c9b6116 8541
bb894c9d
AW
8542`GL_INVALID_OPERATION' is generated if TYPE is one of
8543`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8544`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8545is not `GL_RGB'.
3c9b6116 8546
bb894c9d
AW
8547`GL_INVALID_OPERATION' is generated if TYPE is one of
8548`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8549`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8550`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8551`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8552FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
3c9b6116 8553
bb894c9d
AW
8554`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8555bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8556store is currently mapped.
3c9b6116 8557
bb894c9d
AW
8558`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8559bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8560to the buffer object such that the memory writes required would exceed
8561the data store size.
3c9b6116 8562
bb894c9d
AW
8563`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8564bound to the `GL_PIXEL_PACK_BUFFER' target and ROW or COLUMN is not
8565evenly divisible into the number of bytes needed to store in memory a
8566datum indicated by TYPE.
3c9b6116 8567
bb894c9d
AW
8568`GL_INVALID_OPERATION' is generated if `glGetSeparableFilter' is
8569executed between the execution of `glBegin' and the corresponding
8570execution of `glEnd'.")
3c9b6116 8571
7ec693ed 8572(define-foreign-procedure
bb894c9d
AW
8573 ((glGetShaderInfoLog
8574 (shader GLuint)
8575 (maxLength GLsizei)
8576 (length *)
8577 (infoLog *)
8578 ->
8579 void))
3c9b6116
AW
8580 "Returns the information log for a shader object.
8581
8582SHADER
8583 Specifies the shader object whose information log is to be queried.
8584
8585MAXLENGTH
8586 Specifies the size of the character buffer for storing the returned
8587 information log.
8588
8589LENGTH
8590 Returns the length of the string returned in INFOLOG (excluding the
8591 null terminator).
8592
8593INFOLOG
8594 Specifies an array of characters that is used to return the
8595 information log.
8596
8597`glGetShaderInfoLog' returns the information log for the specified
8598shader object. The information log for a shader object is modified when
8599the shader is compiled. The string that is returned will be null
8600terminated.
8601
8602`glGetShaderInfoLog' returns in INFOLOG as much of the information log
8603as it can, up to a maximum of MAXLENGTH characters. The number of
8604characters actually returned, excluding the null termination character,
8605is specified by LENGTH. If the length of the returned string is not
8606required, a value of `NULL' can be passed in the LENGTH argument. The
8607size of the buffer required to store the returned information log can be
8608obtained by calling `glGetShader' with the value `GL_INFO_LOG_LENGTH'.
8609
8610The information log for a shader object is a string that may contain
8611diagnostic messages, warning messages, and other information about the
8612last compile operation. When a shader object is created, its information
8613log will be a string of length 0.
8614
8615`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
8616OpenGL.
8617
8618`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
8619
8620`GL_INVALID_VALUE' is generated if MAXLENGTH is less than 0.
8621
8622`GL_INVALID_OPERATION' is generated if `glGetShaderInfoLog' is executed
8623between the execution of `glBegin' and the corresponding execution of
8624`glEnd'.")
8625
7ec693ed 8626(define-foreign-procedure
bb894c9d
AW
8627 ((glGetShaderSource
8628 (shader GLuint)
8629 (bufSize GLsizei)
8630 (length *)
8631 (source *)
8632 ->
8633 void))
3c9b6116
AW
8634 "Returns the source code string from a shader object.
8635
8636SHADER
8637 Specifies the shader object to be queried.
8638
8639BUFSIZE
8640 Specifies the size of the character buffer for storing the returned
8641 source code string.
8642
8643LENGTH
8644 Returns the length of the string returned in SOURCE (excluding the
8645 null terminator).
8646
8647SOURCE
8648 Specifies an array of characters that is used to return the source
8649 code string.
8650
8651`glGetShaderSource' returns the concatenation of the source code strings
8652from the shader object specified by SHADER. The source code strings for
8653a shader object are the result of a previous call to `glShaderSource'.
8654The string returned by the function will be null terminated.
8655
8656`glGetShaderSource' returns in SOURCE as much of the source code string
8657as it can, up to a maximum of BUFSIZE characters. The number of
8658characters actually returned, excluding the null termination character,
8659is specified by LENGTH. If the length of the returned string is not
8660required, a value of `NULL' can be passed in the LENGTH argument. The
8661size of the buffer required to store the returned source code string can
8662be obtained by calling `glGetShader' with the value
8663`GL_SHADER_SOURCE_LENGTH'.
8664
8665`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
8666OpenGL.
8667
bb894c9d 8668`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
3c9b6116 8669
bb894c9d 8670`GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.
3c9b6116 8671
bb894c9d
AW
8672`GL_INVALID_OPERATION' is generated if `glGetShaderSource' is executed
8673between the execution of `glBegin' and the corresponding execution of
8674`glEnd'.")
3c9b6116 8675
7ec693ed 8676(define-foreign-procedure
bb894c9d
AW
8677 ((glGetString (name GLenum) -> *))
8678 "Return a string describing the current GL connection.
3c9b6116 8679
bb894c9d
AW
8680NAME
8681 Specifies a symbolic constant, one of `GL_VENDOR', `GL_RENDERER',
8682 `GL_VERSION', `GL_SHADING_LANGUAGE_VERSION', or `GL_EXTENSIONS'.
3c9b6116 8683
bb894c9d
AW
8684`glGetString' returns a pointer to a static string describing some
8685aspect of the current GL connection. NAME can be one of the following:
3c9b6116 8686
bb894c9d 8687`GL_VENDOR'
3c9b6116 8688
3c9b6116 8689
bb894c9d
AW
8690 Returns the company responsible for this GL implementation. This
8691 name does not change from release to release.
3c9b6116 8692
bb894c9d 8693`GL_RENDERER'
3c9b6116 8694
3c9b6116 8695
bb894c9d
AW
8696 Returns the name of the renderer. This name is typically specific
8697 to a particular configuration of a hardware platform. It does not
8698 change from release to release.
3c9b6116 8699
bb894c9d 8700`GL_VERSION'
3c9b6116 8701
3c9b6116 8702
bb894c9d 8703 Returns a version or release number.
3c9b6116 8704
bb894c9d 8705`GL_SHADING_LANGUAGE_VERSION'
3c9b6116 8706
3c9b6116 8707
bb894c9d 8708 Returns a version or release number for the shading language.
3c9b6116 8709
bb894c9d 8710`GL_EXTENSIONS'
3c9b6116 8711
3c9b6116 8712
bb894c9d 8713 Returns a space-separated list of supported extensions to GL.
3c9b6116 8714
bb894c9d
AW
8715Because the GL does not include queries for the performance
8716characteristics of an implementation, some applications are written to
8717recognize known platforms and modify their GL usage based on known
8718performance characteristics of these platforms. Strings `GL_VENDOR' and
8719`GL_RENDERER' together uniquely specify a platform. They do not change
8720from release to release and should be used by platform-recognition
8721algorithms.
3c9b6116 8722
bb894c9d
AW
8723Some applications want to make use of features that are not part of the
8724standard GL. These features may be implemented as extensions to the
8725standard GL. The `GL_EXTENSIONS' string is a space-separated list of
8726supported GL extensions. (Extension names never contain a space
8727character.)
3c9b6116 8728
bb894c9d
AW
8729The `GL_VERSION' and `GL_SHADING_LANGUAGE_VERSION' strings begin with a
8730version number. The version number uses one of these forms:
3c9b6116 8731
bb894c9d 8732MAJOR_NUMBER.MINOR_NUMBERMAJOR_NUMBER.MINOR_NUMBER.RELEASE_NUMBER
3c9b6116 8733
bb894c9d
AW
8734Vendor-specific information may follow the version number. Its format
8735depends on the implementation, but a space always separates the version
8736number and the vendor-specific information.
3c9b6116 8737
bb894c9d 8738All strings are null-terminated.
3c9b6116 8739
bb894c9d 8740`GL_INVALID_ENUM' is generated if NAME is not an accepted value.
3c9b6116 8741
bb894c9d
AW
8742`GL_INVALID_OPERATION' is generated if `glGetString' is executed between
8743the execution of `glBegin' and the corresponding execution of `glEnd'.")
3c9b6116 8744
7ec693ed 8745(define-foreign-procedure
bb894c9d
AW
8746 ((glGetTexImage
8747 (target GLenum)
8748 (level GLint)
8749 (format GLenum)
8750 (type GLenum)
8751 (img *)
8752 ->
8753 void))
8754 "Return a texture image.
3c9b6116 8755
bb894c9d
AW
8756TARGET
8757 Specifies which texture is to be obtained. `GL_TEXTURE_1D',
8758 `GL_TEXTURE_2D', `GL_TEXTURE_3D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
8759 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
8760 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
8761 and `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z' are accepted.
3c9b6116 8762
bb894c9d
AW
8763LEVEL
8764 Specifies the level-of-detail number of the desired image. Level 0
8765 is the base image level. Level N is the N th mipmap reduction
8766 image.
3c9b6116 8767
bb894c9d
AW
8768FORMAT
8769 Specifies a pixel format for the returned data. The supported
8770 formats are `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB',
8771 `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and
8772 `GL_LUMINANCE_ALPHA'.
3c9b6116 8773
bb894c9d
AW
8774TYPE
8775 Specifies a pixel type for the returned data. The supported types
8776 are `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
8777 `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2',
8778 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
8779 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
8780 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
8781 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
8782 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
8783 `GL_UNSIGNED_INT_2_10_10_10_REV'.
3c9b6116 8784
bb894c9d
AW
8785IMG
8786 Returns the texture image. Should be a pointer to an array of the
8787 type specified by TYPE.
3c9b6116 8788
bb894c9d
AW
8789`glGetTexImage' returns a texture image into IMG. TARGET specifies
8790whether the desired texture image is one specified by `glTexImage1D'
8791(`GL_TEXTURE_1D'), `glTexImage2D' (`GL_TEXTURE_2D' or any of
8792`GL_TEXTURE_CUBE_MAP_*'), or `glTexImage3D' (`GL_TEXTURE_3D'). LEVEL
8793specifies the level-of-detail number of the desired image. FORMAT and
8794TYPE specify the format and type of the desired image array. See the
8795reference pages `glTexImage1D' and `glDrawPixels' for a description of
8796the acceptable values for the FORMAT and TYPE parameters, respectively.
3c9b6116 8797
bb894c9d
AW
8798If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8799target (see `glBindBuffer') while a texture image is requested, IMG is
8800treated as a byte offset into the buffer object's data store.
3c9b6116 8801
bb894c9d
AW
8802To understand the operation of `glGetTexImage', consider the selected
8803internal four-component texture image to be an RGBA color buffer the
8804size of the image. The semantics of `glGetTexImage' are then identical
8805to those of `glReadPixels', with the exception that no pixel transfer
8806operations are performed, when called with the same FORMAT and TYPE,
8807with X and Y set to 0, WIDTH set to the width of the texture image
8808(including border if one was specified), and HEIGHT set to 1 for 1D
8809images, or to the height of the texture image (including border if one
8810was specified) for 2D images. Because the internal texture image is an
8811RGBA image, pixel formats `GL_COLOR_INDEX', `GL_STENCIL_INDEX', and
8812`GL_DEPTH_COMPONENT' are not accepted, and pixel type `GL_BITMAP' is not
8813accepted.
3c9b6116 8814
bb894c9d
AW
8815If the selected texture image does not contain four components, the
8816following mappings are applied. Single-component textures are treated as
8817RGBA buffers with red set to the single-component value, green set to 0,
8818blue set to 0, and alpha set to 1. Two-component textures are treated as
8819RGBA buffers with red set to the value of component zero, alpha set to
8820the value of component one, and green and blue set to 0. Finally,
8821three-component textures are treated as RGBA buffers with red set to
8822component zero, green set to component one, blue set to component two,
8823and alpha set to 1.
3c9b6116 8824
bb894c9d
AW
8825To determine the required size of IMG, use `glGetTexLevelParameter' to
8826determine the dimensions of the internal texture image, then scale the
8827required number of pixels by the storage required for each pixel, based
8828on FORMAT and TYPE. Be sure to take the pixel storage parameters into
8829account, especially `GL_PACK_ALIGNMENT'.
3c9b6116 8830
bb894c9d
AW
8831`GL_INVALID_ENUM' is generated if TARGET, FORMAT, or TYPE is not an
8832accepted value.
3c9b6116 8833
bb894c9d 8834`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
3c9b6116 8835
bb894c9d
AW
8836`GL_INVALID_VALUE' may be generated if LEVEL is greater than
8837LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
3c9b6116 8838
bb894c9d
AW
8839`GL_INVALID_OPERATION' is returned if TYPE is one of
8840`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8841`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8842is not `GL_RGB'.
3c9b6116 8843
bb894c9d
AW
8844`GL_INVALID_OPERATION' is returned if TYPE is one of
8845`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8846`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8847`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8848`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV', and
8849FORMAT is neither `GL_RGBA' or `GL_BGRA'.
3c9b6116 8850
bb894c9d
AW
8851`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8852bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8853store is currently mapped.
3c9b6116 8854
bb894c9d
AW
8855`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8856bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8857to the buffer object such that the memory writes required would exceed
8858the data store size.
3c9b6116 8859
bb894c9d
AW
8860`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8861bound to the `GL_PIXEL_PACK_BUFFER' target and IMG is not evenly
8862divisible into the number of bytes needed to store in memory a datum
8863indicated by TYPE.
3c9b6116 8864
bb894c9d
AW
8865`GL_INVALID_OPERATION' is generated if `glGetTexImage' is executed
8866between the execution of `glBegin' and the corresponding execution of
8867`glEnd'.")
3c9b6116 8868
7ec693ed 8869(define-foreign-procedure
bb894c9d
AW
8870 ((glGetUniformLocation
8871 (program GLuint)
8872 (name *)
8873 ->
8874 GLint))
8875 "Returns the location of a uniform variable.
3c9b6116 8876
bb894c9d
AW
8877PROGRAM
8878 Specifies the program object to be queried.
3c9b6116 8879
bb894c9d
AW
8880NAME
8881 Points to a null terminated string containing the name of the
8882 uniform variable whose location is to be queried.
3c9b6116 8883
bb894c9d
AW
8884`glGetUniformLocation ' returns an integer that represents the location
8885of a specific uniform variable within a program object. NAME must be a
8886null terminated string that contains no white space. NAME must be an
8887active uniform variable name in PROGRAM that is not a structure, an
8888array of structures, or a subcomponent of a vector or a matrix. This
8889function returns -1 if NAME does not correspond to an active uniform
8890variable in PROGRAM or if NAME starts with the reserved prefix \"gl_\".
3c9b6116 8891
bb894c9d
AW
8892Uniform variables that are structures or arrays of structures may be
8893queried by calling `glGetUniformLocation' for each field within the
8894structure. The array element operator \"[]\" and the structure field
8895operator \".\" may be used in NAME in order to select elements within an
8896array or fields within a structure. The result of using these operators
8897is not allowed to be another structure, an array of structures, or a
8898subcomponent of a vector or a matrix. Except if the last part of NAME
8899indicates a uniform variable array, the location of the first element of
8900an array can be retrieved by using the name of the array, or by using
8901the name appended by \"[0]\".
3c9b6116 8902
bb894c9d
AW
8903The actual locations assigned to uniform variables are not known until
8904the program object is linked successfully. After linking has occurred,
8905the command `glGetUniformLocation' can be used to obtain the location of
8906a uniform variable. This location value can then be passed to
8907`glUniform' to set the value of the uniform variable or to
8908`glGetUniform' in order to query the current value of the uniform
8909variable. After a program object has been linked successfully, the index
8910values for uniform variables remain fixed until the next link command
8911occurs. Uniform variable locations and values can only be queried after
8912a link if the link was successful.
3c9b6116 8913
bb894c9d
AW
8914`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
8915OpenGL.
3c9b6116 8916
bb894c9d 8917`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
3c9b6116 8918
bb894c9d
AW
8919`GL_INVALID_OPERATION' is generated if PROGRAM has not been successfully
8920linked.
3c9b6116 8921
bb894c9d
AW
8922`GL_INVALID_OPERATION' is generated if `glGetUniformLocation' is
8923executed between the execution of `glBegin' and the corresponding
8924execution of `glEnd'.")
3c9b6116 8925
7ec693ed 8926(define-foreign-procedure
bb894c9d 8927 ((glHint (target GLenum) (mode GLenum) -> void))
3c9b6116
AW
8928 "Specify implementation-specific hints.
8929
8930TARGET
8931 Specifies a symbolic constant indicating the behavior to be
8932 controlled. `GL_FOG_HINT', `GL_GENERATE_MIPMAP_HINT',
8933 `GL_LINE_SMOOTH_HINT', `GL_PERSPECTIVE_CORRECTION_HINT',
8934 `GL_POINT_SMOOTH_HINT', `GL_POLYGON_SMOOTH_HINT',
8935 `GL_TEXTURE_COMPRESSION_HINT', and
8936 `GL_FRAGMENT_SHADER_DERIVATIVE_HINT' are accepted.
8937
8938MODE
8939 Specifies a symbolic constant indicating the desired behavior.
8940 `GL_FASTEST', `GL_NICEST', and `GL_DONT_CARE' are accepted.
8941
8942Certain aspects of GL behavior, when there is room for interpretation,
8943can be controlled with hints. A hint is specified with two arguments.
8944TARGET is a symbolic constant indicating the behavior to be controlled,
8945and MODE is another symbolic constant indicating the desired behavior.
8946The initial value for each TARGET is `GL_DONT_CARE'. MODE can be one of
8947the following:
8948
8949`GL_FASTEST'
8950
8951
8952 The most efficient option should be chosen.
8953
8954`GL_NICEST'
8955
8956
8957 The most correct, or highest quality, option should be chosen.
8958
8959`GL_DONT_CARE'
8960
8961
8962 No preference.
8963
8964Though the implementation aspects that can be hinted are well defined,
8965the interpretation of the hints depends on the implementation. The hint
8966aspects that can be specified with TARGET, along with suggested
8967semantics, are as follows:
8968
8969`GL_FOG_HINT'
8970
8971
8972 Indicates the accuracy of fog calculation. If per-pixel fog
8973 calculation is not efficiently supported by the GL implementation,
8974 hinting `GL_DONT_CARE' or `GL_FASTEST' can result in per-vertex
8975 calculation of fog effects.
8976
8977`GL_FRAGMENT_SHADER_DERIVATIVE_HINT'
8978
8979
8980 Indicates the accuracy of the derivative calculation for the GL
8981 shading language fragment processing built-in functions: `dFdx',
8982 `dFdy', and `fwidth'.
8983
8984`GL_GENERATE_MIPMAP_HINT'
8985
8986
8987 Indicates the quality of filtering when generating mipmap images.
8988
8989`GL_LINE_SMOOTH_HINT'
8990
8991
8992 Indicates the sampling quality of antialiased lines. If a larger
8993 filter function is applied, hinting `GL_NICEST' can result in more
8994 pixel fragments being generated during rasterization.
8995
8996`GL_PERSPECTIVE_CORRECTION_HINT'
8997
8998
8999 Indicates the quality of color, texture coordinate, and fog
9000 coordinate interpolation. If perspective-corrected parameter
9001 interpolation is not efficiently supported by the GL
9002 implementation, hinting `GL_DONT_CARE' or `GL_FASTEST' can result
9003 in simple linear interpolation of colors and/or texture
9004 coordinates.
9005
9006`GL_POINT_SMOOTH_HINT'
9007
9008
9009 Indicates the sampling quality of antialiased points. If a larger
9010 filter function is applied, hinting `GL_NICEST' can result in more
9011 pixel fragments being generated during rasterization.
9012
9013`GL_POLYGON_SMOOTH_HINT'
9014
9015
9016 Indicates the sampling quality of antialiased polygons. Hinting
9017 `GL_NICEST' can result in more pixel fragments being generated
9018 during rasterization, if a larger filter function is applied.
9019
9020`GL_TEXTURE_COMPRESSION_HINT'
9021
9022
9023 Indicates the quality and performance of the compressing texture
9024 images. Hinting `GL_FASTEST' indicates that texture images should
9025 be compressed as quickly as possible, while `GL_NICEST' indicates
9026 that texture images should be compressed with as little image
9027 quality loss as possible. `GL_NICEST' should be selected if the
9028 texture is to be retrieved by `glGetCompressedTexImage' for reuse.
9029
9030`GL_INVALID_ENUM' is generated if either TARGET or MODE is not an
9031accepted value.
9032
9033`GL_INVALID_OPERATION' is generated if `glHint' is executed between the
9034execution of `glBegin' and the corresponding execution of `glEnd'.")
9035
7ec693ed 9036(define-foreign-procedure
bb894c9d
AW
9037 ((glHistogram
9038 (target GLenum)
9039 (width GLsizei)
9040 (internalformat GLenum)
9041 (sink GLboolean)
9042 ->
9043 void))
3c9b6116
AW
9044 "Define histogram table.
9045
9046TARGET
9047 The histogram whose parameters are to be set. Must be one of
9048 `GL_HISTOGRAM' or `GL_PROXY_HISTOGRAM'.
9049
9050WIDTH
9051 The number of entries in the histogram table. Must be a power of 2.
9052
9053INTERNALFORMAT
9054 The format of entries in the histogram table. Must be one of
9055 `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
9056 `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
9057 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
9058 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
9059 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
9060 `GL_LUMINANCE16_ALPHA16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4',
9061 `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16',
9062 `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8',
9063 `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'.
9064
9065SINK
9066 If `GL_TRUE', pixels will be consumed by the histogramming process
9067 and no drawing or texture loading will take place. If `GL_FALSE',
9068 pixels will proceed to the minmax process after histogramming.
9069
9070When `GL_HISTOGRAM' is enabled, RGBA color components are converted to
9071histogram table indices by clamping to the range [0,1], multiplying by
9072the width of the histogram table, and rounding to the nearest integer.
9073The table entries selected by the RGBA indices are then incremented. (If
9074the internal format of the histogram table includes luminance, then the
9075index derived from the R color component determines the luminance table
9076entry to be incremented.) If a histogram table entry is incremented
9077beyond its maximum value, then its value becomes undefined. (This is not
9078an error.)
9079
9080Histogramming is performed only for RGBA pixels (though these may be
9081specified originally as color indices and converted to RGBA by index
9082table lookup). Histogramming is enabled with `glEnable' and disabled
9083with `glDisable'.
9084
9085When TARGET is `GL_HISTOGRAM', `glHistogram' redefines the current
9086histogram table to have WIDTH entries of the format specified by
9087INTERNALFORMAT. The entries are indexed 0 through WIDTH-1 , and all
9088entries are initialized to zero. The values in the previous histogram
9089table, if any, are lost. If SINK is `GL_TRUE', then pixels are discarded
9090after histogramming; no further processing of the pixels takes place,
9091and no drawing, texture loading, or pixel readback will result.
9092
9093When TARGET is `GL_PROXY_HISTOGRAM', `glHistogram' computes all state
9094information as if the histogram table were to be redefined, but does not
9095actually define the new table. If the requested histogram table is too
9096large to be supported, then the state information will be set to zero.
9097This provides a way to determine if a histogram table with the given
9098parameters can be supported.
9099
9100
9101
9102`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
9103values.
9104
9105`GL_INVALID_VALUE' is generated if WIDTH is less than zero or is not a
9106power of 2.
9107
9108`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
9109allowable values.
9110
9111`GL_TABLE_TOO_LARGE' is generated if TARGET is `GL_HISTOGRAM' and the
9112histogram table specified is too large for the implementation.
9113
9114`GL_INVALID_OPERATION' is generated if `glHistogram' is executed between
9115the execution of `glBegin' and the corresponding execution of `glEnd'.")
9116
7ec693ed 9117(define-foreign-procedure
bb894c9d 9118 ((glIndexMask (mask GLuint) -> void))
3c9b6116
AW
9119 "Control the writing of individual bits in the color index buffers.
9120
9121MASK
9122 Specifies a bit mask to enable and disable the writing of
9123 individual bits in the color index buffers. Initially, the mask is
9124 all 1's.
9125
9126`glIndexMask' controls the writing of individual bits in the color index
9127buffers. The least significant N bits of MASK, where N is the number of
9128bits in a color index buffer, specify a mask. Where a 1 (one) appears in
9129the mask, it's possible to write to the corresponding bit in the color
9130index buffer (or buffers). Where a 0 (zero) appears, the corresponding
9131bit is write-protected.
9132
9133This mask is used only in color index mode, and it affects only the
9134buffers currently selected for writing (see `glDrawBuffer'). Initially,
9135all bits are enabled for writing.
9136
9137`GL_INVALID_OPERATION' is generated if `glIndexMask' is executed between
9138the execution of `glBegin' and the corresponding execution of `glEnd'.")
9139
7ec693ed 9140(define-foreign-procedure
bb894c9d
AW
9141 ((glIndexPointer
9142 (type GLenum)
9143 (stride GLsizei)
9144 (pointer *)
9145 ->
9146 void))
3c9b6116
AW
9147 "Define an array of color indexes.
9148
9149TYPE
9150 Specifies the data type of each color index in the array. Symbolic
9151 constants `GL_UNSIGNED_BYTE', `GL_SHORT', `GL_INT', `GL_FLOAT', and
9152 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
9153
9154STRIDE
9155 Specifies the byte offset between consecutive color indexes. If
9156 STRIDE is 0, the color indexes are understood to be tightly packed
9157 in the array. The initial value is 0.
9158
9159POINTER
9160 Specifies a pointer to the first index in the array. The initial
9161 value is 0.
9162
9163`glIndexPointer' specifies the location and data format of an array of
9164color indexes to use when rendering. TYPE specifies the data type of
9165each color index and STRIDE specifies the byte stride from one color
9166index to the next, allowing vertices and attributes to be packed into a
9167single array or stored in separate arrays.
9168
9169If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
9170target (see `glBindBuffer') while a color index array is specified,
9171POINTER is treated as a byte offset into the buffer object's data store.
9172Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
9173color index vertex array client-side state
9174(`GL_INDEX_ARRAY_BUFFER_BINDING').
9175
9176When a color index array is specified, TYPE, STRIDE, and POINTER are
9177saved as client-side state, in addition to the current vertex array
9178buffer object binding.
9179
9180To enable and disable the color index array, call `glEnableClientState'
9181and `glDisableClientState' with the argument `GL_INDEX_ARRAY'. If
9182enabled, the color index array is used when `glDrawArrays',
9183`glMultiDrawArrays', `glDrawElements', `glMultiDrawElements',
9184`glDrawRangeElements', or `glArrayElement' is called.
9185
9186`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
9187
9188`GL_INVALID_VALUE' is generated if STRIDE is negative.")
9189
7ec693ed 9190(define-foreign-procedure
bb894c9d
AW
9191 ((glIndexi (c GLint) -> void)
9192 (glIndexd (c GLdouble) -> void)
9193 (glIndexub (c GLubyte) -> void))
3c9b6116
AW
9194 "Set the current color index.
9195
9196C
9197 Specifies the new value for the current color index.
9198
9199
9200
9201`glIndex' updates the current (single-valued) color index. It takes one
9202argument, the new value for the current color index.
9203
9204The current index is stored as a floating-point value. Integer values
9205are converted directly to floating-point values, with no special
9206mapping. The initial value is 1.
9207
9208Index values outside the representable range of the color index buffer
9209are not clamped. However, before an index is dithered (if enabled) and
9210written to the frame buffer, it is converted to fixed-point format. Any
9211bits in the integer portion of the resulting fixed-point value that do
9212not correspond to bits in the frame buffer are masked out.")
9213
7ec693ed 9214(define-foreign-procedure
bb894c9d 9215 ((glInitNames -> void))
3c9b6116
AW
9216 "Initialize the name stack.
9217
9218The name stack is used during selection mode to allow sets of rendering
9219commands to be uniquely identified. It consists of an ordered set of
9220unsigned integers. `glInitNames' causes the name stack to be initialized
9221to its default empty state.
9222
9223The name stack is always empty while the render mode is not `GL_SELECT'.
9224Calls to `glInitNames' while the render mode is not `GL_SELECT' are
9225ignored.
9226
9227`GL_INVALID_OPERATION' is generated if `glInitNames' is executed between
9228the execution of `glBegin' and the corresponding execution of `glEnd'.")
9229
7ec693ed 9230(define-foreign-procedure
bb894c9d
AW
9231 ((glInterleavedArrays
9232 (format GLenum)
9233 (stride GLsizei)
9234 (pointer *)
9235 ->
9236 void))
3c9b6116
AW
9237 "Simultaneously specify and enable several interleaved arrays.
9238
9239FORMAT
9240 Specifies the type of array to enable. Symbolic constants `GL_V2F',
9241 `GL_V3F', `GL_C4UB_V2F', `GL_C4UB_V3F', `GL_C3F_V3F', `GL_N3F_V3F',
9242 `GL_C4F_N3F_V3F', `GL_T2F_V3F', `GL_T4F_V4F', `GL_T2F_C4UB_V3F',
9243 `GL_T2F_C3F_V3F', `GL_T2F_N3F_V3F', `GL_T2F_C4F_N3F_V3F', and
9244 `GL_T4F_C4F_N3F_V4F' are accepted.
9245
9246STRIDE
9247 Specifies the offset in bytes between each aggregate array element.
9248
9249`glInterleavedArrays' lets you specify and enable individual color,
9250normal, texture and vertex arrays whose elements are part of a larger
9251aggregate array element. For some implementations, this is more
9252efficient than specifying the arrays separately.
9253
9254If STRIDE is 0, the aggregate elements are stored consecutively.
9255Otherwise, STRIDE bytes occur between the beginning of one aggregate
9256array element and the beginning of the next aggregate array element.
9257
9258FORMAT serves as a ``key'' describing the extraction of individual
9259arrays from the aggregate array. If FORMAT contains a T, then texture
9260coordinates are extracted from the interleaved array. If C is present,
9261color values are extracted. If N is present, normal coordinates are
9262extracted. Vertex coordinates are always extracted.
9263
9264The digits 2, 3, and 4 denote how many values are extracted. F indicates
9265that values are extracted as floating-point values. Colors may also be
9266extracted as 4 unsigned bytes if 4UB follows the C. If a color is
9267extracted as 4 unsigned bytes, the vertex array element which follows is
9268located at the first possible floating-point aligned address.
9269
9270`GL_INVALID_ENUM' is generated if FORMAT is not an accepted value.
9271
9272`GL_INVALID_VALUE' is generated if STRIDE is negative.")
9273
7ec693ed 9274(define-foreign-procedure
bb894c9d 9275 ((glIsBuffer (buffer GLuint) -> GLboolean))
3c9b6116
AW
9276 "Determine if a name corresponds to a buffer object.
9277
9278BUFFER
9279 Specifies a value that may be the name of a buffer object.
9280
9281`glIsBuffer' returns `GL_TRUE' if BUFFER is currently the name of a
9282buffer object. If BUFFER is zero, or is a non-zero value that is not
9283currently the name of a buffer object, or if an error occurs,
9284`glIsBuffer' returns `GL_FALSE'.
9285
9286A name returned by `glGenBuffers', but not yet associated with a buffer
9287object by calling `glBindBuffer', is not the name of a buffer object.
9288
9289`GL_INVALID_OPERATION' is generated if `glIsBuffer' is executed between
9290the execution of `glBegin' and the corresponding execution of `glEnd'.")
9291
7ec693ed 9292(define-foreign-procedure
bb894c9d 9293 ((glIsEnabled (cap GLenum) -> GLboolean))
3c9b6116
AW
9294 "Test whether a capability is enabled.
9295
9296CAP
9297 Specifies a symbolic constant indicating a GL capability.
9298
9299`glIsEnabled' returns `GL_TRUE' if CAP is an enabled capability and
9300returns `GL_FALSE' otherwise. Initially all capabilities except
9301`GL_DITHER' are disabled; `GL_DITHER' is initially enabled.
9302
9303The following capabilities are accepted for CAP:
9304
9305
9306
9307*Constant*
9308 *See*
9309
9310`GL_ALPHA_TEST'
9311 `glAlphaFunc'
9312
9313`GL_AUTO_NORMAL'
9314 `glEvalCoord'
9315
9316`GL_BLEND'
9317 `glBlendFunc', `glLogicOp'
9318
9319`GL_CLIP_PLANE'I
9320 `glClipPlane'
9321
9322`GL_COLOR_ARRAY'
9323 `glColorPointer'
9324
9325`GL_COLOR_LOGIC_OP'
9326 `glLogicOp'
9327
9328`GL_COLOR_MATERIAL'
9329 `glColorMaterial'
9330
9331`GL_COLOR_SUM'
9332 `glSecondaryColor'
9333
9334`GL_COLOR_TABLE'
9335 `glColorTable'
9336
9337`GL_CONVOLUTION_1D'
9338 `glConvolutionFilter1D'
9339
9340`GL_CONVOLUTION_2D'
9341 `glConvolutionFilter2D'
9342
9343`GL_CULL_FACE'
9344 `glCullFace'
9345
9346`GL_DEPTH_TEST'
9347 `glDepthFunc', `glDepthRange'
9348
9349`GL_DITHER'
9350 `glEnable'
9351
9352`GL_EDGE_FLAG_ARRAY'
9353 `glEdgeFlagPointer'
9354
9355`GL_FOG'
9356 `glFog'
9357
9358`GL_FOG_COORD_ARRAY'
9359 `glFogCoordPointer'
9360
9361`GL_HISTOGRAM'
9362 `glHistogram'
9363
9364`GL_INDEX_ARRAY'
9365 `glIndexPointer'
9366
9367`GL_INDEX_LOGIC_OP'
9368 `glLogicOp'
9369
9370`GL_LIGHT'I
9371 `glLightModel', `glLight'
9372
9373`GL_LIGHTING'
9374 `glMaterial', `glLightModel', `glLight'
9375
9376`GL_LINE_SMOOTH'
9377 `glLineWidth'
9378
9379`GL_LINE_STIPPLE'
9380 `glLineStipple'
9381
9382`GL_MAP1_COLOR_4'
9383 `glMap1'
9384
9385`GL_MAP1_INDEX'
9386 `glMap1'
9387
9388`GL_MAP1_NORMAL'
9389 `glMap1'
9390
9391`GL_MAP1_TEXTURE_COORD_1'
9392 `glMap1'
9393
9394`GL_MAP1_TEXTURE_COORD_2'
9395 `glMap1'
9396
9397`GL_MAP1_TEXTURE_COORD_3'
9398 `glMap1'
9399
9400`GL_MAP1_TEXTURE_COORD_4'
9401 `glMap1'
9402
9403`GL_MAP2_COLOR_4'
9404 `glMap2'
9405
9406`GL_MAP2_INDEX'
9407 `glMap2'
9408
9409`GL_MAP2_NORMAL'
9410 `glMap2'
9411
9412`GL_MAP2_TEXTURE_COORD_1'
9413 `glMap2'
9414
9415`GL_MAP2_TEXTURE_COORD_2'
9416 `glMap2'
9417
9418`GL_MAP2_TEXTURE_COORD_3'
9419 `glMap2'
9420
9421`GL_MAP2_TEXTURE_COORD_4'
9422 `glMap2'
9423
9424`GL_MAP2_VERTEX_3'
9425 `glMap2'
9426
9427`GL_MAP2_VERTEX_4'
9428 `glMap2'
9429
9430`GL_MINMAX'
9431 `glMinmax'
9432
9433`GL_MULTISAMPLE'
9434 `glSampleCoverage'
9435
9436`GL_NORMAL_ARRAY'
9437 `glNormalPointer'
9438
9439`GL_NORMALIZE'
9440 `glNormal'
9441
9442`GL_POINT_SMOOTH'
9443 `glPointSize'
9444
9445`GL_POINT_SPRITE'
9446 `glEnable'
9447
9448`GL_POLYGON_SMOOTH'
9449 `glPolygonMode'
9450
9451`GL_POLYGON_OFFSET_FILL'
9452 `glPolygonOffset'
9453
9454`GL_POLYGON_OFFSET_LINE'
9455 `glPolygonOffset'
9456
9457`GL_POLYGON_OFFSET_POINT'
9458 `glPolygonOffset'
9459
9460`GL_POLYGON_STIPPLE'
9461 `glPolygonStipple'
9462
9463`GL_POST_COLOR_MATRIX_COLOR_TABLE'
9464 `glColorTable'
9465
9466`GL_POST_CONVOLUTION_COLOR_TABLE'
9467 `glColorTable'
9468
9469`GL_RESCALE_NORMAL'
9470 `glNormal'
9471
9472`GL_SAMPLE_ALPHA_TO_COVERAGE'
9473 `glSampleCoverage'
9474
9475`GL_SAMPLE_ALPHA_TO_ONE'
9476 `glSampleCoverage'
9477
9478`GL_SAMPLE_COVERAGE'
9479 `glSampleCoverage'
9480
9481`GL_SCISSOR_TEST'
9482 `glScissor'
9483
9484`GL_SECONDARY_COLOR_ARRAY'
9485 `glSecondaryColorPointer'
9486
9487`GL_SEPARABLE_2D'
9488 `glSeparableFilter2D'
9489
9490`GL_STENCIL_TEST'
9491 `glStencilFunc', `glStencilOp'
9492
9493`GL_TEXTURE_1D'
9494 `glTexImage1D'
9495
9496`GL_TEXTURE_2D'
9497 `glTexImage2D'
9498
9499`GL_TEXTURE_3D'
9500 `glTexImage3D'
9501
9502`GL_TEXTURE_COORD_ARRAY'
9503 `glTexCoordPointer'
9504
9505`GL_TEXTURE_CUBE_MAP'
9506 `glTexImage2D'
9507
9508`GL_TEXTURE_GEN_Q'
9509 `glTexGen'
9510
9511`GL_TEXTURE_GEN_R'
9512 `glTexGen'
9513
9514`GL_TEXTURE_GEN_S'
9515 `glTexGen'
9516
9517`GL_TEXTURE_GEN_T'
9518 `glTexGen'
9519
9520`GL_VERTEX_ARRAY'
9521 `glVertexPointer'
9522
9523`GL_VERTEX_PROGRAM_POINT_SIZE'
9524 `glEnable'
9525
9526`GL_VERTEX_PROGRAM_TWO_SIDE'
9527 `glEnable'
9528
9529
9530
9531`GL_INVALID_ENUM' is generated if CAP is not an accepted value.
9532
9533`GL_INVALID_OPERATION' is generated if `glIsEnabled' is executed between
9534the execution of `glBegin' and the corresponding execution of `glEnd'.")
9535
7ec693ed 9536(define-foreign-procedure
bb894c9d 9537 ((glIsList (list GLuint) -> GLboolean))
3c9b6116
AW
9538 "Determine if a name corresponds to a display list.
9539
9540LIST
9541 Specifies a potential display list name.
9542
9543`glIsList' returns `GL_TRUE' if LIST is the name of a display list and
9544returns `GL_FALSE' if it is not, or if an error occurs.
9545
9546A name returned by `glGenLists', but not yet associated with a display
9547list by calling `glNewList', is not the name of a display list.
9548
9549`GL_INVALID_OPERATION' is generated if `glIsList' is executed between
9550the execution of `glBegin' and the corresponding execution of `glEnd'.")
9551
7ec693ed 9552(define-foreign-procedure
bb894c9d 9553 ((glIsProgram (program GLuint) -> GLboolean))
3c9b6116
AW
9554 "Determines if a name corresponds to a program object.
9555
9556PROGRAM
9557 Specifies a potential program object.
9558
9559`glIsProgram' returns `GL_TRUE' if PROGRAM is the name of a program
9560object previously created with `glCreateProgram' and not yet deleted
9561with `glDeleteProgram'. If PROGRAM is zero or a non-zero value that is
9562not the name of a program object, or if an error occurs, `glIsProgram'
9563returns `GL_FALSE'.
9564
9565`GL_INVALID_OPERATION' is generated if `glIsProgram' is executed between
9566the execution of `glBegin' and the corresponding execution of `glEnd'.")
9567
7ec693ed 9568(define-foreign-procedure
bb894c9d 9569 ((glIsQuery (id GLuint) -> GLboolean))
3c9b6116
AW
9570 "Determine if a name corresponds to a query object.
9571
9572ID
9573 Specifies a value that may be the name of a query object.
9574
9575`glIsQuery' returns `GL_TRUE' if ID is currently the name of a query
9576object. If ID is zero, or is a non-zero value that is not currently the
9577name of a query object, or if an error occurs, `glIsQuery' returns
9578`GL_FALSE'.
9579
9580A name returned by `glGenQueries', but not yet associated with a query
9581object by calling `glBeginQuery', is not the name of a query object.
9582
9583`GL_INVALID_OPERATION' is generated if `glIsQuery' is executed between
9584the execution of `glBegin' and the corresponding execution of `glEnd'.")
9585
7ec693ed 9586(define-foreign-procedure
bb894c9d 9587 ((glIsShader (shader GLuint) -> GLboolean))
3c9b6116
AW
9588 "Determines if a name corresponds to a shader object.
9589
9590SHADER
9591 Specifies a potential shader object.
9592
9593`glIsShader' returns `GL_TRUE' if SHADER is the name of a shader object
9594previously created with `glCreateShader' and not yet deleted with
9595`glDeleteShader'. If SHADER is zero or a non-zero value that is not the
9596name of a shader object, or if an error occurs, `glIsShader ' returns
9597`GL_FALSE'.
9598
9599`GL_INVALID_OPERATION' is generated if `glIsShader' is executed between
9600the execution of `glBegin' and the corresponding execution of `glEnd'.")
9601
7ec693ed 9602(define-foreign-procedure
bb894c9d 9603 ((glIsTexture (texture GLuint) -> GLboolean))
3c9b6116
AW
9604 "Determine if a name corresponds to a texture.
9605
9606TEXTURE
9607 Specifies a value that may be the name of a texture.
9608
9609`glIsTexture' returns `GL_TRUE' if TEXTURE is currently the name of a
9610texture. If TEXTURE is zero, or is a non-zero value that is not
9611currently the name of a texture, or if an error occurs, `glIsTexture'
9612returns `GL_FALSE'.
9613
9614A name returned by `glGenTextures', but not yet associated with a
9615texture by calling `glBindTexture', is not the name of a texture.
9616
9617`GL_INVALID_OPERATION' is generated if `glIsTexture' is executed between
9618the execution of `glBegin' and the corresponding execution of `glEnd'.")
9619
7ec693ed 9620(define-foreign-procedure
bb894c9d
AW
9621 ((glLightModelf
9622 (pname GLenum)
9623 (param GLfloat)
9624 ->
9625 void)
9626 (glLightModeli
9627 (pname GLenum)
9628 (param GLint)
9629 ->
9630 void))
3c9b6116
AW
9631 "Set the lighting model parameters.
9632
9633PNAME
9634 Specifies a single-valued lighting model parameter.
9635 `GL_LIGHT_MODEL_LOCAL_VIEWER', `GL_LIGHT_MODEL_COLOR_CONTROL', and
9636 `GL_LIGHT_MODEL_TWO_SIDE' are accepted.
9637
9638PARAM
9639 Specifies the value that PARAM will be set to.
9640
9641`glLightModel' sets the lighting model parameter. PNAME names a
9642parameter and PARAMS gives the new value. There are three lighting model
9643parameters:
9644
9645`GL_LIGHT_MODEL_AMBIENT'
9646
9647
9648 PARAMS contains four integer or floating-point values that specify
9649 the ambient RGBA intensity of the entire scene. Integer values are
9650 mapped linearly such that the most positive representable value
9651 maps to 1.0, and the most negative representable value maps to -1.0
9652 . Floating-point values are mapped directly. Neither integer nor
9653 floating-point values are clamped. The initial ambient scene
9654 intensity is (0.2, 0.2, 0.2, 1.0).
9655
9656`GL_LIGHT_MODEL_COLOR_CONTROL'
9657
9658
9659 PARAMS must be either `GL_SEPARATE_SPECULAR_COLOR' or
9660 `GL_SINGLE_COLOR'. `GL_SINGLE_COLOR' specifies that a single color
9661 is generated from the lighting computation for a vertex.
9662 `GL_SEPARATE_SPECULAR_COLOR' specifies that the specular color
9663 computation of lighting be stored separately from the remainder of
9664 the lighting computation. The specular color is summed into the
9665 generated fragment's color after the application of texture mapping
9666 (if enabled). The initial value is `GL_SINGLE_COLOR'.
9667
9668`GL_LIGHT_MODEL_LOCAL_VIEWER'
9669
9670
9671 PARAMS is a single integer or floating-point value that specifies
9672 how specular reflection angles are computed. If PARAMS is 0 (or
9673 0.0), specular reflection angles take the view direction to be
9674 parallel to and in the direction of the -Z axis, regardless of the
9675 location of the vertex in eye coordinates. Otherwise, specular
9676 reflections are computed from the origin of the eye coordinate
9677 system. The initial value is 0.
9678
9679`GL_LIGHT_MODEL_TWO_SIDE'
9680
9681
9682 PARAMS is a single integer or floating-point value that specifies
9683 whether one- or two-sided lighting calculations are done for
9684 polygons. It has no effect on the lighting calculations for points,
9685 lines, or bitmaps. If PARAMS is 0 (or 0.0), one-sided lighting is
9686 specified, and only the FRONT material parameters are used in the
9687 lighting equation. Otherwise, two-sided lighting is specified. In
9688 this case, vertices of back-facing polygons are lighted using the
9689 BACK material parameters and have their normals reversed before the
9690 lighting equation is evaluated. Vertices of front-facing polygons
9691 are always lighted using the FRONT material parameters, with no
9692 change to their normals. The initial value is 0.
9693
9694In RGBA mode, the lighted color of a vertex is the sum of the material
9695emission intensity, the product of the material ambient reflectance and
9696the lighting model full-scene ambient intensity, and the contribution of
9697each enabled light source. Each light source contributes the sum of
9698three terms: ambient, diffuse, and specular. The ambient light source
9699contribution is the product of the material ambient reflectance and the
9700light's ambient intensity. The diffuse light source contribution is the
9701product of the material diffuse reflectance, the light's diffuse
9702intensity, and the dot product of the vertex's normal with the
9703normalized vector from the vertex to the light source. The specular
9704light source contribution is the product of the material specular
9705reflectance, the light's specular intensity, and the dot product of the
9706normalized vertex-to-eye and vertex-to-light vectors, raised to the
9707power of the shininess of the material. All three light source
9708contributions are attenuated equally based on the distance from the
9709vertex to the light source and on light source direction, spread
9710exponent, and spread cutoff angle. All dot products are replaced with 0
9711if they evaluate to a negative value.
9712
9713The alpha component of the resulting lighted color is set to the alpha
9714value of the material diffuse reflectance.
9715
9716In color index mode, the value of the lighted index of a vertex ranges
9717from the ambient to the specular values passed to `glMaterial' using
9718`GL_COLOR_INDEXES'. Diffuse and specular coefficients, computed with a
9719(.30, .59, .11) weighting of the lights' colors, the shininess of the
9720material, and the same reflection and attenuation equations as in the
9721RGBA case, determine how much above ambient the resulting index is.
9722
9723`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
9724
9725`GL_INVALID_ENUM' is generated if PNAME is
9726`GL_LIGHT_MODEL_COLOR_CONTROL' and PARAMS is not one of
9727`GL_SINGLE_COLOR' or `GL_SEPARATE_SPECULAR_COLOR'.
9728
9729`GL_INVALID_OPERATION' is generated if `glLightModel' is executed
9730between the execution of `glBegin' and the corresponding execution of
9731`glEnd'.")
9732
7ec693ed 9733(define-foreign-procedure
bb894c9d
AW
9734 ((glLightf
9735 (light GLenum)
9736 (pname GLenum)
9737 (param GLfloat)
9738 ->
9739 void)
9740 (glLighti
9741 (light GLenum)
9742 (pname GLenum)
9743 (param GLint)
9744 ->
9745 void))
3c9b6116
AW
9746 "Set light source parameters.
9747
9748LIGHT
9749 Specifies a light. The number of lights depends on the
9750 implementation, but at least eight lights are supported. They are
9751 identified by symbolic names of the form `GL_LIGHT' I , where i
9752 ranges from 0 to the value of `GL_MAX_LIGHTS' - 1.
9753
9754PNAME
9755 Specifies a single-valued light source parameter for LIGHT.
9756 `GL_SPOT_EXPONENT', `GL_SPOT_CUTOFF', `GL_CONSTANT_ATTENUATION',
9757 `GL_LINEAR_ATTENUATION', and `GL_QUADRATIC_ATTENUATION' are
9758 accepted.
9759
9760PARAM
9761 Specifies the value that parameter PNAME of light source LIGHT will
9762 be set to.
9763
9764`glLight' sets the values of individual light source parameters. LIGHT
9765names the light and is a symbolic name of the form `GL_LIGHT'I , where i
9766ranges from 0 to the value of `GL_MAX_LIGHTS' - 1. PNAME specifies one
9767of ten light source parameters, again by symbolic name. PARAMS is either
9768a single value or a pointer to an array that contains the new values.
9769
9770To enable and disable lighting calculation, call `glEnable' and
9771`glDisable' with argument `GL_LIGHTING'. Lighting is initially disabled.
9772When it is enabled, light sources that are enabled contribute to the
9773lighting calculation. Light source I is enabled and disabled using
9774`glEnable' and `glDisable' with argument `GL_LIGHT'I .
9775
9776The ten light parameters are as follows:
9777
9778`GL_AMBIENT'
9779 PARAMS contains four integer or floating-point values that specify
9780 the ambient RGBA intensity of the light. Integer values are mapped
9781 linearly such that the most positive representable value maps to
9782 1.0, and the most negative representable value maps to -1.0 .
9783 Floating-point values are mapped directly. Neither integer nor
9784 floating-point values are clamped. The initial ambient light
9785 intensity is (0, 0, 0, 1).
9786
9787`GL_DIFFUSE'
9788 PARAMS contains four integer or floating-point values that specify
9789 the diffuse RGBA intensity of the light. Integer values are mapped
9790 linearly such that the most positive representable value maps to
9791 1.0, and the most negative representable value maps to -1.0 .
9792 Floating-point values are mapped directly. Neither integer nor
9793 floating-point values are clamped. The initial value for
9794 `GL_LIGHT0' is (1, 1, 1, 1); for other lights, the initial value is
9795 (0, 0, 0, 1).
9796
9797`GL_SPECULAR'
9798 PARAMS contains four integer or floating-point values that specify
9799 the specular RGBA intensity of the light. Integer values are mapped
9800 linearly such that the most positive representable value maps to
9801 1.0, and the most negative representable value maps to -1.0 .
9802 Floating-point values are mapped directly. Neither integer nor
9803 floating-point values are clamped. The initial value for
9804 `GL_LIGHT0' is (1, 1, 1, 1); for other lights, the initial value is
9805 (0, 0, 0, 1).
9806
9807`GL_POSITION'
9808 PARAMS contains four integer or floating-point values that specify
9809 the position of the light in homogeneous object coordinates. Both
9810 integer and floating-point values are mapped directly. Neither
9811 integer nor floating-point values are clamped.
9812
9813 The position is transformed by the modelview matrix when `glLight'
9814 is called (just as if it were a point), and it is stored in eye
9815 coordinates. If the W component of the position is 0, the light is
9816 treated as a directional source. Diffuse and specular lighting
9817 calculations take the light's direction, but not its actual
9818 position, into account, and attenuation is disabled. Otherwise,
9819 diffuse and specular lighting calculations are based on the actual
9820 location of the light in eye coordinates, and attenuation is
9821 enabled. The initial position is (0, 0, 1, 0); thus, the initial
9822 light source is directional, parallel to, and in the direction of
9823 the -Z axis.
9824
9825`GL_SPOT_DIRECTION'
9826 PARAMS contains three integer or floating-point values that specify
9827 the direction of the light in homogeneous object coordinates. Both
9828 integer and floating-point values are mapped directly. Neither
9829 integer nor floating-point values are clamped.
9830
9831 The spot direction is transformed by the upper 3x3 of the modelview
9832 matrix when `glLight' is called, and it is stored in eye
9833 coordinates. It is significant only when `GL_SPOT_CUTOFF' is not
9834 180, which it is initially. The initial direction is (0,0-1) .
9835
9836`GL_SPOT_EXPONENT'
9837 PARAMS is a single integer or floating-point value that specifies
9838 the intensity distribution of the light. Integer and floating-point
9839 values are mapped directly. Only values in the range [0,128] are
9840 accepted.
9841
9842 Effective light intensity is attenuated by the cosine of the angle
9843 between the direction of the light and the direction from the light
9844 to the vertex being lighted, raised to the power of the spot
9845 exponent. Thus, higher spot exponents result in a more focused
9846 light source, regardless of the spot cutoff angle (see
9847 `GL_SPOT_CUTOFF', next paragraph). The initial spot exponent is 0,
9848 resulting in uniform light distribution.
9849
9850`GL_SPOT_CUTOFF'
9851 PARAMS is a single integer or floating-point value that specifies
9852 the maximum spread angle of a light source. Integer and
9853 floating-point values are mapped directly. Only values in the range
9854 [0,90] and the special value 180 are accepted. If the angle between
9855 the direction of the light and the direction from the light to the
9856 vertex being lighted is greater than the spot cutoff angle, the
9857 light is completely masked. Otherwise, its intensity is controlled
9858 by the spot exponent and the attenuation factors. The initial spot
9859 cutoff is 180, resulting in uniform light distribution.
9860
9861`GL_CONSTANT_ATTENUATION'
9862`GL_LINEAR_ATTENUATION'
9863`GL_QUADRATIC_ATTENUATION'
9864 PARAMS is a single integer or floating-point value that specifies
9865 one of the three light attenuation factors. Integer and
9866 floating-point values are mapped directly. Only nonnegative values
9867 are accepted. If the light is positional, rather than directional,
9868 its intensity is attenuated by the reciprocal of the sum of the
9869 constant factor, the linear factor times the distance between the
9870 light and the vertex being lighted, and the quadratic factor times
9871 the square of the same distance. The initial attenuation factors
9872 are (1, 0, 0), resulting in no attenuation.
9873
9874`GL_INVALID_ENUM' is generated if either LIGHT or PNAME is not an
9875accepted value.
9876
9877`GL_INVALID_VALUE' is generated if a spot exponent value is specified
9878outside the range [0,128] , or if spot cutoff is specified outside the
9879range [0,90] (except for the special value 180), or if a negative
9880attenuation factor is specified.
9881
9882`GL_INVALID_OPERATION' is generated if `glLight' is executed between the
9883execution of `glBegin' and the corresponding execution of `glEnd'.")
9884
7ec693ed 9885(define-foreign-procedure
bb894c9d
AW
9886 ((glLineStipple
9887 (factor GLint)
9888 (pattern GLushort)
9889 ->
9890 void))
3c9b6116
AW
9891 "Specify the line stipple pattern.
9892
9893FACTOR
9894 Specifies a multiplier for each bit in the line stipple pattern. If
9895 FACTOR is 3, for example, each bit in the pattern is used three
9896 times before the next bit in the pattern is used. FACTOR is clamped
9897 to the range [1, 256] and defaults to 1.
9898
9899PATTERN
9900 Specifies a 16-bit integer whose bit pattern determines which
9901 fragments of a line will be drawn when the line is rasterized. Bit
9902 zero is used first; the default pattern is all 1's.
9903
9904Line stippling masks out certain fragments produced by rasterization;
9905those fragments will not be drawn. The masking is achieved by using
9906three parameters: the 16-bit line stipple pattern PATTERN, the repeat
9907count FACTOR, and an integer stipple counter S .
9908
9909Counter S is reset to 0 whenever `glBegin' is called and before each
9910line segment of a `glBegin'(`GL_LINES')/`glEnd' sequence is generated.
9911It is incremented after each fragment of a unit width aliased line
9912segment is generated or after each I fragments of an I width line
9913segment are generated. The I fragments associated with count S are
9914masked out if
9915
9916PATTERN bit (S/FACTOR,)%16
9917
9918is 0, otherwise these fragments are sent to the frame buffer. Bit zero
9919of PATTERN is the least significant bit.
9920
9921Antialiased lines are treated as a sequence of 1×WIDTH rectangles for
9922purposes of stippling. Whether rectangle S is rasterized or not depends
9923on the fragment rule described for aliased lines, counting rectangles
9924rather than groups of fragments.
9925
9926To enable and disable line stippling, call `glEnable' and `glDisable'
9927with argument `GL_LINE_STIPPLE'. When enabled, the line stipple pattern
9928is applied as described above. When disabled, it is as if the pattern
9929were all 1's. Initially, line stippling is disabled.
9930
9931`GL_INVALID_OPERATION' is generated if `glLineStipple' is executed
9932between the execution of `glBegin' and the corresponding execution of
9933`glEnd'.")
9934
7ec693ed 9935(define-foreign-procedure
bb894c9d 9936 ((glLineWidth (width GLfloat) -> void))
3c9b6116
AW
9937 "Specify the width of rasterized lines.
9938
9939WIDTH
9940 Specifies the width of rasterized lines. The initial value is 1.
9941
9942`glLineWidth' specifies the rasterized width of both aliased and
9943antialiased lines. Using a line width other than 1 has different
9944effects, depending on whether line antialiasing is enabled. To enable
9945and disable line antialiasing, call `glEnable' and `glDisable' with
9946argument `GL_LINE_SMOOTH'. Line antialiasing is initially disabled.
9947
9948If line antialiasing is disabled, the actual width is determined by
9949rounding the supplied width to the nearest integer. (If the rounding
9950results in the value 0, it is as if the line width were 1.) If
9951∣ΔX,∣>=∣ΔY,∣ , I pixels are filled in each column that is rasterized,
9952where I is the rounded value of WIDTH. Otherwise, I pixels are filled in
9953each row that is rasterized.
9954
9955If antialiasing is enabled, line rasterization produces a fragment for
9956each pixel square that intersects the region lying within the rectangle
9957having width equal to the current line width, length equal to the actual
9958length of the line, and centered on the mathematical line segment. The
9959coverage value for each fragment is the window coordinate area of the
9960intersection of the rectangular region with the corresponding pixel
9961square. This value is saved and used in the final rasterization step.
9962
9963Not all widths can be supported when line antialiasing is enabled. If an
9964unsupported width is requested, the nearest supported width is used.
9965Only width 1 is guaranteed to be supported; others depend on the
9966implementation. Likewise, there is a range for aliased line widths as
9967well. To query the range of supported widths and the size difference
9968between supported widths within the range, call `glGet' with arguments
9969`GL_ALIASED_LINE_WIDTH_RANGE', `GL_SMOOTH_LINE_WIDTH_RANGE', and
9970`GL_SMOOTH_LINE_WIDTH_GRANULARITY'.
9971
9972`GL_INVALID_VALUE' is generated if WIDTH is less than or equal to 0.
9973
9974`GL_INVALID_OPERATION' is generated if `glLineWidth' is executed between
9975the execution of `glBegin' and the corresponding execution of `glEnd'.")
9976
7ec693ed 9977(define-foreign-procedure
bb894c9d 9978 ((glLinkProgram (program GLuint) -> void))
3c9b6116
AW
9979 "Links a program object.
9980
9981PROGRAM
9982 Specifies the handle of the program object to be linked.
9983
9984`glLinkProgram' links the program object specified by PROGRAM. If any
9985shader objects of type `GL_VERTEX_SHADER' are attached to PROGRAM, they
9986will be used to create an executable that will run on the programmable
9987vertex processor. If any shader objects of type `GL_FRAGMENT_SHADER' are
9988attached to PROGRAM, they will be used to create an executable that will
9989run on the programmable fragment processor.
9990
9991The status of the link operation will be stored as part of the program
9992object's state. This value will be set to `GL_TRUE' if the program
9993object was linked without errors and is ready for use, and `GL_FALSE'
9994otherwise. It can be queried by calling `glGetProgram' with arguments
9995PROGRAM and `GL_LINK_STATUS'.
9996
9997As a result of a successful link operation, all active user-defined
9998uniform variables belonging to PROGRAM will be initialized to 0, and
9999each of the program object's active uniform variables will be assigned a
10000location that can be queried by calling `glGetUniformLocation'. Also,
10001any active user-defined attribute variables that have not been bound to
10002a generic vertex attribute index will be bound to one at this time.
10003
10004Linking of a program object can fail for a number of reasons as
10005specified in the OPENGL SHADING LANGUAGE SPECIFICATION. The following
10006lists some of the conditions that will cause a link error.
10007
10008 * The storage limit for uniform variables has been exceeded.
10009
10010 * The number of active uniform variables supported by the
10011 implementation has been exceeded.
10012
10013 * The `main' function is missing for the vertex shader or the
10014 fragment shader.
10015
10016 * A varying variable actually used in the fragment shader is not
10017 declared in the same way (or is not declared at all) in the vertex
10018 shader.
10019
10020 * A reference to a function or variable name is unresolved.
10021
10022 * A shared global is declared with two different types or two
10023 different initial values.
10024
10025 * One or more of the attached shader objects has not been
10026 successfully compiled.
10027
10028 * Binding a generic attribute matrix caused some rows of the matrix
10029 to fall outside the allowed maximum of `GL_MAX_VERTEX_ATTRIBS'.
10030
10031 * Not enough contiguous vertex attribute slots could be found to bind
10032 attribute matrices.
10033
10034When a program object has been successfully linked, the program object
10035can be made part of current state by calling `glUseProgram'. Whether or
10036not the link operation was successful, the program object's information
10037log will be overwritten. The information log can be retrieved by calling
10038`glGetProgramInfoLog'.
10039
10040`glLinkProgram' will also install the generated executables as part of
10041the current rendering state if the link operation was successful and the
10042specified program object is already currently in use as a result of a
10043previous call to `glUseProgram'. If the program object currently in use
10044is relinked unsuccessfully, its link status will be set to `GL_FALSE' ,
10045but the executables and associated state will remain part of the current
10046state until a subsequent call to `glUseProgram' removes it from use.
10047After it is removed from use, it cannot be made part of current state
10048until it has been successfully relinked.
10049
10050If PROGRAM contains shader objects of type `GL_VERTEX_SHADER' but does
10051not contain shader objects of type `GL_FRAGMENT_SHADER', the vertex
10052shader will be linked against the implicit interface for fixed
10053functionality fragment processing. Similarly, if PROGRAM contains shader
10054objects of type `GL_FRAGMENT_SHADER' but it does not contain shader
10055objects of type `GL_VERTEX_SHADER', the fragment shader will be linked
10056against the implicit interface for fixed functionality vertex
10057processing.
10058
10059The program object's information log is updated and the program is
10060generated at the time of the link operation. After the link operation,
10061applications are free to modify attached shader objects, compile
10062attached shader objects, detach shader objects, delete shader objects,
10063and attach additional shader objects. None of these operations affects
10064the information log or the program that is part of the program object.
10065
10066`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
10067OpenGL.
10068
10069`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
10070
10071`GL_INVALID_OPERATION' is generated if `glLinkProgram' is executed
10072between the execution of `glBegin' and the corresponding execution of
10073`glEnd'.")
10074
7ec693ed 10075(define-foreign-procedure
bb894c9d 10076 ((glListBase (base GLuint) -> void))
3c9b6116
AW
10077 "Set the display-list base for .
10078
10079BASE
10080 Specifies an integer offset that will be added to `glCallLists'
10081 offsets to generate display-list names. The initial value is 0.
10082
10083`glCallLists' specifies an array of offsets. Display-list names are
10084generated by adding BASE to each offset. Names that reference valid
10085display lists are executed; the others are ignored.
10086
10087`GL_INVALID_OPERATION' is generated if `glListBase' is executed between
10088the execution of `glBegin' and the corresponding execution of `glEnd'.")
10089
7ec693ed 10090(define-foreign-procedure
bb894c9d 10091 ((glLoadIdentity -> void))
3c9b6116
AW
10092 "Replace the current matrix with the identity matrix.
10093
10094`glLoadIdentity' replaces the current matrix with the identity matrix.
10095It is semantically equivalent to calling `glLoadMatrix' with the
10096identity matrix
10097
10098
10099
10100((1 0 0 0), (0 1 0 0), (0 0 1 0), (0 0 0 1),,)
10101
10102
10103
10104but in some cases it is more efficient.
10105
10106`GL_INVALID_OPERATION' is generated if `glLoadIdentity' is executed
10107between the execution of `glBegin' and the corresponding execution of
10108`glEnd'.")
10109
7ec693ed 10110(define-foreign-procedure
bb894c9d 10111 ((glLoadMatrixd (m *) -> void))
3c9b6116
AW
10112 "Replace the current matrix with the specified matrix.
10113
10114M
10115 Specifies a pointer to 16 consecutive values, which are used as the
10116 elements of a 4×4 column-major matrix.
10117
10118`glLoadMatrix' replaces the current matrix with the one whose elements
10119are specified by M. The current matrix is the projection matrix,
10120modelview matrix, or texture matrix, depending on the current matrix
10121mode (see `glMatrixMode').
10122
10123The current matrix, M, defines a transformation of coordinates. For
10124instance, assume M refers to the modelview matrix. If
10125V=(V\u2061[0,],V\u2061[1,]V\u2061[2,]V\u2061[3,]) is the set of object coordinates of a
10126vertex, and M points to an array of 16 single- or double-precision
10127floating-point values M={M\u2061[0,],M\u2061[1,]...M\u2061[15,]} , then the modelview
10128transformation M\u2061(V,) does the following:
10129
10130M\u2061(V,)=((M\u2061[0,] M\u2061[4,] M\u2061[8,] M\u2061[12,]), (M\u2061[1,] M\u2061[5,] M\u2061[9,] M\u2061[13,]),
10131(M\u2061[2,] M\u2061[6,] M\u2061[10,] M\u2061[14,]), (M\u2061[3,] M\u2061[7,] M\u2061[11,]
10132M\u2061[15,]),)×((V\u2061[0,]), (V\u2061[1,]), (V\u2061[2,]), (V\u2061[3,]),)
10133
10134
10135
10136Projection and texture transformations are similarly defined.
10137
10138`GL_INVALID_OPERATION' is generated if `glLoadMatrix' is executed
10139between the execution of `glBegin' and the corresponding execution of
10140`glEnd'.")
10141
7ec693ed 10142(define-foreign-procedure
bb894c9d 10143 ((glLoadName (name GLuint) -> void))
3c9b6116
AW
10144 "Load a name onto the name stack.
10145
10146NAME
10147 Specifies a name that will replace the top value on the name stack.
10148
10149The name stack is used during selection mode to allow sets of rendering
10150commands to be uniquely identified. It consists of an ordered set of
10151unsigned integers and is initially empty.
10152
10153`glLoadName' causes NAME to replace the value on the top of the name
10154stack.
10155
10156The name stack is always empty while the render mode is not `GL_SELECT'.
10157Calls to `glLoadName' while the render mode is not `GL_SELECT' are
10158ignored.
10159
10160`GL_INVALID_OPERATION' is generated if `glLoadName' is called while the
10161name stack is empty.
10162
10163`GL_INVALID_OPERATION' is generated if `glLoadName' is executed between
10164the execution of `glBegin' and the corresponding execution of `glEnd'.")
10165
7ec693ed 10166(define-foreign-procedure
bb894c9d 10167 ((glLoadTransposeMatrixd (m *) -> void))
3c9b6116
AW
10168 "Replace the current matrix with the specified row-major ordered matrix.
10169
10170M
10171 Specifies a pointer to 16 consecutive values, which are used as the
10172 elements of a 4×4 row-major matrix.
10173
10174`glLoadTransposeMatrix' replaces the current matrix with the one whose
10175elements are specified by M. The current matrix is the projection
10176matrix, modelview matrix, or texture matrix, depending on the current
10177matrix mode (see `glMatrixMode').
10178
10179The current matrix, M, defines a transformation of coordinates. For
10180instance, assume M refers to the modelview matrix. If
10181V=(V\u2061[0,],V\u2061[1,]V\u2061[2,]V\u2061[3,]) is the set of object coordinates of a
10182vertex, and M points to an array of 16 single- or double-precision
10183floating-point values M={M\u2061[0,],M\u2061[1,]...M\u2061[15,]} , then the modelview
10184transformation M\u2061(V,) does the following:
10185
10186M\u2061(V,)=((M\u2061[0,] M\u2061[1,] M\u2061[2,] M\u2061[3,]), (M\u2061[4,] M\u2061[5,] M\u2061[6,] M\u2061[7,]),
10187(M\u2061[8,] M\u2061[9,] M\u2061[10,] M\u2061[11,]), (M\u2061[12,] M\u2061[13,] M\u2061[14,]
10188M\u2061[15,]),)×((V\u2061[0,]), (V\u2061[1,]), (V\u2061[2,]), (V\u2061[3,]),)
10189
10190
10191
10192Projection and texture transformations are similarly defined.
10193
10194Calling `glLoadTransposeMatrix' with matrix M is identical in operation
10195to `glLoadMatrix' with M^T , where T represents the transpose.
10196
10197`GL_INVALID_OPERATION' is generated if `glLoadTransposeMatrix' is
10198executed between the execution of `glBegin' and the corresponding
10199execution of `glEnd'.")
10200
7ec693ed 10201(define-foreign-procedure
bb894c9d 10202 ((glLogicOp (opcode GLenum) -> void))
3c9b6116
AW
10203 "Specify a logical pixel operation for color index rendering.
10204
10205OPCODE
10206 Specifies a symbolic constant that selects a logical operation. The
10207 following symbols are accepted: `GL_CLEAR', `GL_SET', `GL_COPY',
10208 `GL_COPY_INVERTED', `GL_NOOP', `GL_INVERT', `GL_AND', `GL_NAND',
10209 `GL_OR', `GL_NOR', `GL_XOR', `GL_EQUIV', `GL_AND_REVERSE',
10210 `GL_AND_INVERTED', `GL_OR_REVERSE', and `GL_OR_INVERTED'. The
10211 initial value is `GL_COPY'.
10212
10213`glLogicOp' specifies a logical operation that, when enabled, is applied
10214between the incoming color index or RGBA color and the color index or
10215RGBA color at the corresponding location in the frame buffer. To enable
10216or disable the logical operation, call `glEnable' and `glDisable' using
10217the symbolic constant `GL_COLOR_LOGIC_OP' for RGBA mode or
10218`GL_INDEX_LOGIC_OP' for color index mode. The initial value is disabled
10219for both operations.
10220
10221
10222
10223*Opcode*
10224 *Resulting Operation*
10225
10226`GL_CLEAR'
10227 0
10228
10229`GL_SET'
10230 1
10231
10232`GL_COPY'
10233 s
10234
10235`GL_COPY_INVERTED'
10236 ~s
10237
10238`GL_NOOP'
10239 d
10240
10241`GL_INVERT'
10242 ~d
10243
10244`GL_AND'
10245 s & d
10246
10247`GL_NAND'
10248 ~(s & d)
10249
10250`GL_OR'
10251 s | d
10252
10253`GL_NOR'
10254 ~(s | d)
10255
10256`GL_XOR'
10257 s ^ d
10258
10259`GL_EQUIV'
10260 ~(s ^ d)
10261
10262`GL_AND_REVERSE'
10263 s & ~d
10264
10265`GL_AND_INVERTED'
10266 ~s & d
10267
10268`GL_OR_REVERSE'
10269 s | ~d
10270
10271`GL_OR_INVERTED'
10272 ~s | d
10273
10274OPCODE is a symbolic constant chosen from the list above. In the
10275explanation of the logical operations, S represents the incoming color
10276index and D represents the index in the frame buffer. Standard
10277C-language operators are used. As these bitwise operators suggest, the
10278logical operation is applied independently to each bit pair of the
10279source and destination indices or colors.
10280
10281`GL_INVALID_ENUM' is generated if OPCODE is not an accepted value.
10282
10283`GL_INVALID_OPERATION' is generated if `glLogicOp' is executed between
10284the execution of `glBegin' and the corresponding execution of `glEnd'.")
10285
7ec693ed 10286(define-foreign-procedure
bb894c9d
AW
10287 ((glMap1d
10288 (target GLenum)
10289 (u1 GLdouble)
10290 (u2 GLdouble)
10291 (stride GLint)
10292 (order GLint)
10293 (points *)
10294 ->
10295 void))
3c9b6116
AW
10296 "Define a one-dimensional evaluator.
10297
10298TARGET
10299 Specifies the kind of values that are generated by the evaluator.
10300 Symbolic constants `GL_MAP1_VERTEX_3', `GL_MAP1_VERTEX_4',
10301 `GL_MAP1_INDEX', `GL_MAP1_COLOR_4', `GL_MAP1_NORMAL',
10302 `GL_MAP1_TEXTURE_COORD_1', `GL_MAP1_TEXTURE_COORD_2',
10303 `GL_MAP1_TEXTURE_COORD_3', and `GL_MAP1_TEXTURE_COORD_4' are
10304 accepted.
10305
10306U1
10307 U2
10308
10309 Specify a linear mapping of U , as presented to `glEvalCoord1', to
10310 U^ , the variable that is evaluated by the equations specified by
10311 this command.
10312
10313STRIDE
10314 Specifies the number of floats or doubles between the beginning of
10315 one control point and the beginning of the next one in the data
10316 structure referenced in POINTS. This allows control points to be
10317 embedded in arbitrary data structures. The only constraint is that
10318 the values for a particular control point must occupy contiguous
10319 memory locations.
10320
10321ORDER
10322 Specifies the number of control points. Must be positive.
10323
10324POINTS
10325 Specifies a pointer to the array of control points.
10326
10327Evaluators provide a way to use polynomial or rational polynomial
10328mapping to produce vertices, normals, texture coordinates, and colors.
10329The values produced by an evaluator are sent to further stages of GL
10330processing just as if they had been presented using `glVertex',
10331`glNormal', `glTexCoord', and `glColor' commands, except that the
10332generated values do not update the current normal, texture coordinates,
10333or color.
10334
10335All polynomial or rational polynomial splines of any degree (up to the
10336maximum degree supported by the GL implementation) can be described
10337using evaluators. These include almost all splines used in computer
10338graphics: B-splines, Bezier curves, Hermite splines, and so on.
10339
10340Evaluators define curves based on Bernstein polynomials. Define P\u2061(U^,)
10341as
10342
10343P\u2061(U^,)=ΣI=0NB_I,^N\u2061(U^,)\u2062R_I
10344
10345
10346
10347where R_I is a control point and B_I,^N\u2061(U^,) is the I th Bernstein
10348polynomial of degree N (ORDER = N+1 ):
10349
10350B_I,^N\u2061(U^,)=((N), (I),,)\u2062U^,^I\u2062(1-U^,)^N-I,,
10351
10352Recall that
10353
103540^0==1 and ((N), (0),,)==1
10355
10356`glMap1' is used to define the basis and to specify what kind of values
10357are produced. Once defined, a map can be enabled and disabled by calling
10358`glEnable' and `glDisable' with the map name, one of the nine predefined
10359values for TARGET described below. `glEvalCoord1' evaluates the
10360one-dimensional maps that are enabled. When `glEvalCoord1' presents a
10361value U , the Bernstein functions are evaluated using U^ , where
10362U^=U-U1,/U2-U1,
10363
10364TARGET is a symbolic constant that indicates what kind of control points
10365are provided in POINTS, and what output is generated when the map is
10366evaluated. It can assume one of nine predefined values:
10367
10368`GL_MAP1_VERTEX_3'
10369 Each control point is three floating-point values representing X ,
10370 Y , and Z . Internal `glVertex3' commands are generated when the
10371 map is evaluated.
10372
10373`GL_MAP1_VERTEX_4'
10374 Each control point is four floating-point values representing X , Y
10375 , Z , and W . Internal `glVertex4' commands are generated when the
10376 map is evaluated.
10377
10378`GL_MAP1_INDEX'
10379 Each control point is a single floating-point value representing a
10380 color index. Internal `glIndex' commands are generated when the map
10381 is evaluated but the current index is not updated with the value of
10382 these `glIndex' commands.
10383
10384`GL_MAP1_COLOR_4'
10385 Each control point is four floating-point values representing red,
10386 green, blue, and alpha. Internal `glColor4' commands are generated
10387 when the map is evaluated but the current color is not updated with
10388 the value of these `glColor4' commands.
10389
10390`GL_MAP1_NORMAL'
10391 Each control point is three floating-point values representing the
10392 X , Y , and Z components of a normal vector. Internal `glNormal'
10393 commands are generated when the map is evaluated but the current
10394 normal is not updated with the value of these `glNormal' commands.
10395
10396`GL_MAP1_TEXTURE_COORD_1'
10397 Each control point is a single floating-point value representing
10398 the S texture coordinate. Internal `glTexCoord1' commands are
10399 generated when the map is evaluated but the current texture
10400 coordinates are not updated with the value of these `glTexCoord'
10401 commands.
10402
10403`GL_MAP1_TEXTURE_COORD_2'
10404 Each control point is two floating-point values representing the S
10405 and T texture coordinates. Internal `glTexCoord2' commands are
10406 generated when the map is evaluated but the current texture
10407 coordinates are not updated with the value of these `glTexCoord'
10408 commands.
10409
10410`GL_MAP1_TEXTURE_COORD_3'
10411 Each control point is three floating-point values representing the
10412 S , T , and R texture coordinates. Internal `glTexCoord3' commands
10413 are generated when the map is evaluated but the current texture
10414 coordinates are not updated with the value of these `glTexCoord'
10415 commands.
10416
10417`GL_MAP1_TEXTURE_COORD_4'
10418 Each control point is four floating-point values representing the S
10419 , T , R , and Q texture coordinates. Internal `glTexCoord4'
10420 commands are generated when the map is evaluated but the current
10421 texture coordinates are not updated with the value of these
10422 `glTexCoord' commands.
10423
10424STRIDE, ORDER, and POINTS define the array addressing for accessing the
10425control points. POINTS is the location of the first control point, which
10426occupies one, two, three, or four contiguous memory locations, depending
10427on which map is being defined. ORDER is the number of control points in
10428the array. STRIDE specifies how many float or double locations to
10429advance the internal memory pointer to reach the next control point.
10430
10431`GL_INVALID_ENUM' is generated if TARGET is not an accepted value.
10432
10433`GL_INVALID_VALUE' is generated if U1 is equal to U2.
10434
10435`GL_INVALID_VALUE' is generated if STRIDE is less than the number of
10436values in a control point.
10437
10438`GL_INVALID_VALUE' is generated if ORDER is less than 1 or greater than
10439the return value of `GL_MAX_EVAL_ORDER'.
10440
10441`GL_INVALID_OPERATION' is generated if `glMap1' is executed between the
10442execution of `glBegin' and the corresponding execution of `glEnd'.
10443
10444`GL_INVALID_OPERATION' is generated if `glMap1' is called and the value
10445of `GL_ACTIVE_TEXTURE' is not `GL_TEXTURE0'.")
10446
7ec693ed 10447(define-foreign-procedure
bb894c9d
AW
10448 ((glMap2d
10449 (target GLenum)
10450 (u1 GLdouble)
10451 (u2 GLdouble)
10452 (ustride GLint)
10453 (uorder GLint)
10454 (v1 GLdouble)
10455 (v2 GLdouble)
10456 (vstride GLint)
10457 (vorder GLint)
10458 (points *)
10459 ->
10460 void))
3c9b6116
AW
10461 "Define a two-dimensional evaluator.
10462
10463TARGET
10464 Specifies the kind of values that are generated by the evaluator.
10465 Symbolic constants `GL_MAP2_VERTEX_3', `GL_MAP2_VERTEX_4',
10466 `GL_MAP2_INDEX', `GL_MAP2_COLOR_4', `GL_MAP2_NORMAL',
10467 `GL_MAP2_TEXTURE_COORD_1', `GL_MAP2_TEXTURE_COORD_2',
10468 `GL_MAP2_TEXTURE_COORD_3', and `GL_MAP2_TEXTURE_COORD_4' are
10469 accepted.
10470
10471U1
10472 U2
10473
10474 Specify a linear mapping of U , as presented to `glEvalCoord2', to
10475 U^ , one of the two variables that are evaluated by the equations
10476 specified by this command. Initially, U1 is 0 and U2 is 1.
10477
10478USTRIDE
10479 Specifies the number of floats or doubles between the beginning of
10480 control point R_IJ and the beginning of control point R_(I+1,)\u2062J, ,
10481 where I and J are the U and V control point indices, respectively.
10482 This allows control points to be embedded in arbitrary data
10483 structures. The only constraint is that the values for a particular
10484 control point must occupy contiguous memory locations. The initial
10485 value of USTRIDE is 0.
10486
10487UORDER
10488 Specifies the dimension of the control point array in the U axis.
10489 Must be positive. The initial value is 1.
10490
10491V1
10492 V2
10493
10494 Specify a linear mapping of V , as presented to `glEvalCoord2', to
10495 V^ , one of the two variables that are evaluated by the equations
10496 specified by this command. Initially, V1 is 0 and V2 is 1.
10497
10498VSTRIDE
10499 Specifies the number of floats or doubles between the beginning of
10500 control point R_IJ and the beginning of control point R_I\u2061(J+1,), ,
10501 where I and J are the U and V control point indices, respectively.
10502 This allows control points to be embedded in arbitrary data
10503 structures. The only constraint is that the values for a particular
10504 control point must occupy contiguous memory locations. The initial
10505 value of VSTRIDE is 0.
10506
10507VORDER
10508 Specifies the dimension of the control point array in the V axis.
10509 Must be positive. The initial value is 1.
10510
10511POINTS
10512 Specifies a pointer to the array of control points.
10513
10514Evaluators provide a way to use polynomial or rational polynomial
10515mapping to produce vertices, normals, texture coordinates, and colors.
10516The values produced by an evaluator are sent on to further stages of GL
10517processing just as if they had been presented using `glVertex',
10518`glNormal', `glTexCoord', and `glColor' commands, except that the
10519generated values do not update the current normal, texture coordinates,
10520or color.
10521
10522All polynomial or rational polynomial splines of any degree (up to the
10523maximum degree supported by the GL implementation) can be described
10524using evaluators. These include almost all surfaces used in computer
10525graphics, including B-spline surfaces, NURBS surfaces, Bezier surfaces,
10526and so on.
10527
10528Evaluators define surfaces based on bivariate Bernstein polynomials.
10529Define P\u2061(U^,V^) as
10530
10531P\u2061(U^,V^)=ΣI=0NΣJ=0MB_I,^N\u2061(U^,)\u2062B_J,^M\u2061(V^,)\u2062R_IJ
10532
10533
10534
10535where R_IJ is a control point, B_I,^N\u2061(U^,) is the I th Bernstein
10536polynomial of degree N (UORDER = N+1 )
10537
10538B_I,^N\u2061(U^,)=((N), (I),,)\u2062U^,^I\u2062(1-U^,)^N-I,,
10539
10540and B_J,^M\u2061(V^,) is the J th Bernstein polynomial of degree M (VORDER =
10541M+1 )
10542
10543B_J,^M\u2061(V^,)=((M), (J),,)\u2062V^,^J\u2062(1-V^,)^M-J,,
10544
10545Recall that 0^0==1 and ((N), (0),,)==1
10546
10547`glMap2' is used to define the basis and to specify what kind of values
10548are produced. Once defined, a map can be enabled and disabled by calling
10549`glEnable' and `glDisable' with the map name, one of the nine predefined
10550values for TARGET, described below. When `glEvalCoord2' presents values
10551U and V , the bivariate Bernstein polynomials are evaluated using U^ and
10552V^ , where
10553
10554U^=U-U1,/U2-U1,
10555
10556V^=V-V1,/V2-V1,
10557
10558TARGET is a symbolic constant that indicates what kind of control points
10559are provided in POINTS, and what output is generated when the map is
10560evaluated. It can assume one of nine predefined values:
10561
10562`GL_MAP2_VERTEX_3'
10563 Each control point is three floating-point values representing X ,
10564 Y , and Z . Internal `glVertex3' commands are generated when the
10565 map is evaluated.
10566
10567`GL_MAP2_VERTEX_4'
10568 Each control point is four floating-point values representing X , Y
10569 , Z , and W . Internal `glVertex4' commands are generated when the
10570 map is evaluated.
10571
10572`GL_MAP2_INDEX'
10573 Each control point is a single floating-point value representing a
10574 color index. Internal `glIndex' commands are generated when the map
10575 is evaluated but the current index is not updated with the value of
10576 these `glIndex' commands.
10577
10578`GL_MAP2_COLOR_4'
10579 Each control point is four floating-point values representing red,
10580 green, blue, and alpha. Internal `glColor4' commands are generated
10581 when the map is evaluated but the current color is not updated with
10582 the value of these `glColor4' commands.
10583
10584`GL_MAP2_NORMAL'
10585 Each control point is three floating-point values representing the
10586 X , Y , and Z components of a normal vector. Internal `glNormal'
10587 commands are generated when the map is evaluated but the current
10588 normal is not updated with the value of these `glNormal' commands.
10589
10590`GL_MAP2_TEXTURE_COORD_1'
10591 Each control point is a single floating-point value representing
10592 the S texture coordinate. Internal `glTexCoord1' commands are
10593 generated when the map is evaluated but the current texture
10594 coordinates are not updated with the value of these `glTexCoord'
10595 commands.
10596
10597`GL_MAP2_TEXTURE_COORD_2'
10598 Each control point is two floating-point values representing the S
10599 and T texture coordinates. Internal `glTexCoord2' commands are
10600 generated when the map is evaluated but the current texture
10601 coordinates are not updated with the value of these `glTexCoord'
10602 commands.
10603
10604`GL_MAP2_TEXTURE_COORD_3'
10605 Each control point is three floating-point values representing the
10606 S , T , and R texture coordinates. Internal `glTexCoord3' commands
10607 are generated when the map is evaluated but the current texture
10608 coordinates are not updated with the value of these `glTexCoord'
10609 commands.
10610
10611`GL_MAP2_TEXTURE_COORD_4'
10612 Each control point is four floating-point values representing the S
10613 , T , R , and Q texture coordinates. Internal `glTexCoord4'
10614 commands are generated when the map is evaluated but the current
10615 texture coordinates are not updated with the value of these
10616 `glTexCoord' commands.
10617
10618USTRIDE, UORDER, VSTRIDE, VORDER, and POINTS define the array addressing
10619for accessing the control points. POINTS is the location of the first
10620control point, which occupies one, two, three, or four contiguous memory
10621locations, depending on which map is being defined. There are
10622UORDER×VORDER control points in the array. USTRIDE specifies how many
10623float or double locations are skipped to advance the internal memory
10624pointer from control point R_I\u2062J, to control point R_(I+1,)\u2062J, . VSTRIDE
10625specifies how many float or double locations are skipped to advance the
10626internal memory pointer from control point R_I\u2062J, to control point
10627R_I\u2061(J+1,), .
10628
10629`GL_INVALID_ENUM' is generated if TARGET is not an accepted value.
10630
10631`GL_INVALID_VALUE' is generated if U1 is equal to U2, or if V1 is equal
10632to V2.
10633
10634`GL_INVALID_VALUE' is generated if either USTRIDE or VSTRIDE is less
10635than the number of values in a control point.
10636
10637`GL_INVALID_VALUE' is generated if either UORDER or VORDER is less than
106381 or greater than the return value of `GL_MAX_EVAL_ORDER'.
10639
10640`GL_INVALID_OPERATION' is generated if `glMap2' is executed between the
10641execution of `glBegin' and the corresponding execution of `glEnd'.
10642
10643`GL_INVALID_OPERATION' is generated if `glMap2' is called and the value
10644of `GL_ACTIVE_TEXTURE' is not `GL_TEXTURE0'.")
10645
7ec693ed 10646(define-foreign-procedure
bb894c9d
AW
10647 ((glMapBuffer
10648 (target GLenum)
10649 (access GLenum)
10650 ->
10651 *)
10652 (glUnmapBuffer (target GLenum) -> GLboolean))
3c9b6116
AW
10653 "Map a buffer object's data store.
10654
10655TARGET
10656 Specifies the target buffer object being mapped. The symbolic
10657 constant must be `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
10658 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
10659
10660ACCESS
10661 Specifies the access policy, indicating whether it will be possible
10662 to read from, write to, or both read from and write to the buffer
10663 object's mapped data store. The symbolic constant must be
10664 `GL_READ_ONLY', `GL_WRITE_ONLY', or `GL_READ_WRITE'.
10665
10666`glMapBuffer' maps to the client's address space the entire data store
10667of the buffer object currently bound to TARGET. The data can then be
10668directly read and/or written relative to the returned pointer, depending
10669on the specified ACCESS policy. If the GL is unable to map the buffer
10670object's data store, `glMapBuffer' generates an error and returns
10671`NULL'. This may occur for system-specific reasons, such as low virtual
10672memory availability.
10673
10674If a mapped data store is accessed in a way inconsistent with the
10675specified ACCESS policy, no error is generated, but performance may be
10676negatively impacted and system errors, including program termination,
10677may result. Unlike the USAGE parameter of `glBufferData', ACCESS is not
10678a hint, and does in fact constrain the usage of the mapped data store on
10679some GL implementations. In order to achieve the highest performance
10680available, a buffer object's data store should be used in ways
10681consistent with both its specified USAGE and ACCESS parameters.
10682
10683A mapped data store must be unmapped with `glUnmapBuffer' before its
10684buffer object is used. Otherwise an error will be generated by any GL
10685command that attempts to dereference the buffer object's data store.
10686When a data store is unmapped, the pointer to its data store becomes
10687invalid. `glUnmapBuffer' returns `GL_TRUE' unless the data store
10688contents have become corrupt during the time the data store was mapped.
10689This can occur for system-specific reasons that affect the availability
10690of graphics memory, such as screen mode changes. In such situations,
10691`GL_FALSE' is returned and the data store contents are undefined. An
10692application must detect this rare condition and reinitialize the data
10693store.
10694
10695A buffer object's mapped data store is automatically unmapped when the
10696buffer object is deleted or its data store is recreated with
10697`glBufferData'.
10698
10699`GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
10700`GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
10701`GL_PIXEL_UNPACK_BUFFER'.
10702
10703`GL_INVALID_ENUM' is generated if ACCESS is not `GL_READ_ONLY',
10704`GL_WRITE_ONLY', or `GL_READ_WRITE'.
10705
10706`GL_OUT_OF_MEMORY' is generated when `glMapBuffer' is executed if the GL
10707is unable to map the buffer object's data store. This may occur for a
10708variety of system-specific reasons, such as the absence of sufficient
10709remaining virtual memory.
10710
10711`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
10712is bound to TARGET.
10713
10714`GL_INVALID_OPERATION' is generated if `glMapBuffer' is executed for a
10715buffer object whose data store is already mapped.
10716
10717`GL_INVALID_OPERATION' is generated if `glUnmapBuffer' is executed for a
10718buffer object whose data store is not currently mapped.
10719
10720`GL_INVALID_OPERATION' is generated if `glMapBuffer' or `glUnmapBuffer'
10721is executed between the execution of `glBegin' and the corresponding
10722execution of `glEnd'.")
10723
7ec693ed 10724(define-foreign-procedure
bb894c9d
AW
10725 ((glMapGrid1d
10726 (un GLint)
10727 (u1 GLdouble)
10728 (u2 GLdouble)
10729 ->
10730 void)
10731 (glMapGrid2d
10732 (un GLint)
10733 (u1 GLdouble)
10734 (u2 GLdouble)
10735 (vn GLint)
10736 (v1 GLdouble)
10737 (v2 GLdouble)
10738 ->
10739 void))
3c9b6116
AW
10740 "Define a one- or two-dimensional mesh.
10741
10742UN
10743 Specifies the number of partitions in the grid range interval [U1,
10744 U2]. Must be positive.
10745
10746U1
10747 U2
10748
10749 Specify the mappings for integer grid domain values I=0 and I=UN .
10750
10751VN
10752 Specifies the number of partitions in the grid range interval [V1,
10753 V2] (`glMapGrid2' only).
10754
10755V1
10756 V2
10757
10758 Specify the mappings for integer grid domain values J=0 and J=VN
10759 (`glMapGrid2' only).
10760
10761`glMapGrid' and `glEvalMesh' are used together to efficiently generate
10762and evaluate a series of evenly-spaced map domain values. `glEvalMesh'
10763steps through the integer domain of a one- or two-dimensional grid,
10764whose range is the domain of the evaluation maps specified by `glMap1'
10765and `glMap2'.
10766
10767`glMapGrid1' and `glMapGrid2' specify the linear grid mappings between
10768the I (or I and J ) integer grid coordinates, to the U (or U and V )
10769floating-point evaluation map coordinates. See `glMap1' and `glMap2' for
10770details of how U and V coordinates are evaluated.
10771
10772`glMapGrid1' specifies a single linear mapping such that integer grid
10773coordinate 0 maps exactly to U1, and integer grid coordinate UN maps
10774exactly to U2. All other integer grid coordinates I are mapped so that
10775
10776U=I\u2061(U2-U1,)/UN+U1
10777
10778`glMapGrid2' specifies two such linear mappings. One maps integer grid
10779coordinate I=0 exactly to U1, and integer grid coordinate I=UN exactly
10780to U2. The other maps integer grid coordinate J=0 exactly to V1, and
10781integer grid coordinate J=VN exactly to V2. Other integer grid
10782coordinates I and J are mapped such that
10783
10784U=I\u2061(U2-U1,)/UN+U1
10785
10786V=J\u2061(V2-V1,)/VN+V1
10787
10788The mappings specified by `glMapGrid' are used identically by
10789`glEvalMesh' and `glEvalPoint'.
10790
10791`GL_INVALID_VALUE' is generated if either UN or VN is not positive.
10792
10793`GL_INVALID_OPERATION' is generated if `glMapGrid' is executed between
10794the execution of `glBegin' and the corresponding execution of `glEnd'.")
10795
7ec693ed 10796(define-foreign-procedure
bb894c9d
AW
10797 ((glMaterialf
10798 (face GLenum)
10799 (pname GLenum)
10800 (param GLfloat)
10801 ->
10802 void)
10803 (glMateriali
10804 (face GLenum)
10805 (pname GLenum)
10806 (param GLint)
10807 ->
10808 void))
3c9b6116
AW
10809 "Specify material parameters for the lighting model.
10810
10811FACE
10812 Specifies which face or faces are being updated. Must be one of
10813 `GL_FRONT', `GL_BACK', or `GL_FRONT_AND_BACK'.
10814
10815PNAME
10816 Specifies the single-valued material parameter of the face or faces
10817 that is being updated. Must be `GL_SHININESS'.
10818
10819PARAM
10820 Specifies the value that parameter `GL_SHININESS' will be set to.
10821
10822`glMaterial' assigns values to material parameters. There are two
10823matched sets of material parameters. One, the FRONT-FACING set, is used
10824to shade points, lines, bitmaps, and all polygons (when two-sided
10825lighting is disabled), or just front-facing polygons (when two-sided
10826lighting is enabled). The other set, BACK-FACING, is used to shade
10827back-facing polygons only when two-sided lighting is enabled. Refer to
10828the `glLightModel' reference page for details concerning one- and
10829two-sided lighting calculations.
10830
10831`glMaterial' takes three arguments. The first, FACE, specifies whether
10832the `GL_FRONT' materials, the `GL_BACK' materials, or both
10833`GL_FRONT_AND_BACK' materials will be modified. The second, PNAME,
10834specifies which of several parameters in one or both sets will be
10835modified. The third, PARAMS, specifies what value or values will be
10836assigned to the specified parameter.
10837
10838Material parameters are used in the lighting equation that is optionally
10839applied to each vertex. The equation is discussed in the `glLightModel'
10840reference page. The parameters that can be specified using `glMaterial',
10841and their interpretations by the lighting equation, are as follows:
10842
10843`GL_AMBIENT'
10844 PARAMS contains four integer or floating-point values that specify
10845 the ambient RGBA reflectance of the material. Integer values are
10846 mapped linearly such that the most positive representable value
10847 maps to 1.0, and the most negative representable value maps to -1.0
10848 . Floating-point values are mapped directly. Neither integer nor
10849 floating-point values are clamped. The initial ambient reflectance
10850 for both front- and back-facing materials is (0.2, 0.2, 0.2, 1.0).
10851
10852`GL_DIFFUSE'
10853 PARAMS contains four integer or floating-point values that specify
10854 the diffuse RGBA reflectance of the material. Integer values are
10855 mapped linearly such that the most positive representable value
10856 maps to 1.0, and the most negative representable value maps to -1.0
10857 . Floating-point values are mapped directly. Neither integer nor
10858 floating-point values are clamped. The initial diffuse reflectance
10859 for both front- and back-facing materials is (0.8, 0.8, 0.8, 1.0).
10860
10861`GL_SPECULAR'
10862 PARAMS contains four integer or floating-point values that specify
10863 the specular RGBA reflectance of the material. Integer values are
10864 mapped linearly such that the most positive representable value
10865 maps to 1.0, and the most negative representable value maps to -1.0
10866 . Floating-point values are mapped directly. Neither integer nor
10867 floating-point values are clamped. The initial specular reflectance
10868 for both front- and back-facing materials is (0, 0, 0, 1).
10869
10870`GL_EMISSION'
10871 PARAMS contains four integer or floating-point values that specify
10872 the RGBA emitted light intensity of the material. Integer values
10873 are mapped linearly such that the most positive representable value
10874 maps to 1.0, and the most negative representable value maps to -1.0
10875 . Floating-point values are mapped directly. Neither integer nor
10876 floating-point values are clamped. The initial emission intensity
10877 for both front- and back-facing materials is (0, 0, 0, 1).
10878
10879`GL_SHININESS'
10880 PARAMS is a single integer or floating-point value that specifies
10881 the RGBA specular exponent of the material. Integer and
10882 floating-point values are mapped directly. Only values in the range
10883 [0,128] are accepted. The initial specular exponent for both front-
10884 and back-facing materials is 0.
10885
10886`GL_AMBIENT_AND_DIFFUSE'
10887 Equivalent to calling `glMaterial' twice with the same parameter
10888 values, once with `GL_AMBIENT' and once with `GL_DIFFUSE'.
10889
10890`GL_COLOR_INDEXES'
10891 PARAMS contains three integer or floating-point values specifying
10892 the color indices for ambient, diffuse, and specular lighting.
10893 These three values, and `GL_SHININESS', are the only material
10894 values used by the color index mode lighting equation. Refer to the
10895 `glLightModel' reference page for a discussion of color index
10896 lighting.
10897
10898`GL_INVALID_ENUM' is generated if either FACE or PNAME is not an
10899accepted value.
10900
10901`GL_INVALID_VALUE' is generated if a specular exponent outside the range
10902[0,128] is specified.")
10903
7ec693ed 10904(define-foreign-procedure
bb894c9d 10905 ((glMatrixMode (mode GLenum) -> void))
3c9b6116
AW
10906 "Specify which matrix is the current matrix.
10907
10908MODE
10909 Specifies which matrix stack is the target for subsequent matrix
10910 operations. Three values are accepted: `GL_MODELVIEW',
10911 `GL_PROJECTION', and `GL_TEXTURE'. The initial value is
10912 `GL_MODELVIEW'. Additionally, if the `ARB_imaging' extension is
10913 supported, `GL_COLOR' is also accepted.
10914
10915`glMatrixMode' sets the current matrix mode. MODE can assume one of four
10916values:
10917
10918`GL_MODELVIEW'
10919 Applies subsequent matrix operations to the modelview matrix stack.
10920
10921`GL_PROJECTION'
10922 Applies subsequent matrix operations to the projection matrix
10923 stack.
10924
10925`GL_TEXTURE'
10926 Applies subsequent matrix operations to the texture matrix stack.
10927
10928`GL_COLOR'
10929 Applies subsequent matrix operations to the color matrix stack.
10930
10931To find out which matrix stack is currently the target of all matrix
10932operations, call `glGet' with argument `GL_MATRIX_MODE'. The initial
10933value is `GL_MODELVIEW'.
10934
10935`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
10936
10937`GL_INVALID_OPERATION' is generated if `glMatrixMode' is executed
10938between the execution of `glBegin' and the corresponding execution of
10939`glEnd'.")
10940
7ec693ed 10941(define-foreign-procedure
bb894c9d
AW
10942 ((glMinmax
10943 (target GLenum)
10944 (internalformat GLenum)
10945 (sink GLboolean)
10946 ->
10947 void))
3c9b6116
AW
10948 "Define minmax table.
10949
10950TARGET
10951 The minmax table whose parameters are to be set. Must be
10952 `GL_MINMAX'.
10953
10954INTERNALFORMAT
10955 The format of entries in the minmax table. Must be one of
10956 `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
10957 `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
10958 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
10959 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
10960 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
10961 `GL_LUMINANCE16_ALPHA16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4',
10962 `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16',
10963 `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8',
10964 `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'.
10965
10966SINK
10967 If `GL_TRUE', pixels will be consumed by the minmax process and no
10968 drawing or texture loading will take place. If `GL_FALSE', pixels
10969 will proceed to the final conversion process after minmax.
10970
10971When `GL_MINMAX' is enabled, the RGBA components of incoming pixels are
10972compared to the minimum and maximum values for each component, which are
10973stored in the two-element minmax table. (The first element stores the
10974minima, and the second element stores the maxima.) If a pixel component
10975is greater than the corresponding component in the maximum element, then
10976the maximum element is updated with the pixel component value. If a
10977pixel component is less than the corresponding component in the minimum
10978element, then the minimum element is updated with the pixel component
10979value. (In both cases, if the internal format of the minmax table
10980includes luminance, then the R color component of incoming pixels is
10981used for comparison.) The contents of the minmax table may be retrieved
10982at a later time by calling `glGetMinmax'. The minmax operation is
10983enabled or disabled by calling `glEnable' or `glDisable', respectively,
10984with an argument of `GL_MINMAX'.
10985
10986`glMinmax' redefines the current minmax table to have entries of the
10987format specified by INTERNALFORMAT. The maximum element is initialized
10988with the smallest possible component values, and the minimum element is
10989initialized with the largest possible component values. The values in
10990the previous minmax table, if any, are lost. If SINK is `GL_TRUE', then
10991pixels are discarded after minmax; no further processing of the pixels
10992takes place, and no drawing, texture loading, or pixel readback will
10993result.
10994
10995
10996
10997`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
10998values.
10999
11000`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
11001allowable values.
11002
11003`GL_INVALID_OPERATION' is generated if `glMinmax' is executed between
11004the execution of `glBegin' and the corresponding execution of `glEnd'.")
11005
7ec693ed 11006(define-foreign-procedure
bb894c9d
AW
11007 ((glMultiDrawArrays
11008 (mode GLenum)
11009 (first *)
11010 (count *)
11011 (primcount GLsizei)
11012 ->
11013 void))
3c9b6116
AW
11014 "Render multiple sets of primitives from array data.
11015
11016MODE
11017 Specifies what kind of primitives to render. Symbolic constants
11018 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
11019 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
11020 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
11021
11022FIRST
11023 Points to an array of starting indices in the enabled arrays.
11024
11025COUNT
11026 Points to an array of the number of indices to be rendered.
11027
11028PRIMCOUNT
11029 Specifies the size of the first and count
11030
11031`glMultiDrawArrays' specifies multiple sets of geometric primitives with
11032very few subroutine calls. Instead of calling a GL procedure to pass
11033each individual vertex, normal, texture coordinate, edge flag, or color,
11034you can prespecify separate arrays of vertices, normals, and colors and
11035use them to construct a sequence of primitives with a single call to
11036`glMultiDrawArrays'.
11037
11038`glMultiDrawArrays' behaves identically to `glDrawArrays' except that
11039PRIMCOUNT separate ranges of elements are specified instead.
11040
11041When `glMultiDrawArrays' is called, it uses COUNT sequential elements
11042from each enabled array to construct a sequence of geometric primitives,
11043beginning with element FIRST. MODE specifies what kind of primitives are
11044constructed, and how the array elements construct those primitives. If
11045`GL_VERTEX_ARRAY' is not enabled, no geometric primitives are generated.
11046
11047Vertex attributes that are modified by `glMultiDrawArrays' have an
11048unspecified value after `glMultiDrawArrays' returns. For example, if
11049`GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
11050after `glMultiDrawArrays' executes. Attributes that aren't modified
11051remain well defined.
11052
11053`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
11054
11055`GL_INVALID_VALUE' is generated if PRIMCOUNT is negative.
11056
11057`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
11058bound to an enabled array and the buffer object's data store is
11059currently mapped.
11060
11061`GL_INVALID_OPERATION' is generated if `glMultiDrawArrays' is executed
11062between the execution of `glBegin' and the corresponding `glEnd'.")
11063
7ec693ed 11064(define-foreign-procedure
bb894c9d
AW
11065 ((glMultiDrawElements
11066 (mode GLenum)
11067 (count *)
11068 (type GLenum)
11069 (indices *)
11070 (primcount GLsizei)
11071 ->
11072 void))
3c9b6116
AW
11073 "Render multiple sets of primitives by specifying indices of array data
11074elements.
11075
11076MODE
11077 Specifies what kind of primitives to render. Symbolic constants
11078 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
11079 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
11080 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
11081
11082COUNT
11083 Points to an array of the elements counts.
11084
11085TYPE
11086 Specifies the type of the values in INDICES. Must be one of
11087 `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'.
11088
11089INDICES
11090 Specifies a pointer to the location where the indices are stored.
11091
11092PRIMCOUNT
11093 Specifies the size of the COUNT array.
11094
11095`glMultiDrawElements' specifies multiple sets of geometric primitives
11096with very few subroutine calls. Instead of calling a GL function to pass
11097each individual vertex, normal, texture coordinate, edge flag, or color,
11098you can prespecify separate arrays of vertices, normals, and so on, and
11099use them to construct a sequence of primitives with a single call to
11100`glMultiDrawElements'.
11101
11102`glMultiDrawElements' is identical in operation to `glDrawElements'
11103except that PRIMCOUNT separate lists of elements are specified.
11104
11105Vertex attributes that are modified by `glMultiDrawElements' have an
11106unspecified value after `glMultiDrawElements' returns. For example, if
11107`GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
11108after `glMultiDrawElements' executes. Attributes that aren't modified
11109maintain their previous values.
11110
11111`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
11112
11113`GL_INVALID_VALUE' is generated if PRIMCOUNT is negative.
11114
11115`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
11116bound to an enabled array or the element array and the buffer object's
11117data store is currently mapped.
11118
11119`GL_INVALID_OPERATION' is generated if `glMultiDrawElements' is executed
11120between the execution of `glBegin' and the corresponding `glEnd'.")
11121
7ec693ed 11122(define-foreign-procedure
bb894c9d
AW
11123 ((glMultiTexCoord1i
11124 (target GLenum)
11125 (s GLint)
11126 ->
11127 void)
11128 (glMultiTexCoord1d
11129 (target GLenum)
11130 (s GLdouble)
11131 ->
11132 void)
11133 (glMultiTexCoord2i
11134 (target GLenum)
11135 (s GLint)
11136 (t GLint)
11137 ->
11138 void)
11139 (glMultiTexCoord2d
11140 (target GLenum)
11141 (s GLdouble)
11142 (t GLdouble)
11143 ->
11144 void)
11145 (glMultiTexCoord3i
11146 (target GLenum)
11147 (s GLint)
11148 (t GLint)
11149 (r GLint)
11150 ->
11151 void)
11152 (glMultiTexCoord3d
11153 (target GLenum)
11154 (s GLdouble)
11155 (t GLdouble)
11156 (r GLdouble)
11157 ->
11158 void)
11159 (glMultiTexCoord4i
11160 (target GLenum)
11161 (s GLint)
11162 (t GLint)
11163 (r GLint)
11164 (q GLint)
11165 ->
11166 void)
11167 (glMultiTexCoord4d
11168 (target GLenum)
11169 (s GLdouble)
11170 (t GLdouble)
11171 (r GLdouble)
11172 (q GLdouble)
11173 ->
11174 void))
3c9b6116
AW
11175 "Set the current texture coordinates.
11176
11177TARGET
11178 Specifies the texture unit whose coordinates should be modified.
11179 The number of texture units is implementation dependent, but must
11180 be at least two. Symbolic constant must be one of `GL_TEXTURE' I ,
11181 where i ranges from 0 to `GL_MAX_TEXTURE_COORDS' - 1, which is an
11182 implementation-dependent value.
11183
11184S
11185 T
11186
11187 R
11188
11189 Q
11190
11191 Specify S, T, R, and Q texture coordinates for TARGET texture unit.
11192 Not all parameters are present in all forms of the command.
11193
11194`glMultiTexCoord' specifies texture coordinates in one, two, three, or
11195four dimensions. `glMultiTexCoord1' sets the current texture coordinates
11196to (S,001) ; a call to `glMultiTexCoord2' sets them to (S,T01) .
11197Similarly, `glMultiTexCoord3' specifies the texture coordinates as
11198(S,TR1) , and `glMultiTexCoord4' defines all four components explicitly
11199as (S,TRQ) .
11200
11201The current texture coordinates are part of the data that is associated
11202with each vertex and with the current raster position. Initially, the
11203values for (S,TRQ) are (0,001) .")
11204
7ec693ed 11205(define-foreign-procedure
bb894c9d 11206 ((glMultMatrixd (m *) -> void))
3c9b6116
AW
11207 "Multiply the current matrix with the specified matrix.
11208
11209M
11210 Points to 16 consecutive values that are used as the elements of a
11211 4×4 column-major matrix.
11212
11213`glMultMatrix' multiplies the current matrix with the one specified
11214using M, and replaces the current matrix with the product.
11215
11216The current matrix is determined by the current matrix mode (see
11217`glMatrixMode'). It is either the projection matrix, modelview matrix,
11218or the texture matrix.
11219
11220`GL_INVALID_OPERATION' is generated if `glMultMatrix' is executed
11221between the execution of `glBegin' and the corresponding execution of
11222`glEnd'.")
11223
7ec693ed 11224(define-foreign-procedure
bb894c9d 11225 ((glMultTransposeMatrixd (m *) -> void))
3c9b6116
AW
11226 "Multiply the current matrix with the specified row-major ordered matrix.
11227
11228M
11229 Points to 16 consecutive values that are used as the elements of a
11230 4×4 row-major matrix.
11231
11232`glMultTransposeMatrix' multiplies the current matrix with the one
11233specified using M, and replaces the current matrix with the product.
11234
11235The current matrix is determined by the current matrix mode (see
11236`glMatrixMode'). It is either the projection matrix, modelview matrix,
11237or the texture matrix.
11238
11239`GL_INVALID_OPERATION' is generated if `glMultTransposeMatrix' is
11240executed between the execution of `glBegin' and the corresponding
11241execution of `glEnd'.")
11242
7ec693ed 11243(define-foreign-procedure
bb894c9d
AW
11244 ((glNewList (list GLuint) (mode GLenum) -> void)
11245 (glEndList -> void))
3c9b6116
AW
11246 "Create or replace a display list.
11247
11248LIST
11249 Specifies the display-list name.
11250
11251MODE
11252 Specifies the compilation mode, which can be `GL_COMPILE' or
11253 `GL_COMPILE_AND_EXECUTE'.
11254
11255Display lists are groups of GL commands that have been stored for
11256subsequent execution. Display lists are created with `glNewList'. All
11257subsequent commands are placed in the display list, in the order issued,
11258until `glEndList' is called.
11259
11260`glNewList' has two arguments. The first argument, LIST, is a positive
11261integer that becomes the unique name for the display list. Names can be
11262created and reserved with `glGenLists' and tested for uniqueness with
11263`glIsList'. The second argument, MODE, is a symbolic constant that can
11264assume one of two values:
11265
11266`GL_COMPILE'
11267 Commands are merely compiled.
11268
11269`GL_COMPILE_AND_EXECUTE'
11270 Commands are executed as they are compiled into the display list.
11271
11272Certain commands are not compiled into the display list but are executed
11273immediately, regardless of the display-list mode. These commands are
11274`glAreTexturesResident', `glColorPointer', `glDeleteLists',
11275`glDeleteTextures', `glDisableClientState', `glEdgeFlagPointer',
11276`glEnableClientState', `glFeedbackBuffer', `glFinish', `glFlush',
11277`glGenLists', `glGenTextures', `glIndexPointer', `glInterleavedArrays',
11278`glIsEnabled', `glIsList', `glIsTexture', `glNormalPointer',
11279`glPopClientAttrib', `glPixelStore', `glPushClientAttrib',
11280`glReadPixels', `glRenderMode', `glSelectBuffer', `glTexCoordPointer',
11281`glVertexPointer', and all of the `glGet' commands.
11282
11283Similarly, `glTexImage1D', `glTexImage2D', and `glTexImage3D' are
11284executed immediately and not compiled into the display list when their
11285first argument is `GL_PROXY_TEXTURE_1D', `GL_PROXY_TEXTURE_1D', or
11286`GL_PROXY_TEXTURE_3D', respectively.
11287
11288When the `ARB_imaging' extension is supported, `glHistogram' executes
11289immediately when its argument is `GL_PROXY_HISTOGRAM'. Similarly,
11290`glColorTable' executes immediately when its first argument is
11291`GL_PROXY_COLOR_TABLE', `GL_PROXY_POST_CONVOLUTION_COLOR_TABLE', or
11292`GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE'.
11293
11294For OpenGL versions 1.3 and greater, or when the `ARB_multitexture'
11295extension is supported, `glClientActiveTexture' is not compiled into
11296display lists, but executed immediately.
11297
11298When `glEndList' is encountered, the display-list definition is
11299completed by associating the list with the unique name LIST (specified
11300in the `glNewList' command). If a display list with name LIST already
11301exists, it is replaced only when `glEndList' is called.
11302
11303`GL_INVALID_VALUE' is generated if LIST is 0.
11304
11305`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
11306
11307`GL_INVALID_OPERATION' is generated if `glEndList' is called without a
11308preceding `glNewList', or if `glNewList' is called while a display list
11309is being defined.
11310
11311`GL_INVALID_OPERATION' is generated if `glNewList' or `glEndList' is
11312executed between the execution of `glBegin' and the corresponding
11313execution of `glEnd'.
11314
11315`GL_OUT_OF_MEMORY' is generated if there is insufficient memory to
11316compile the display list. If the GL version is 1.1 or greater, no change
11317is made to the previous contents of the display list, if any, and no
11318other change is made to the GL state. (It is as if no attempt had been
11319made to create the new display list.)")
11320
7ec693ed 11321(define-foreign-procedure
bb894c9d
AW
11322 ((glNormalPointer
11323 (type GLenum)
11324 (stride GLsizei)
11325 (pointer *)
11326 ->
11327 void))
3c9b6116
AW
11328 "Define an array of normals.
11329
11330TYPE
11331 Specifies the data type of each coordinate in the array. Symbolic
11332 constants `GL_BYTE', `GL_SHORT', `GL_INT', `GL_FLOAT', and
11333 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
11334
11335STRIDE
11336 Specifies the byte offset between consecutive normals. If STRIDE is
11337 0, the normals are understood to be tightly packed in the array.
11338 The initial value is 0.
11339
11340POINTER
11341 Specifies a pointer to the first coordinate of the first normal in
11342 the array. The initial value is 0.
11343
11344`glNormalPointer' specifies the location and data format of an array of
11345normals to use when rendering. TYPE specifies the data type of each
11346normal coordinate, and STRIDE specifies the byte stride from one normal
11347to the next, allowing vertices and attributes to be packed into a single
11348array or stored in separate arrays. (Single-array storage may be more
11349efficient on some implementations; see `glInterleavedArrays'.)
11350
11351If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
11352target (see `glBindBuffer') while a normal array is specified, POINTER
11353is treated as a byte offset into the buffer object's data store. Also,
11354the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as normal
11355vertex array client-side state (`GL_NORMAL_ARRAY_BUFFER_BINDING').
11356
11357When a normal array is specified, TYPE, STRIDE, and POINTER are saved as
11358client-side state, in addition to the current vertex array buffer object
11359binding.
11360
11361To enable and disable the normal array, call `glEnableClientState' and
11362`glDisableClientState' with the argument `GL_NORMAL_ARRAY'. If enabled,
11363the normal array is used when `glDrawArrays', `glMultiDrawArrays',
11364`glDrawElements', `glMultiDrawElements', `glDrawRangeElements', or
11365`glArrayElement' is called.
11366
11367`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
11368
11369`GL_INVALID_VALUE' is generated if STRIDE is negative.")
11370
7ec693ed 11371(define-foreign-procedure
bb894c9d
AW
11372 ((glNormal3d
11373 (nx GLdouble)
11374 (ny GLdouble)
11375 (nz GLdouble)
11376 ->
11377 void)
11378 (glNormal3i
11379 (nx GLint)
11380 (ny GLint)
11381 (nz GLint)
11382 ->
11383 void))
3c9b6116
AW
11384 "Set the current normal vector.
11385
11386NX
11387 NY
11388
11389 NZ
11390
11391 Specify the X , Y , and Z coordinates of the new current normal.
11392 The initial value of the current normal is the unit vector, (0, 0,
11393 1).
11394
11395
11396
11397The current normal is set to the given coordinates whenever `glNormal'
11398is issued. Byte, short, or integer arguments are converted to
11399floating-point format with a linear mapping that maps the most positive
11400representable integer value to 1.0 and the most negative representable
11401integer value to -1.0 .
11402
11403Normals specified with `glNormal' need not have unit length. If
11404`GL_NORMALIZE' is enabled, then normals of any length specified with
11405`glNormal' are normalized after transformation. If `GL_RESCALE_NORMAL'
11406is enabled, normals are scaled by a scaling factor derived from the
11407modelview matrix. `GL_RESCALE_NORMAL' requires that the originally
11408specified normals were of unit length, and that the modelview matrix
11409contain only uniform scales for proper results. To enable and disable
11410normalization, call `glEnable' and `glDisable' with either
11411`GL_NORMALIZE' or `GL_RESCALE_NORMAL'. Normalization is initially
11412disabled.")
11413
7ec693ed 11414(define-foreign-procedure
bb894c9d
AW
11415 ((glOrtho
11416 (left GLdouble)
11417 (right GLdouble)
11418 (bottom GLdouble)
11419 (top GLdouble)
11420 (nearVal GLdouble)
11421 (farVal GLdouble)
11422 ->
11423 void))
3c9b6116
AW
11424 "Multiply the current matrix with an orthographic matrix.
11425
11426LEFT
11427 RIGHT
11428
11429 Specify the coordinates for the left and right vertical clipping
11430 planes.
11431
11432BOTTOM
11433 TOP
11434
11435 Specify the coordinates for the bottom and top horizontal clipping
11436 planes.
11437
11438NEARVAL
11439 FARVAL
11440
11441 Specify the distances to the nearer and farther depth clipping
11442 planes. These values are negative if the plane is to be behind the
11443 viewer.
11444
11445`glOrtho' describes a transformation that produces a parallel
11446projection. The current matrix (see `glMatrixMode') is multiplied by
11447this matrix and the result replaces the current matrix, as if
11448`glMultMatrix' were called with the following matrix as its argument:
11449
11450((2/RIGHT-LEFT,, 0 0 T_X,), (0 2/TOP-BOTTOM,, 0 T_Y,), (0 0
11451-2/FARVAL-NEARVAL,, T_Z,), (0 0 0 1),)
11452
11453where T_X=-RIGHT+LEFT,/RIGHT-LEFT,, T_Y=-TOP+BOTTOM,/TOP-BOTTOM,,
11454T_Z=-FARVAL+NEARVAL,/FARVAL-NEARVAL,,
11455
11456Typically, the matrix mode is `GL_PROJECTION', and (LEFT,BOTTOM-NEARVAL)
11457and (RIGHT,TOP-NEARVAL) specify the points on the near clipping plane
11458that are mapped to the lower left and upper right corners of the window,
11459respectively, assuming that the eye is located at (0, 0, 0). -FARVAL
11460specifies the location of the far clipping plane. Both NEARVAL and
11461FARVAL can be either positive or negative.
11462
11463Use `glPushMatrix' and `glPopMatrix' to save and restore the current
11464matrix stack.
11465
11466`GL_INVALID_VALUE' is generated if LEFT = RIGHT, or BOTTOM = TOP, or
11467NEAR = FAR.
11468
11469`GL_INVALID_OPERATION' is generated if `glOrtho' is executed between the
11470execution of `glBegin' and the corresponding execution of `glEnd'.")
11471
7ec693ed 11472(define-foreign-procedure
bb894c9d 11473 ((glPassThrough (token GLfloat) -> void))
3c9b6116
AW
11474 "Place a marker in the feedback buffer.
11475
11476TOKEN
11477 Specifies a marker value to be placed in the feedback buffer
11478 following a `GL_PASS_THROUGH_TOKEN'.
11479
11480
11481
11482Feedback is a GL render mode. The mode is selected by calling
11483`glRenderMode' with `GL_FEEDBACK'. When the GL is in feedback mode, no
11484pixels are produced by rasterization. Instead, information about
11485primitives that would have been rasterized is fed back to the
11486application using the GL. See the `glFeedbackBuffer' reference page for
11487a description of the feedback buffer and the values in it.
11488
11489`glPassThrough' inserts a user-defined marker in the feedback buffer
11490when it is executed in feedback mode. TOKEN is returned as if it were a
11491primitive; it is indicated with its own unique identifying value:
11492`GL_PASS_THROUGH_TOKEN'. The order of `glPassThrough' commands with
11493respect to the specification of graphics primitives is maintained.
11494
11495`GL_INVALID_OPERATION' is generated if `glPassThrough' is executed
11496between the execution of `glBegin' and the corresponding execution of
11497`glEnd'.")
11498
7ec693ed 11499(define-foreign-procedure
bb894c9d
AW
11500 ((glPixelStoref
11501 (pname GLenum)
11502 (param GLfloat)
11503 ->
11504 void)
11505 (glPixelStorei
11506 (pname GLenum)
11507 (param GLint)
11508 ->
11509 void))
3c9b6116
AW
11510 "Set pixel storage modes.
11511
11512PNAME
11513 Specifies the symbolic name of the parameter to be set. Six values
11514 affect the packing of pixel data into memory: `GL_PACK_SWAP_BYTES',
11515 `GL_PACK_LSB_FIRST', `GL_PACK_ROW_LENGTH', `GL_PACK_IMAGE_HEIGHT',
11516 `GL_PACK_SKIP_PIXELS', `GL_PACK_SKIP_ROWS', `GL_PACK_SKIP_IMAGES',
11517 and `GL_PACK_ALIGNMENT'. Six more affect the unpacking of pixel
11518 data FROM memory: `GL_UNPACK_SWAP_BYTES', `GL_UNPACK_LSB_FIRST',
11519 `GL_UNPACK_ROW_LENGTH', `GL_UNPACK_IMAGE_HEIGHT',
11520 `GL_UNPACK_SKIP_PIXELS', `GL_UNPACK_SKIP_ROWS',
11521 `GL_UNPACK_SKIP_IMAGES', and `GL_UNPACK_ALIGNMENT'.
11522
11523PARAM
11524 Specifies the value that PNAME is set to.
11525
11526`glPixelStore' sets pixel storage modes that affect the operation of
11527subsequent `glDrawPixels' and `glReadPixels' as well as the unpacking of
11528polygon stipple patterns (see `glPolygonStipple'), bitmaps (see
11529`glBitmap'), texture patterns (see `glTexImage1D', `glTexImage2D',
11530`glTexImage3D', `glTexSubImage1D', `glTexSubImage2D',
11531`glTexSubImage3D'). Additionally, if the `ARB_imaging' extension is
11532supported, pixel storage modes affect convolution filters (see
11533`glConvolutionFilter1D', `glConvolutionFilter2D', and
11534`glSeparableFilter2D', color table (see `glColorTable', and
11535`glColorSubTable', and unpacking histogram (See `glHistogram'), and
11536minmax (See `glMinmax') data.
11537
11538PNAME is a symbolic constant indicating the parameter to be set, and
11539PARAM is the new value. Six of the twelve storage parameters affect how
11540pixel data is returned to client memory. They are as follows:
11541
11542`GL_PACK_SWAP_BYTES'
11543 If true, byte ordering for multibyte color components, depth
11544 components, color indices, or stencil indices is reversed. That is,
11545 if a four-byte component consists of bytes B_0 , B_1 , B_2 , B_3 ,
11546 it is stored in memory as B_3 , B_2 , B_1 , B_0 if
11547 `GL_PACK_SWAP_BYTES' is true. `GL_PACK_SWAP_BYTES' has no effect on
11548 the memory order of components within a pixel, only on the order of
11549 bytes within components or indices. For example, the three
11550 components of a `GL_RGB' format pixel are always stored with red
11551 first, green second, and blue third, regardless of the value of
11552 `GL_PACK_SWAP_BYTES'.
11553
11554`GL_PACK_LSB_FIRST'
11555 If true, bits are ordered within a byte from least significant to
11556 most significant; otherwise, the first bit in each byte is the most
11557 significant one. This parameter is significant for bitmap data
11558 only.
11559
11560`GL_PACK_ROW_LENGTH'
11561 If greater than 0, `GL_PACK_ROW_LENGTH' defines the number of
11562 pixels in a row. If the first pixel of a row is placed at location
11563 P in memory, then the location of the first pixel of the next row
11564 is obtained by skipping
11565
11566 K={(N\u2062L), (A/S,\u2062⌈S\u2062N\u2062L,/A,⌉)\u2062(S>=A), (S<A),
11567
11568 components or indices, where N is the number of components or
11569 indices in a pixel, L is the number of pixels in a row
11570 (`GL_PACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
11571 to the pixel routine otherwise), A is the value of
11572 `GL_PACK_ALIGNMENT', and S is the size, in bytes, of a single
11573 component (if A<S , then it is as if A=S ). In the case of 1-bit
11574 values, the location of the next row is obtained by skipping
11575
11576 K=8\u2062A\u2062⌈N\u2062L,/8\u2062A,,⌉
11577
11578 components or indices.
11579
11580 The word COMPONENT in this description refers to the nonindex
11581 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
11582 for example, has three components per pixel: first red, then green,
11583 and finally blue.
11584
11585`GL_PACK_IMAGE_HEIGHT'
11586 If greater than 0, `GL_PACK_IMAGE_HEIGHT' defines the number of
11587 pixels in an image three-dimensional texture volume, where
11588 ``image'' is defined by all pixels sharing the same third dimension
11589 index. If the first pixel of a row is placed at location P in
11590 memory, then the location of the first pixel of the next row is
11591 obtained by skipping
11592
11593 K={(N\u2062L\u2062H), (A/S,\u2062⌈S\u2062N\u2062L\u2062H,/A,⌉)\u2062(S>=A), (S<A),
11594
11595 components or indices, where N is the number of components or
11596 indices in a pixel, L is the number of pixels in a row
11597 (`GL_PACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
11598 to `glTexImage3D' otherwise), H is the number of rows in a pixel
11599 image (`GL_PACK_IMAGE_HEIGHT' if it is greater than 0, the HEIGHT
11600 argument to the `glTexImage3D' routine otherwise), A is the value
11601 of `GL_PACK_ALIGNMENT', and S is the size, in bytes, of a single
11602 component (if A<S , then it is as if A=S ).
11603
11604 The word COMPONENT in this description refers to the nonindex
11605 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
11606 for example, has three components per pixel: first red, then green,
11607 and finally blue.
11608
11609`GL_PACK_SKIP_PIXELS', `GL_PACK_SKIP_ROWS', and `GL_PACK_SKIP_IMAGES'
11610 These values are provided as a convenience to the programmer; they
11611 provide no functionality that cannot be duplicated simply by
11612 incrementing the pointer passed to `glReadPixels'. Setting
11613 `GL_PACK_SKIP_PIXELS' to I is equivalent to incrementing the
11614 pointer by I\u2062N components or indices, where N is the number of
11615 components or indices in each pixel. Setting `GL_PACK_SKIP_ROWS' to
11616 J is equivalent to incrementing the pointer by J\u2062M components or
11617 indices, where M is the number of components or indices per row, as
11618 just computed in the `GL_PACK_ROW_LENGTH' section. Setting
11619 `GL_PACK_SKIP_IMAGES' to K is equivalent to incrementing the
11620 pointer by K\u2062P , where P is the number of components or indices per
11621 image, as computed in the `GL_PACK_IMAGE_HEIGHT' section.
11622
11623`GL_PACK_ALIGNMENT'
11624 Specifies the alignment requirements for the start of each pixel
11625 row in memory. The allowable values are 1 (byte-alignment), 2 (rows
11626 aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows
11627 start on double-word boundaries).
11628
11629The other six of the twelve storage parameters affect how pixel data is
11630read from client memory. These values are significant for
11631`glDrawPixels', `glTexImage1D', `glTexImage2D', `glTexImage3D',
11632`glTexSubImage1D', `glTexSubImage2D', `glTexSubImage3D', `glBitmap', and
11633`glPolygonStipple'.
11634
11635Additionally, if the `ARB_imaging' extension is supported,
11636`glColorTable', `glColorSubTable', `glConvolutionFilter1D',
11637`glConvolutionFilter2D', and `glSeparableFilter2D'. They are as follows:
11638
11639`GL_UNPACK_SWAP_BYTES'
11640 If true, byte ordering for multibyte color components, depth
11641 components, color indices, or stencil indices is reversed. That is,
11642 if a four-byte component consists of bytes B_0 , B_1 , B_2 , B_3 ,
11643 it is taken from memory as B_3 , B_2 , B_1 , B_0 if
11644 `GL_UNPACK_SWAP_BYTES' is true. `GL_UNPACK_SWAP_BYTES' has no
11645 effect on the memory order of components within a pixel, only on
11646 the order of bytes within components or indices. For example, the
11647 three components of a `GL_RGB' format pixel are always stored with
11648 red first, green second, and blue third, regardless of the value of
11649 `GL_UNPACK_SWAP_BYTES'.
11650
11651`GL_UNPACK_LSB_FIRST'
11652 If true, bits are ordered within a byte from least significant to
11653 most significant; otherwise, the first bit in each byte is the most
11654 significant one. This is relevant only for bitmap data.
11655
11656`GL_UNPACK_ROW_LENGTH'
11657 If greater than 0, `GL_UNPACK_ROW_LENGTH' defines the number of
11658 pixels in a row. If the first pixel of a row is placed at location
11659 P in memory, then the location of the first pixel of the next row
11660 is obtained by skipping
11661
11662 K={(N\u2062L), (A/S,\u2062⌈S\u2062N\u2062L,/A,⌉)\u2062(S>=A), (S<A),
11663
11664 components or indices, where N is the number of components or
11665 indices in a pixel, L is the number of pixels in a row
11666 (`GL_UNPACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
11667 to the pixel routine otherwise), A is the value of
11668 `GL_UNPACK_ALIGNMENT', and S is the size, in bytes, of a single
11669 component (if A<S , then it is as if A=S ). In the case of 1-bit
11670 values, the location of the next row is obtained by skipping
11671
11672 K=8\u2062A\u2062⌈N\u2062L,/8\u2062A,,⌉
11673
11674 components or indices.
11675
11676 The word COMPONENT in this description refers to the nonindex
11677 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
11678 for example, has three components per pixel: first red, then green,
11679 and finally blue.
11680
11681`GL_UNPACK_IMAGE_HEIGHT'
11682 If greater than 0, `GL_UNPACK_IMAGE_HEIGHT' defines the number of
11683 pixels in an image of a three-dimensional texture volume. Where
11684 ``image'' is defined by all pixel sharing the same third dimension
11685 index. If the first pixel of a row is placed at location P in
11686 memory, then the location of the first pixel of the next row is
11687 obtained by skipping
11688
11689 K={(N\u2062L\u2062H), (A/S,\u2062⌈S\u2062N\u2062L\u2062H,/A,⌉)\u2062(S>=A), (S<A),
11690
11691 components or indices, where N is the number of components or
11692 indices in a pixel, L is the number of pixels in a row
11693 (`GL_UNPACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
11694 to `glTexImage3D' otherwise), H is the number of rows in an image
11695 (`GL_UNPACK_IMAGE_HEIGHT' if it is greater than 0, the HEIGHT
11696 argument to `glTexImage3D' otherwise), A is the value of
11697 `GL_UNPACK_ALIGNMENT', and S is the size, in bytes, of a single
11698 component (if A<S , then it is as if A=S ).
11699
11700 The word COMPONENT in this description refers to the nonindex
11701 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
11702 for example, has three components per pixel: first red, then green,
11703 and finally blue.
11704
11705`GL_UNPACK_SKIP_PIXELS' and `GL_UNPACK_SKIP_ROWS'
11706 These values are provided as a convenience to the programmer; they
11707 provide no functionality that cannot be duplicated by incrementing
11708 the pointer passed to `glDrawPixels', `glTexImage1D',
11709 `glTexImage2D', `glTexSubImage1D', `glTexSubImage2D', `glBitmap',
11710 or `glPolygonStipple'. Setting `GL_UNPACK_SKIP_PIXELS' to I is
11711 equivalent to incrementing the pointer by I\u2062N components or
11712 indices, where N is the number of components or indices in each
11713 pixel. Setting `GL_UNPACK_SKIP_ROWS' to J is equivalent to
11714 incrementing the pointer by J\u2062K components or indices, where K is
11715 the number of components or indices per row, as just computed in
11716 the `GL_UNPACK_ROW_LENGTH' section.
11717
11718`GL_UNPACK_ALIGNMENT'
11719 Specifies the alignment requirements for the start of each pixel
11720 row in memory. The allowable values are 1 (byte-alignment), 2 (rows
11721 aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows
11722 start on double-word boundaries).
11723
11724The following table gives the type, initial value, and range of valid
11725values for each storage parameter that can be set with `glPixelStore'.
11726
11727
11728
11729*PNAME*
11730 *Type*, *Initial Value*, *Valid Range*
11731
11732`GL_PACK_SWAP_BYTES'
11733 boolean , false , true or false
11734
11735`GL_PACK_LSB_FIRST'
11736 boolean , false , true or false
11737
11738`GL_PACK_ROW_LENGTH'
11739 integer , 0 , [0,∞)
11740
11741`GL_PACK_IMAGE_HEIGHT'
11742 integer , 0 , [0,∞)
11743
11744`GL_PACK_SKIP_ROWS'
11745 integer , 0 , [0,∞)
11746
11747`GL_PACK_SKIP_PIXELS'
11748 integer , 0 , [0,∞)
11749
11750`GL_PACK_SKIP_IMAGES'
11751 integer , 0 , [0,∞)
11752
11753`GL_PACK_ALIGNMENT'
11754 integer , 4 , 1, 2, 4, or 8
11755
11756`GL_UNPACK_SWAP_BYTES'
11757 boolean , false , true or false
11758
11759`GL_UNPACK_LSB_FIRST'
11760 boolean , false , true or false
11761
11762`GL_UNPACK_ROW_LENGTH'
11763 integer , 0 , [0,∞)
11764
11765`GL_UNPACK_IMAGE_HEIGHT'
11766 integer , 0 , [0,∞)
11767
11768`GL_UNPACK_SKIP_ROWS'
11769 integer , 0 , [0,∞)
11770
11771`GL_UNPACK_SKIP_PIXELS'
11772 integer , 0 , [0,∞)
11773
11774`GL_UNPACK_SKIP_IMAGES'
11775 integer , 0 , [0,∞)
11776
11777`GL_UNPACK_ALIGNMENT'
11778 integer , 4 , 1, 2, 4, or 8
11779
11780`glPixelStoref' can be used to set any pixel store parameter. If the
11781parameter type is boolean, then if PARAM is 0, the parameter is false;
11782otherwise it is set to true. If PNAME is a integer type parameter, PARAM
11783is rounded to the nearest integer.
11784
11785Likewise, `glPixelStorei' can also be used to set any of the pixel store
11786parameters. Boolean parameters are set to false if PARAM is 0 and true
11787otherwise.
11788
11789`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
11790
11791`GL_INVALID_VALUE' is generated if a negative row length, pixel skip, or
11792row skip value is specified, or if alignment is specified as other than
117931, 2, 4, or 8.
11794
11795`GL_INVALID_OPERATION' is generated if `glPixelStore' is executed
11796between the execution of `glBegin' and the corresponding execution of
11797`glEnd'.")
11798
7ec693ed 11799(define-foreign-procedure
bb894c9d
AW
11800 ((glPixelTransferf
11801 (pname GLenum)
11802 (param GLfloat)
11803 ->
11804 void)
11805 (glPixelTransferi
11806 (pname GLenum)
11807 (param GLint)
11808 ->
11809 void))
3c9b6116
AW
11810 "Set pixel transfer modes.
11811
11812PNAME
11813 Specifies the symbolic name of the pixel transfer parameter to be
11814 set. Must be one of the following: `GL_MAP_COLOR',
11815 `GL_MAP_STENCIL', `GL_INDEX_SHIFT', `GL_INDEX_OFFSET',
11816 `GL_RED_SCALE', `GL_RED_BIAS', `GL_GREEN_SCALE', `GL_GREEN_BIAS',
11817 `GL_BLUE_SCALE', `GL_BLUE_BIAS', `GL_ALPHA_SCALE', `GL_ALPHA_BIAS',
11818 `GL_DEPTH_SCALE', or `GL_DEPTH_BIAS'.
11819
11820 Additionally, if the `ARB_imaging' extension is supported, the
11821 following symbolic names are accepted:
11822 `GL_POST_COLOR_MATRIX_RED_SCALE',
11823 `GL_POST_COLOR_MATRIX_GREEN_SCALE',
11824 `GL_POST_COLOR_MATRIX_BLUE_SCALE',
11825 `GL_POST_COLOR_MATRIX_ALPHA_SCALE',
11826 `GL_POST_COLOR_MATRIX_RED_BIAS', `GL_POST_COLOR_MATRIX_GREEN_BIAS',
11827 `GL_POST_COLOR_MATRIX_BLUE_BIAS',
11828 `GL_POST_COLOR_MATRIX_ALPHA_BIAS', `GL_POST_CONVOLUTION_RED_SCALE',
11829 `GL_POST_CONVOLUTION_GREEN_SCALE',
11830 `GL_POST_CONVOLUTION_BLUE_SCALE',
11831 `GL_POST_CONVOLUTION_ALPHA_SCALE', `GL_POST_CONVOLUTION_RED_BIAS',
11832 `GL_POST_CONVOLUTION_GREEN_BIAS', `GL_POST_CONVOLUTION_BLUE_BIAS',
11833 and `GL_POST_CONVOLUTION_ALPHA_BIAS'.
11834
11835PARAM
11836 Specifies the value that PNAME is set to.
11837
11838`glPixelTransfer' sets pixel transfer modes that affect the operation of
11839subsequent `glCopyPixels', `glCopyTexImage1D', `glCopyTexImage2D',
11840`glCopyTexSubImage1D', `glCopyTexSubImage2D', `glCopyTexSubImage3D',
11841`glDrawPixels', `glReadPixels', `glTexImage1D', `glTexImage2D',
11842`glTexImage3D', `glTexSubImage1D', `glTexSubImage2D', and
11843`glTexSubImage3D' commands. Additionally, if the `ARB_imaging' subset is
11844supported, the routines `glColorTable', `glColorSubTable',
11845`glConvolutionFilter1D', `glConvolutionFilter2D', `glHistogram',
11846`glMinmax', and `glSeparableFilter2D' are also affected. The algorithms
11847that are specified by pixel transfer modes operate on pixels after they
11848are read from the frame buffer (`glCopyPixels'`glCopyTexImage1D',
11849`glCopyTexImage2D', `glCopyTexSubImage1D', `glCopyTexSubImage2D',
11850`glCopyTexSubImage3D', and `glReadPixels'), or unpacked from client
11851memory (`glDrawPixels', `glTexImage1D', `glTexImage2D', `glTexImage3D',
11852`glTexSubImage1D', `glTexSubImage2D', and `glTexSubImage3D'). Pixel
11853transfer operations happen in the same order, and in the same manner,
11854regardless of the command that resulted in the pixel operation. Pixel
11855storage modes (see `glPixelStore') control the unpacking of pixels being
11856read from client memory and the packing of pixels being written back
11857into client memory.
11858
11859Pixel transfer operations handle four fundamental pixel types: COLOR,
11860COLOR INDEX, DEPTH, and STENCIL. COLOR pixels consist of four
11861floating-point values with unspecified mantissa and exponent sizes,
11862scaled such that 0 represents zero intensity and 1 represents full
11863intensity. COLOR INDICES comprise a single fixed-point value, with
11864unspecified precision to the right of the binary point. DEPTH pixels
11865comprise a single floating-point value, with unspecified mantissa and
11866exponent sizes, scaled such that 0.0 represents the minimum depth buffer
11867value, and 1.0 represents the maximum depth buffer value. Finally,
11868STENCIL pixels comprise a single fixed-point value, with unspecified
11869precision to the right of the binary point.
11870
11871The pixel transfer operations performed on the four basic pixel types
11872are as follows:
11873
11874COLOR
11875 Each of the four color components is multiplied by a scale factor,
11876 then added to a bias factor. That is, the red component is
11877 multiplied by `GL_RED_SCALE', then added to `GL_RED_BIAS'; the
11878 green component is multiplied by `GL_GREEN_SCALE', then added to
11879 `GL_GREEN_BIAS'; the blue component is multiplied by
11880 `GL_BLUE_SCALE', then added to `GL_BLUE_BIAS'; and the alpha
11881 component is multiplied by `GL_ALPHA_SCALE', then added to
11882 `GL_ALPHA_BIAS'. After all four color components are scaled and
11883 biased, each is clamped to the range [0,1] . All color, scale, and
11884 bias values are specified with `glPixelTransfer'.
11885
11886 If `GL_MAP_COLOR' is true, each color component is scaled by the
11887 size of the corresponding color-to-color map, then replaced by the
11888 contents of that map indexed by the scaled component. That is, the
11889 red component is scaled by `GL_PIXEL_MAP_R_TO_R_SIZE', then
11890 replaced by the contents of `GL_PIXEL_MAP_R_TO_R' indexed by
11891 itself. The green component is scaled by
11892 `GL_PIXEL_MAP_G_TO_G_SIZE', then replaced by the contents of
11893 `GL_PIXEL_MAP_G_TO_G' indexed by itself. The blue component is
11894 scaled by `GL_PIXEL_MAP_B_TO_B_SIZE', then replaced by the contents
11895 of `GL_PIXEL_MAP_B_TO_B' indexed by itself. And the alpha component
11896 is scaled by `GL_PIXEL_MAP_A_TO_A_SIZE', then replaced by the
11897 contents of `GL_PIXEL_MAP_A_TO_A' indexed by itself. All components
11898 taken from the maps are then clamped to the range [0,1] .
11899 `GL_MAP_COLOR' is specified with `glPixelTransfer'. The contents of
11900 the various maps are specified with `glPixelMap'.
11901
11902 If the `ARB_imaging' extension is supported, each of the four color
11903 components may be scaled and biased after transformation by the
11904 color matrix. That is, the red component is multiplied by
11905 `GL_POST_COLOR_MATRIX_RED_SCALE', then added to
11906 `GL_POST_COLOR_MATRIX_RED_BIAS'; the green component is multiplied
11907 by `GL_POST_COLOR_MATRIX_GREEN_SCALE', then added to
11908 `GL_POST_COLOR_MATRIX_GREEN_BIAS'; the blue component is multiplied
11909 by `GL_POST_COLOR_MATRIX_BLUE_SCALE', then added to
11910 `GL_POST_COLOR_MATRIX_BLUE_BIAS'; and the alpha component is
11911 multiplied by `GL_POST_COLOR_MATRIX_ALPHA_SCALE', then added to
11912 `GL_POST_COLOR_MATRIX_ALPHA_BIAS'. After all four color components
11913 are scaled and biased, each is clamped to the range [0,1] .
11914
11915 Similarly, if the `ARB_imaging' extension is supported, each of the
11916 four color components may be scaled and biased after processing by
11917 the enabled convolution filter. That is, the red component is
11918 multiplied by `GL_POST_CONVOLUTION_RED_SCALE', then added to
11919 `GL_POST_CONVOLUTION_RED_BIAS'; the green component is multiplied
11920 by `GL_POST_CONVOLUTION_GREEN_SCALE', then added to
11921 `GL_POST_CONVOLUTION_GREEN_BIAS'; the blue component is multiplied
11922 by `GL_POST_CONVOLUTION_BLUE_SCALE', then added to
11923 `GL_POST_CONVOLUTION_BLUE_BIAS'; and the alpha component is
11924 multiplied by `GL_POST_CONVOLUTION_ALPHA_SCALE', then added to
11925 `GL_POST_CONVOLUTION_ALPHA_BIAS'. After all four color components
11926 are scaled and biased, each is clamped to the range [0,1] .
11927
11928COLOR INDEX
11929 Each color index is shifted left by `GL_INDEX_SHIFT' bits; any bits
11930 beyond the number of fraction bits carried by the fixed-point index
11931 are filled with zeros. If `GL_INDEX_SHIFT' is negative, the shift
11932 is to the right, again zero filled. Then `GL_INDEX_OFFSET' is added
11933 to the index. `GL_INDEX_SHIFT' and `GL_INDEX_OFFSET' are specified
11934 with `glPixelTransfer'.
11935
11936 From this point, operation diverges depending on the required
11937 format of the resulting pixels. If the resulting pixels are to be
11938 written to a color index buffer, or if they are being read back to
11939 client memory in `GL_COLOR_INDEX' format, the pixels continue to be
11940 treated as indices. If `GL_MAP_COLOR' is true, each index is masked
11941 by 2^N-1 , where N is `GL_PIXEL_MAP_I_TO_I_SIZE', then replaced by
11942 the contents of `GL_PIXEL_MAP_I_TO_I' indexed by the masked value.
11943 `GL_MAP_COLOR' is specified with `glPixelTransfer'. The contents of
11944 the index map is specified with `glPixelMap'.
11945
11946 If the resulting pixels are to be written to an RGBA color buffer,
11947 or if they are read back to client memory in a format other than
11948 `GL_COLOR_INDEX', the pixels are converted from indices to colors
11949 by referencing the four maps `GL_PIXEL_MAP_I_TO_R',
11950 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
11951 `GL_PIXEL_MAP_I_TO_A'. Before being dereferenced, the index is
11952 masked by 2^N-1 , where N is `GL_PIXEL_MAP_I_TO_R_SIZE' for the red
11953 map, `GL_PIXEL_MAP_I_TO_G_SIZE' for the green map,
11954 `GL_PIXEL_MAP_I_TO_B_SIZE' for the blue map, and
11955 `GL_PIXEL_MAP_I_TO_A_SIZE' for the alpha map. All components taken
11956 from the maps are then clamped to the range [0,1] . The contents of
11957 the four maps is specified with `glPixelMap'.
11958
11959DEPTH
11960 Each depth value is multiplied by `GL_DEPTH_SCALE', added to
11961 `GL_DEPTH_BIAS', then clamped to the range [0,1] .
11962
11963STENCIL
11964 Each index is shifted `GL_INDEX_SHIFT' bits just as a color index
11965 is, then added to `GL_INDEX_OFFSET'. If `GL_MAP_STENCIL' is true,
11966 each index is masked by 2^N-1 , where N is
11967 `GL_PIXEL_MAP_S_TO_S_SIZE', then replaced by the contents of
11968 `GL_PIXEL_MAP_S_TO_S' indexed by the masked value.
11969
11970The following table gives the type, initial value, and range of valid
11971values for each of the pixel transfer parameters that are set with
11972`glPixelTransfer'.
11973
11974
11975
11976*PNAME*
11977 *Type*, *Initial Value*, *Valid Range*
11978
11979`GL_MAP_COLOR'
11980 boolean , false , true/false
11981
11982`GL_MAP_STENCIL'
11983 boolean , false , true/false
11984
11985`GL_INDEX_SHIFT'
11986 integer , 0 , (-∞,∞)
11987
11988`GL_INDEX_OFFSET'
11989 integer , 0 , (-∞,∞)
11990
11991`GL_RED_SCALE'
11992 float , 1 , (-∞,∞)
11993
11994`GL_GREEN_SCALE'
11995 float , 1 , (-∞,∞)
11996
11997`GL_BLUE_SCALE'
11998 float , 1 , (-∞,∞)
11999
12000`GL_ALPHA_SCALE'
12001 float , 1 , (-∞,∞)
12002
12003`GL_DEPTH_SCALE'
12004 float , 1 , (-∞,∞)
12005
12006`GL_RED_BIAS'
12007 float , 0 , (-∞,∞)
12008
12009`GL_GREEN_BIAS'
12010 float , 0 , (-∞,∞)
12011
12012`GL_BLUE_BIAS'
12013 float , 0 , (-∞,∞)
12014
12015`GL_ALPHA_BIAS'
12016 float , 0 , (-∞,∞)
12017
12018`GL_DEPTH_BIAS'
12019 float , 0 , (-∞,∞)
12020
12021`GL_POST_COLOR_MATRIX_RED_SCALE'
12022 float , 1 , (-∞,∞)
12023
12024`GL_POST_COLOR_MATRIX_GREEN_SCALE'
12025 float , 1 , (-∞,∞)
12026
12027`GL_POST_COLOR_MATRIX_BLUE_SCALE'
12028 float , 1 , (-∞,∞)
12029
12030`GL_POST_COLOR_MATRIX_ALPHA_SCALE'
12031 float , 1 , (-∞,∞)
12032
12033`GL_POST_COLOR_MATRIX_RED_BIAS'
12034 float , 0 , (-∞,∞)
12035
12036`GL_POST_COLOR_MATRIX_GREEN_BIAS'
12037 float , 0 , (-∞,∞)
12038
12039`GL_POST_COLOR_MATRIX_BLUE_BIAS'
12040 float , 0 , (-∞,∞)
12041
12042`GL_POST_COLOR_MATRIX_ALPHA_BIAS'
12043 float , 0 , (-∞,∞)
12044
12045`GL_POST_CONVOLUTION_RED_SCALE'
12046 float , 1 , (-∞,∞)
12047
12048`GL_POST_CONVOLUTION_GREEN_SCALE'
12049 float , 1 , (-∞,∞)
12050
12051`GL_POST_CONVOLUTION_BLUE_SCALE'
12052 float , 1 , (-∞,∞)
12053
12054`GL_POST_CONVOLUTION_ALPHA_SCALE'
12055 float , 1 , (-∞,∞)
12056
12057`GL_POST_CONVOLUTION_RED_BIAS'
12058 float , 0 , (-∞,∞)
12059
12060`GL_POST_CONVOLUTION_GREEN_BIAS'
12061 float , 0 , (-∞,∞)
12062
12063`GL_POST_CONVOLUTION_BLUE_BIAS'
12064 float , 0 , (-∞,∞)
12065
12066`GL_POST_CONVOLUTION_ALPHA_BIAS'
12067 float , 0 , (-∞,∞)
12068
12069`glPixelTransferf' can be used to set any pixel transfer parameter. If
12070the parameter type is boolean, 0 implies false and any other value
12071implies true. If PNAME is an integer parameter, PARAM is rounded to the
12072nearest integer.
12073
12074Likewise, `glPixelTransferi' can be used to set any of the pixel
12075transfer parameters. Boolean parameters are set to false if PARAM is 0
12076and to true otherwise. PARAM is converted to floating point before being
12077assigned to real-valued parameters.
12078
12079`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
12080
12081`GL_INVALID_OPERATION' is generated if `glPixelTransfer' is executed
12082between the execution of `glBegin' and the corresponding execution of
12083`glEnd'.")
12084
7ec693ed 12085(define-foreign-procedure
bb894c9d
AW
12086 ((glPixelZoom
12087 (xfactor GLfloat)
12088 (yfactor GLfloat)
12089 ->
12090 void))
3c9b6116
AW
12091 "Specify the pixel zoom factors.
12092
12093XFACTOR
12094 YFACTOR
12095
12096 Specify the X and Y zoom factors for pixel write operations.
12097
12098`glPixelZoom' specifies values for the X and Y zoom factors. During the
12099execution of `glDrawPixels' or `glCopyPixels', if (XR , YR ) is the
12100current raster position, and a given element is in the M th row and N th
12101column of the pixel rectangle, then pixels whose centers are in the
12102rectangle with corners at
12103
12104(XR+N·XFACTOR , YR+M·YFACTOR )
12105
12106(XR+(N+1,)·XFACTOR , YR+(M+1,)·YFACTOR )
12107
12108are candidates for replacement. Any pixel whose center lies on the
12109bottom or left edge of this rectangular region is also modified.
12110
12111Pixel zoom factors are not limited to positive values. Negative zoom
12112factors reflect the resulting image about the current raster position.
12113
12114`GL_INVALID_OPERATION' is generated if `glPixelZoom' is executed between
12115the execution of `glBegin' and the corresponding execution of `glEnd'.")
12116
7ec693ed 12117(define-foreign-procedure
bb894c9d
AW
12118 ((glPointParameterf
12119 (pname GLenum)
12120 (param GLfloat)
12121 ->
12122 void)
12123 (glPointParameteri
12124 (pname GLenum)
12125 (param GLint)
12126 ->
12127 void))
3c9b6116
AW
12128 "Specify point parameters.
12129
12130PNAME
12131 Specifies a single-valued point parameter. `GL_POINT_SIZE_MIN',
12132 `GL_POINT_SIZE_MAX', `GL_POINT_FADE_THRESHOLD_SIZE', and
12133 `GL_POINT_SPRITE_COORD_ORIGIN' are accepted.
12134
12135PARAM
12136 Specifies the value that PNAME will be set to.
12137
12138The following values are accepted for PNAME:
12139
12140`GL_POINT_SIZE_MIN'
12141
12142
12143 PARAMS is a single floating-point value that specifies the minimum
12144 point size. The default value is 0.0.
12145
12146`GL_POINT_SIZE_MAX'
12147
12148
12149 PARAMS is a single floating-point value that specifies the maximum
12150 point size. The default value is 1.0.
12151
12152`GL_POINT_FADE_THRESHOLD_SIZE'
12153
12154
12155 PARAMS is a single floating-point value that specifies the
12156 threshold value to which point sizes are clamped if they exceed the
12157 specified value. The default value is 1.0.
12158
12159`GL_POINT_DISTANCE_ATTENUATION'
12160
12161
12162 PARAMS is an array of three floating-point values that specify the
12163 coefficients used for scaling the computed point size. The default
12164 values are (1,00) .
12165
12166`GL_POINT_SPRITE_COORD_ORIGIN'
12167
12168
12169 PARAMS is a single enum specifying the point sprite texture
12170 coordinate origin, either `GL_LOWER_LEFT' or `GL_UPPER_LEFT'. The
12171 default value is `GL_UPPER_LEFT'.
12172
12173`GL_INVALID_VALUE' is generated If the value specified for
12174`GL_POINT_SIZE_MIN', `GL_POINT_SIZE_MAX', or
12175`GL_POINT_FADE_THRESHOLD_SIZE' is less than zero.
12176
12177`GL_INVALID_ENUM' is generated If the value specified for
12178`GL_POINT_SPRITE_COORD_ORIGIN' is not `GL_LOWER_LEFT' or
12179`GL_UPPER_LEFT'.
12180
12181If the value for `GL_POINT_SIZE_MIN' is greater than
12182`GL_POINT_SIZE_MAX', the point size after clamping is undefined, but no
12183error is generated.")
12184
7ec693ed 12185(define-foreign-procedure
bb894c9d 12186 ((glPointSize (size GLfloat) -> void))
3c9b6116
AW
12187 "Specify the diameter of rasterized points.
12188
12189SIZE
12190 Specifies the diameter of rasterized points. The initial value is
12191 1.
12192
12193`glPointSize' specifies the rasterized diameter of both aliased and
12194antialiased points. Using a point size other than 1 has different
12195effects, depending on whether point antialiasing is enabled. To enable
12196and disable point antialiasing, call `glEnable' and `glDisable' with
12197argument `GL_POINT_SMOOTH'. Point antialiasing is initially disabled.
12198
12199The specified point size is multiplied with a distance attenuation
12200factor and clamped to the specified point size range, and further
12201clamped to the implementation-dependent point size range to produce the
12202derived point size using
12203
12204POINTSIZE=CLAMP\u2062(SIZE×√(1/A+B×D+C×D^2,,,),,)
12205
12206where D is the eye-coordinate distance from the eye to the vertex, and A
12207, B , and C are the distance attenuation coefficients (see
12208`glPointParameter').
12209
12210If multisampling is disabled, the computed point size is used as the
12211point's width.
12212
12213If multisampling is enabled, the point may be faded by modifying the
12214point alpha value (see `glSampleCoverage') instead of allowing the point
12215width to go below a given threshold (see `glPointParameter'). In this
12216case, the width is further modified in the following manner:
12217
12218POINTWIDTH={(POINTSIZE), (THRESHOLD)\u2062(POINTSIZE>=THRESHOLD),
12219(OTHERWISE),
12220
12221The point alpha value is modified by computing:
12222
12223POINTALPHA={(1), ((POINTSIZE/THRESHOLD,)^2)\u2062(POINTSIZE>=THRESHOLD),
12224(OTHERWISE),
12225
12226If point antialiasing is disabled, the actual size is determined by
12227rounding the supplied size to the nearest integer. (If the rounding
12228results in the value 0, it is as if the point size were 1.) If the
12229rounded size is odd, then the center point (X , Y ) of the pixel
12230fragment that represents the point is computed as
12231
12232(⌊X_W,⌋+.5,⌊Y_W,⌋+.5)
12233
12234where W subscripts indicate window coordinates. All pixels that lie
12235within the square grid of the rounded size centered at (X , Y ) make up
12236the fragment. If the size is even, the center point is
12237
12238(⌊X_W+.5,⌋,⌊Y_W+.5,⌋)
12239
12240and the rasterized fragment's centers are the half-integer window
12241coordinates within the square of the rounded size centered at (X,Y) .
12242All pixel fragments produced in rasterizing a nonantialiased point are
12243assigned the same associated data, that of the vertex corresponding to
12244the point.
12245
12246If antialiasing is enabled, then point rasterization produces a fragment
12247for each pixel square that intersects the region lying within the circle
12248having diameter equal to the current point size and centered at the
12249point's (X_W,Y_W) . The coverage value for each fragment is the window
12250coordinate area of the intersection of the circular region with the
12251corresponding pixel square. This value is saved and used in the final
12252rasterization step. The data associated with each fragment is the data
12253associated with the point being rasterized.
12254
12255Not all sizes are supported when point antialiasing is enabled. If an
12256unsupported size is requested, the nearest supported size is used. Only
12257size 1 is guaranteed to be supported; others depend on the
12258implementation. To query the range of supported sizes and the size
12259difference between supported sizes within the range, call `glGet' with
12260arguments `GL_SMOOTH_POINT_SIZE_RANGE' and
12261`GL_SMOOTH_POINT_SIZE_GRANULARITY'. For aliased points, query the
12262supported ranges and granularity with `glGet' with arguments
12263`GL_ALIASED_POINT_SIZE_RANGE'.
12264
12265`GL_INVALID_VALUE' is generated if SIZE is less than or equal to 0.
12266
12267`GL_INVALID_OPERATION' is generated if `glPointSize' is executed between
12268the execution of `glBegin' and the corresponding execution of `glEnd'.")
12269
7ec693ed 12270(define-foreign-procedure
bb894c9d
AW
12271 ((glPolygonMode
12272 (face GLenum)
12273 (mode GLenum)
12274 ->
12275 void))
3c9b6116
AW
12276 "Select a polygon rasterization mode.
12277
12278FACE
12279 Specifies the polygons that MODE applies to. Must be `GL_FRONT' for
12280 front-facing polygons, `GL_BACK' for back-facing polygons, or
12281 `GL_FRONT_AND_BACK' for front- and back-facing polygons.
12282
12283MODE
12284 Specifies how polygons will be rasterized. Accepted values are
12285 `GL_POINT', `GL_LINE', and `GL_FILL'. The initial value is
12286 `GL_FILL' for both front- and back-facing polygons.
12287
12288`glPolygonMode' controls the interpretation of polygons for
12289rasterization. FACE describes which polygons MODE applies to:
12290front-facing polygons (`GL_FRONT'), back-facing polygons (`GL_BACK'), or
12291both (`GL_FRONT_AND_BACK'). The polygon mode affects only the final
12292rasterization of polygons. In particular, a polygon's vertices are lit
12293and the polygon is clipped and possibly culled before these modes are
12294applied.
12295
12296Three modes are defined and can be specified in MODE:
12297
12298`GL_POINT'
12299 Polygon vertices that are marked as the start of a boundary edge
12300 are drawn as points. Point attributes such as `GL_POINT_SIZE' and
12301 `GL_POINT_SMOOTH' control the rasterization of the points. Polygon
12302 rasterization attributes other than `GL_POLYGON_MODE' have no
12303 effect.
12304
12305`GL_LINE'
12306 Boundary edges of the polygon are drawn as line segments. They are
12307 treated as connected line segments for line stippling; the line
12308 stipple counter and pattern are not reset between segments (see
12309 `glLineStipple'). Line attributes such as `GL_LINE_WIDTH' and
12310 `GL_LINE_SMOOTH' control the rasterization of the lines. Polygon
12311 rasterization attributes other than `GL_POLYGON_MODE' have no
12312 effect.
12313
12314`GL_FILL'
12315 The interior of the polygon is filled. Polygon attributes such as
12316 `GL_POLYGON_STIPPLE' and `GL_POLYGON_SMOOTH' control the
12317 rasterization of the polygon.
12318
12319`GL_INVALID_ENUM' is generated if either FACE or MODE is not an accepted
12320value.
12321
12322`GL_INVALID_OPERATION' is generated if `glPolygonMode' is executed
12323between the execution of `glBegin' and the corresponding execution of
12324`glEnd'.")
12325
7ec693ed 12326(define-foreign-procedure
bb894c9d
AW
12327 ((glPolygonOffset
12328 (factor GLfloat)
12329 (units GLfloat)
12330 ->
12331 void))
3c9b6116
AW
12332 "Set the scale and units used to calculate depth values.
12333
12334FACTOR
12335 Specifies a scale factor that is used to create a variable depth
12336 offset for each polygon. The initial value is 0.
12337
12338UNITS
12339 Is multiplied by an implementation-specific value to create a
12340 constant depth offset. The initial value is 0.
12341
12342When `GL_POLYGON_OFFSET_FILL', `GL_POLYGON_OFFSET_LINE', or
12343`GL_POLYGON_OFFSET_POINT' is enabled, each fragment's DEPTH value will
12344be offset after it is interpolated from the DEPTH values of the
12345appropriate vertices. The value of the offset is FACTOR×DZ+R×UNITS ,
12346where DZ is a measurement of the change in depth relative to the screen
12347area of the polygon, and R is the smallest value that is guaranteed to
12348produce a resolvable offset for a given implementation. The offset is
12349added before the depth test is performed and before the value is written
12350into the depth buffer.
12351
12352`glPolygonOffset' is useful for rendering hidden-line images, for
12353applying decals to surfaces, and for rendering solids with highlighted
12354edges.
12355
12356`GL_INVALID_OPERATION' is generated if `glPolygonOffset' is executed
12357between the execution of `glBegin' and the corresponding execution of
12358`glEnd'.")
12359
7ec693ed 12360(define-foreign-procedure
bb894c9d 12361 ((glPolygonStipple (pattern *) -> void))
3c9b6116
AW
12362 "Set the polygon stippling pattern.
12363
12364PATTERN
12365 Specifies a pointer to a 32×32 stipple pattern that will be
12366 unpacked from memory in the same way that `glDrawPixels' unpacks
12367 pixels.
12368
12369Polygon stippling, like line stippling (see `glLineStipple'), masks out
12370certain fragments produced by rasterization, creating a pattern.
12371Stippling is independent of polygon antialiasing.
12372
12373PATTERN is a pointer to a 32×32 stipple pattern that is stored in memory
12374just like the pixel data supplied to a `glDrawPixels' call with height
12375and WIDTH both equal to 32, a pixel format of `GL_COLOR_INDEX', and data
12376type of `GL_BITMAP'. That is, the stipple pattern is represented as a
1237732×32 array of 1-bit color indices packed in unsigned bytes.
12378`glPixelStore' parameters like `GL_UNPACK_SWAP_BYTES' and
12379`GL_UNPACK_LSB_FIRST' affect the assembling of the bits into a stipple
12380pattern. Pixel transfer operations (shift, offset, pixel map) are not
12381applied to the stipple image, however.
12382
12383If a non-zero named buffer object is bound to the
12384`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a stipple
12385pattern is specified, PATTERN is treated as a byte offset into the
12386buffer object's data store.
12387
12388To enable and disable polygon stippling, call `glEnable' and `glDisable'
12389with argument `GL_POLYGON_STIPPLE'. Polygon stippling is initially
12390disabled. If it's enabled, a rasterized polygon fragment with window
12391coordinates X_W and Y_W is sent to the next stage of the GL if and only
12392if the (X_W%32 )th bit in the (Y_W%32 )th row of the stipple pattern is
123931 (one). When polygon stippling is disabled, it is as if the stipple
12394pattern consists of all 1's.
12395
12396`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
12397bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
12398data store is currently mapped.
12399
12400`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
12401bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
12402unpacked from the buffer object such that the memory reads required
12403would exceed the data store size.
12404
12405`GL_INVALID_OPERATION' is generated if `glPolygonStipple' is executed
12406between the execution of `glBegin' and the corresponding execution of
12407`glEnd'.")
12408
7ec693ed 12409(define-foreign-procedure
bb894c9d
AW
12410 ((glPrioritizeTextures
12411 (n GLsizei)
12412 (textures *)
12413 (priorities *)
12414 ->
12415 void))
3c9b6116
AW
12416 "Set texture residence priority.
12417
12418N
12419 Specifies the number of textures to be prioritized.
12420
12421TEXTURES
12422 Specifies an array containing the names of the textures to be
12423 prioritized.
12424
12425PRIORITIES
12426 Specifies an array containing the texture priorities. A priority
12427 given in an element of PRIORITIES applies to the texture named by
12428 the corresponding element of TEXTURES.
12429
12430`glPrioritizeTextures' assigns the N texture priorities given in
12431PRIORITIES to the N textures named in TEXTURES.
12432
12433The GL establishes a ``working set'' of textures that are resident in
12434texture memory. These textures may be bound to a texture target much
12435more efficiently than textures that are not resident. By specifying a
12436priority for each texture, `glPrioritizeTextures' allows applications to
12437guide the GL implementation in determining which textures should be
12438resident.
12439
12440The priorities given in PRIORITIES are clamped to the range [0,1] before
12441they are assigned. 0 indicates the lowest priority; textures with
12442priority 0 are least likely to be resident. 1 indicates the highest
12443priority; textures with priority 1 are most likely to be resident.
12444However, textures are not guaranteed to be resident until they are used.
12445
12446`glPrioritizeTextures' silently ignores attempts to prioritize texture 0
12447or any texture name that does not correspond to an existing texture.
12448
12449`glPrioritizeTextures' does not require that any of the textures named
12450by TEXTURES be bound to a texture target. `glTexParameter' may also be
12451used to set a texture's priority, but only if the texture is currently
12452bound. This is the only way to set the priority of a default texture.
12453
12454`GL_INVALID_VALUE' is generated if N is negative.
12455
12456`GL_INVALID_OPERATION' is generated if `glPrioritizeTextures' is
12457executed between the execution of `glBegin' and the corresponding
12458execution of `glEnd'.")
12459
7ec693ed 12460(define-foreign-procedure
bb894c9d
AW
12461 ((glPushAttrib (mask GLbitfield) -> void)
12462 (glPopAttrib -> void))
3c9b6116
AW
12463 "Push and pop the server attribute stack.
12464
12465MASK
12466 Specifies a mask that indicates which attributes to save. Values
12467 for MASK are listed below.
12468
12469`glPushAttrib' takes one argument, a mask that indicates which groups of
12470state variables to save on the attribute stack. Symbolic constants are
12471used to set bits in the mask. MASK is typically constructed by
12472specifying the bitwise-or of several of these constants together. The
12473special mask `GL_ALL_ATTRIB_BITS' can be used to save all stackable
12474states.
12475
12476The symbolic mask constants and their associated GL state are as follows
12477(the second column lists which attributes are saved):
12478
12479
12480
12481`GL_ACCUM_BUFFER_BIT'
12482 Accumulation buffer clear value
12483
12484`GL_COLOR_BUFFER_BIT'
12485 `GL_ALPHA_TEST' enable bit
12486
12487
12488 Alpha test function and reference value
12489
12490
12491 `GL_BLEND' enable bit
12492
12493
12494 Blending source and destination functions
12495
12496
12497 Constant blend color
12498
12499
12500 Blending equation
12501
12502
12503 `GL_DITHER' enable bit
12504
12505
12506 `GL_DRAW_BUFFER' setting
12507
12508
12509 `GL_COLOR_LOGIC_OP' enable bit
12510
12511
12512 `GL_INDEX_LOGIC_OP' enable bit
12513
12514
12515 Logic op function
12516
12517
12518 Color mode and index mode clear values
12519
12520
12521 Color mode and index mode writemasks
12522
12523`GL_CURRENT_BIT'
12524 Current RGBA color
12525
12526
12527 Current color index
12528
12529
12530 Current normal vector
12531
12532
12533 Current texture coordinates
12534
12535
12536 Current raster position
12537
12538
12539 `GL_CURRENT_RASTER_POSITION_VALID' flag
12540
12541
12542 RGBA color associated with current raster position
12543
12544
12545 Color index associated with current raster position
12546
12547
12548 Texture coordinates associated with current raster position
12549
12550
12551 `GL_EDGE_FLAG' flag
12552
12553`GL_DEPTH_BUFFER_BIT'
12554 `GL_DEPTH_TEST' enable bit
12555
12556
12557 Depth buffer test function
12558
12559
12560 Depth buffer clear value
12561
12562
12563 `GL_DEPTH_WRITEMASK' enable bit
12564
12565`GL_ENABLE_BIT'
12566 `GL_ALPHA_TEST' flag
12567
12568
12569 `GL_AUTO_NORMAL' flag
12570
12571
12572 `GL_BLEND' flag
12573
12574
12575 Enable bits for the user-definable clipping planes
12576
12577
12578 `GL_COLOR_MATERIAL'
12579
12580
12581 `GL_CULL_FACE' flag
12582
12583
12584 `GL_DEPTH_TEST' flag
12585
12586
12587 `GL_DITHER' flag
12588
12589
12590 `GL_FOG' flag
12591
12592
12593 `GL_LIGHT'I where `0' <= I < `GL_MAX_LIGHTS'
12594
12595
12596 `GL_LIGHTING' flag
12597
12598
12599 `GL_LINE_SMOOTH' flag
12600
12601
12602 `GL_LINE_STIPPLE' flag
12603
12604
12605 `GL_COLOR_LOGIC_OP' flag
12606
12607
12608 `GL_INDEX_LOGIC_OP' flag
12609
12610
12611 `GL_MAP1_'X where X is a map type
12612
12613
12614 `GL_MAP2_'X where X is a map type
12615
12616
12617 `GL_MULTISAMPLE' flag
12618
12619
12620 `GL_NORMALIZE' flag
12621
12622
12623 `GL_POINT_SMOOTH' flag
12624
12625
12626 `GL_POLYGON_OFFSET_LINE' flag
12627
12628
12629 `GL_POLYGON_OFFSET_FILL' flag
12630
12631
12632 `GL_POLYGON_OFFSET_POINT' flag
12633
12634
12635 `GL_POLYGON_SMOOTH' flag
12636
12637
12638 `GL_POLYGON_STIPPLE' flag
12639
12640
12641 `GL_SAMPLE_ALPHA_TO_COVERAGE' flag
12642
12643
12644 `GL_SAMPLE_ALPHA_TO_ONE' flag
12645
12646
12647 `GL_SAMPLE_COVERAGE' flag
12648
12649
12650 `GL_SCISSOR_TEST' flag
12651
12652
12653 `GL_STENCIL_TEST' flag
12654
12655
12656 `GL_TEXTURE_1D' flag
12657
12658
12659 `GL_TEXTURE_2D' flag
12660
12661
12662 `GL_TEXTURE_3D' flag
12663
12664
12665 Flags `GL_TEXTURE_GEN_'X where X is S, T, R, or Q
12666
12667`GL_EVAL_BIT'
12668 `GL_MAP1_'X enable bits, where X is a map type
12669
12670
12671 `GL_MAP2_'X enable bits, where X is a map type
12672
12673
12674 1D grid endpoints and divisions
12675
12676
12677 2D grid endpoints and divisions
12678
12679
12680 `GL_AUTO_NORMAL' enable bit
12681
12682`GL_FOG_BIT'
12683 `GL_FOG' enable bit
12684
12685
12686 Fog color
12687
12688
12689 Fog density
12690
12691
12692 Linear fog start
12693
12694
12695 Linear fog end
12696
12697
12698 Fog index
12699
12700
12701 `GL_FOG_MODE' value
12702
12703`GL_HINT_BIT'
12704 `GL_PERSPECTIVE_CORRECTION_HINT' setting
12705
12706
12707 `GL_POINT_SMOOTH_HINT' setting
12708
12709
12710 `GL_LINE_SMOOTH_HINT' setting
12711
12712
12713 `GL_POLYGON_SMOOTH_HINT' setting
12714
12715
12716 `GL_FOG_HINT' setting
12717
12718
12719 `GL_GENERATE_MIPMAP_HINT' setting
12720
12721
12722 `GL_TEXTURE_COMPRESSION_HINT' setting
12723
12724`GL_LIGHTING_BIT'
12725 `GL_COLOR_MATERIAL' enable bit
12726
12727
12728 `GL_COLOR_MATERIAL_FACE' value
12729
12730
12731 Color material parameters that are tracking the current color
12732
12733
12734 Ambient scene color
12735
12736
12737 `GL_LIGHT_MODEL_LOCAL_VIEWER' value
12738
12739
12740 `GL_LIGHT_MODEL_TWO_SIDE' setting
12741
12742
12743 `GL_LIGHTING' enable bit
12744
12745
12746 Enable bit for each light
12747
12748
12749 Ambient, diffuse, and specular intensity for each light
12750
12751
12752 Direction, position, exponent, and cutoff angle for each light
12753
12754
12755 Constant, linear, and quadratic attenuation factors for each light
12756
12757
12758 Ambient, diffuse, specular, and emissive color for each material
12759
12760
12761 Ambient, diffuse, and specular color indices for each material
12762
12763
12764 Specular exponent for each material
12765
12766
12767 `GL_SHADE_MODEL' setting
12768
12769`GL_LINE_BIT'
12770 `GL_LINE_SMOOTH' flag
12771
12772
12773 `GL_LINE_STIPPLE' enable bit
12774
12775
12776 Line stipple pattern and repeat counter
12777
12778
12779 Line width
12780
12781`GL_LIST_BIT'
12782 `GL_LIST_BASE' setting
12783
12784`GL_MULTISAMPLE_BIT'
12785 `GL_MULTISAMPLE' flag
12786
12787
12788 `GL_SAMPLE_ALPHA_TO_COVERAGE' flag
12789
12790
12791 `GL_SAMPLE_ALPHA_TO_ONE' flag
12792
12793
12794 `GL_SAMPLE_COVERAGE' flag
12795
12796
12797 `GL_SAMPLE_COVERAGE_VALUE' value
12798
12799
12800 `GL_SAMPLE_COVERAGE_INVERT' value
12801
12802`GL_PIXEL_MODE_BIT'
12803 `GL_RED_BIAS' and `GL_RED_SCALE' settings
12804
12805
12806 `GL_GREEN_BIAS' and `GL_GREEN_SCALE' values
12807
12808
12809 `GL_BLUE_BIAS' and `GL_BLUE_SCALE'
12810
12811
12812 `GL_ALPHA_BIAS' and `GL_ALPHA_SCALE'
12813
12814
12815 `GL_DEPTH_BIAS' and `GL_DEPTH_SCALE'
12816
12817
12818 `GL_INDEX_OFFSET' and `GL_INDEX_SHIFT' values
12819
12820
12821 `GL_MAP_COLOR' and `GL_MAP_STENCIL' flags
12822
12823
12824 `GL_ZOOM_X' and `GL_ZOOM_Y' factors
12825
12826
12827 `GL_READ_BUFFER' setting
12828
12829`GL_POINT_BIT'
12830 `GL_POINT_SMOOTH' flag
12831
12832
12833 Point size
12834
12835`GL_POLYGON_BIT'
12836 `GL_CULL_FACE' enable bit
12837
12838
12839 `GL_CULL_FACE_MODE' value
12840
12841
12842 `GL_FRONT_FACE' indicator
12843
12844
12845 `GL_POLYGON_MODE' setting
12846
12847
12848 `GL_POLYGON_SMOOTH' flag
12849
12850
12851 `GL_POLYGON_STIPPLE' enable bit
12852
12853
12854 `GL_POLYGON_OFFSET_FILL' flag
12855
12856
12857 `GL_POLYGON_OFFSET_LINE' flag
12858
12859
12860 `GL_POLYGON_OFFSET_POINT' flag
12861
12862
12863 `GL_POLYGON_OFFSET_FACTOR'
12864
12865
12866 `GL_POLYGON_OFFSET_UNITS'
12867
12868`GL_POLYGON_STIPPLE_BIT'
12869 Polygon stipple image
12870
12871`GL_SCISSOR_BIT'
12872 `GL_SCISSOR_TEST' flag
12873
12874
12875 Scissor box
12876
12877`GL_STENCIL_BUFFER_BIT'
12878 `GL_STENCIL_TEST' enable bit
12879
12880
12881 Stencil function and reference value
12882
12883
12884 Stencil value mask
12885
12886
12887 Stencil fail, pass, and depth buffer pass actions
12888
12889
12890 Stencil buffer clear value
12891
12892
12893 Stencil buffer writemask
12894
12895`GL_TEXTURE_BIT'
12896 Enable bits for the four texture coordinates
12897
12898
12899 Border color for each texture image
12900
12901
12902 Minification function for each texture image
12903
12904
12905 Magnification function for each texture image
12906
12907
12908 Texture coordinates and wrap mode for each texture image
12909
12910
12911 Color and mode for each texture environment
12912
12913
12914 Enable bits `GL_TEXTURE_GEN_'X, X is S, T, R, and Q
12915
12916
12917 `GL_TEXTURE_GEN_MODE' setting for S, T, R, and Q
12918
12919
12920 `glTexGen' plane equations for S, T, R, and Q
12921
12922
12923 Current texture bindings (for example, `GL_TEXTURE_BINDING_2D')
12924
12925`GL_TRANSFORM_BIT'
12926 Coefficients of the six clipping planes
12927
12928
12929 Enable bits for the user-definable clipping planes
12930
12931
12932 `GL_MATRIX_MODE' value
12933
12934
12935 `GL_NORMALIZE' flag
12936
12937
12938 `GL_RESCALE_NORMAL' flag
12939
12940`GL_VIEWPORT_BIT'
12941 Depth range (near and far)
12942
12943
12944 Viewport origin and extent
12945
12946`glPopAttrib' restores the values of the state variables saved with the
12947last `glPushAttrib' command. Those not saved are left unchanged.
12948
12949It is an error to push attributes onto a full stack or to pop attributes
12950off an empty stack. In either case, the error flag is set and no other
12951change is made to GL state.
12952
12953Initially, the attribute stack is empty.
12954
12955`GL_STACK_OVERFLOW' is generated if `glPushAttrib' is called while the
12956attribute stack is full.
12957
12958`GL_STACK_UNDERFLOW' is generated if `glPopAttrib' is called while the
12959attribute stack is empty.
12960
12961`GL_INVALID_OPERATION' is generated if `glPushAttrib' or `glPopAttrib'
12962is executed between the execution of `glBegin' and the corresponding
12963execution of `glEnd'.")
8925f36f 12964
7ec693ed 12965(define-foreign-procedure
bb894c9d
AW
12966 ((glPushClientAttrib (mask GLbitfield) -> void)
12967 (glPopClientAttrib -> void))
3c9b6116
AW
12968 "Push and pop the client attribute stack.
12969
12970MASK
12971 Specifies a mask that indicates which attributes to save. Values
12972 for MASK are listed below.
12973
12974`glPushClientAttrib' takes one argument, a mask that indicates which
12975groups of client-state variables to save on the client attribute stack.
12976Symbolic constants are used to set bits in the mask. MASK is typically
12977constructed by specifying the bitwise-or of several of these constants
12978together. The special mask `GL_CLIENT_ALL_ATTRIB_BITS' can be used to
12979save all stackable client state.
12980
12981The symbolic mask constants and their associated GL client state are as
12982follows (the second column lists which attributes are saved):
12983
12984`GL_CLIENT_PIXEL_STORE_BIT' Pixel storage modes
12985`GL_CLIENT_VERTEX_ARRAY_BIT' Vertex arrays (and enables)
12986
12987`glPopClientAttrib' restores the values of the client-state variables
12988saved with the last `glPushClientAttrib'. Those not saved are left
12989unchanged.
12990
12991It is an error to push attributes onto a full client attribute stack or
12992to pop attributes off an empty stack. In either case, the error flag is
12993set, and no other change is made to GL state.
12994
12995Initially, the client attribute stack is empty.
12996
12997`GL_STACK_OVERFLOW' is generated if `glPushClientAttrib' is called while
12998the attribute stack is full.
12999
13000`GL_STACK_UNDERFLOW' is generated if `glPopClientAttrib' is called while
13001the attribute stack is empty.")
8925f36f 13002
7ec693ed 13003(define-foreign-procedure
bb894c9d 13004 ((glPushMatrix -> void) (glPopMatrix -> void))
3c9b6116
AW
13005 "Push and pop the current matrix stack.
13006
13007There is a stack of matrices for each of the matrix modes. In
13008`GL_MODELVIEW' mode, the stack depth is at least 32. In the other modes,
13009`GL_COLOR', `GL_PROJECTION', and `GL_TEXTURE', the depth is at least 2.
13010The current matrix in any mode is the matrix on the top of the stack for
13011that mode.
13012
13013`glPushMatrix' pushes the current matrix stack down by one, duplicating
13014the current matrix. That is, after a `glPushMatrix' call, the matrix on
13015top of the stack is identical to the one below it.
13016
13017`glPopMatrix' pops the current matrix stack, replacing the current
13018matrix with the one below it on the stack.
13019
13020Initially, each of the stacks contains one matrix, an identity matrix.
13021
13022It is an error to push a full matrix stack or to pop a matrix stack that
13023contains only a single matrix. In either case, the error flag is set and
13024no other change is made to GL state.
13025
13026`GL_STACK_OVERFLOW' is generated if `glPushMatrix' is called while the
13027current matrix stack is full.
13028
13029`GL_STACK_UNDERFLOW' is generated if `glPopMatrix' is called while the
13030current matrix stack contains only a single matrix.
13031
13032`GL_INVALID_OPERATION' is generated if `glPushMatrix' or `glPopMatrix'
13033is executed between the execution of `glBegin' and the corresponding
13034execution of `glEnd'.")
8925f36f 13035
7ec693ed 13036(define-foreign-procedure
bb894c9d
AW
13037 ((glPushName (name GLuint) -> void)
13038 (glPopName -> void))
3c9b6116
AW
13039 "Push and pop the name stack.
13040
13041NAME
13042 Specifies a name that will be pushed onto the name stack.
13043
13044The name stack is used during selection mode to allow sets of rendering
13045commands to be uniquely identified. It consists of an ordered set of
13046unsigned integers and is initially empty.
13047
13048`glPushName' causes NAME to be pushed onto the name stack. `glPopName'
13049pops one name off the top of the stack.
13050
13051The maximum name stack depth is implementation-dependent; call
13052`GL_MAX_NAME_STACK_DEPTH' to find out the value for a particular
13053implementation. It is an error to push a name onto a full stack or to
13054pop a name off an empty stack. It is also an error to manipulate the
13055name stack between the execution of `glBegin' and the corresponding
13056execution of `glEnd'. In any of these cases, the error flag is set and
13057no other change is made to GL state.
13058
13059The name stack is always empty while the render mode is not `GL_SELECT'.
13060Calls to `glPushName' or `glPopName' while the render mode is not
13061`GL_SELECT' are ignored.
13062
13063`GL_STACK_OVERFLOW' is generated if `glPushName' is called while the
13064name stack is full.
13065
13066`GL_STACK_UNDERFLOW' is generated if `glPopName' is called while the
13067name stack is empty.
13068
13069`GL_INVALID_OPERATION' is generated if `glPushName' or `glPopName' is
13070executed between a call to `glBegin' and the corresponding call to
13071`glEnd'.")
8925f36f 13072
7ec693ed 13073(define-foreign-procedure
bb894c9d
AW
13074 ((glRasterPos2i (x GLint) (y GLint) -> void)
13075 (glRasterPos2d (x GLdouble) (y GLdouble) -> void)
13076 (glRasterPos3i
13077 (x GLint)
13078 (y GLint)
13079 (z GLint)
13080 ->
13081 void)
13082 (glRasterPos3d
13083 (x GLdouble)
13084 (y GLdouble)
13085 (z GLdouble)
13086 ->
13087 void)
13088 (glRasterPos4i
13089 (x GLint)
13090 (y GLint)
13091 (z GLint)
13092 (w GLint)
13093 ->
13094 void)
13095 (glRasterPos4d
13096 (x GLdouble)
13097 (y GLdouble)
13098 (z GLdouble)
13099 (w GLdouble)
13100 ->
13101 void))
3c9b6116
AW
13102 "Specify the raster position for pixel operations.
13103
13104X
13105 Y
13106
13107 Z
13108
13109 W
13110
13111 Specify the X , Y , Z , and W object coordinates (if present) for
13112 the raster position.
13113
13114The GL maintains a 3D position in window coordinates. This position,
13115called the raster position, is used to position pixel and bitmap write
13116operations. It is maintained with subpixel accuracy. See `glBitmap',
13117`glDrawPixels', and `glCopyPixels'.
13118
13119The current raster position consists of three window coordinates (X , Y
13120, Z ), a clip coordinate value (W ), an eye coordinate distance, a valid
13121bit, and associated color data and texture coordinates. The W coordinate
13122is a clip coordinate, because W is not projected to window coordinates.
13123`glRasterPos4' specifies object coordinates X , Y , Z , and W
13124explicitly. `glRasterPos3' specifies object coordinate X , Y , and Z
13125explicitly, while W is implicitly set to 1. `glRasterPos2' uses the
13126argument values for X and Y while implicitly setting Z and W to 0 and 1.
13127
13128The object coordinates presented by `glRasterPos' are treated just like
13129those of a `glVertex' command: They are transformed by the current
13130modelview and projection matrices and passed to the clipping stage. If
13131the vertex is not culled, then it is projected and scaled to window
13132coordinates, which become the new current raster position, and the
13133`GL_CURRENT_RASTER_POSITION_VALID' flag is set. If the vertex IS culled,
13134then the valid bit is cleared and the current raster position and
13135associated color and texture coordinates are undefined.
13136
13137The current raster position also includes some associated color data and
13138texture coordinates. If lighting is enabled, then
13139`GL_CURRENT_RASTER_COLOR' (in RGBA mode) or `GL_CURRENT_RASTER_INDEX'
13140(in color index mode) is set to the color produced by the lighting
13141calculation (see `glLight', `glLightModel', and `glShadeModel'). If
13142lighting is disabled, current color (in RGBA mode, state variable
13143`GL_CURRENT_COLOR') or color index (in color index mode, state variable
13144`GL_CURRENT_INDEX') is used to update the current raster color.
13145`GL_CURRENT_RASTER_SECONDARY_COLOR' (in RGBA mode) is likewise updated.
13146
13147Likewise, `GL_CURRENT_RASTER_TEXTURE_COORDS' is updated as a function of
13148`GL_CURRENT_TEXTURE_COORDS', based on the texture matrix and the texture
13149generation functions (see `glTexGen'). Finally, the distance from the
13150origin of the eye coordinate system to the vertex as transformed by only
13151the modelview matrix replaces `GL_CURRENT_RASTER_DISTANCE'.
13152
13153Initially, the current raster position is (0, 0, 0, 1), the current
13154raster distance is 0, the valid bit is set, the associated RGBA color is
13155(1, 1, 1, 1), the associated color index is 1, and the associated
13156texture coordinates are (0, 0, 0, 1). In RGBA mode,
13157`GL_CURRENT_RASTER_INDEX' is always 1; in color index mode, the current
13158raster RGBA color always maintains its initial value.
13159
13160`GL_INVALID_OPERATION' is generated if `glRasterPos' is executed between
13161the execution of `glBegin' and the corresponding execution of `glEnd'.")
13162
7ec693ed 13163(define-foreign-procedure
bb894c9d 13164 ((glReadBuffer (mode GLenum) -> void))
3c9b6116
AW
13165 "Select a color buffer source for pixels.
13166
13167MODE
13168 Specifies a color buffer. Accepted values are `GL_FRONT_LEFT',
13169 `GL_FRONT_RIGHT', `GL_BACK_LEFT', `GL_BACK_RIGHT', `GL_FRONT',
13170 `GL_BACK', `GL_LEFT', `GL_RIGHT', and `GL_AUX'I, where I is between
13171 0 and the value of `GL_AUX_BUFFERS' minus 1.
13172
13173`glReadBuffer' specifies a color buffer as the source for subsequent
13174`glReadPixels', `glCopyTexImage1D', `glCopyTexImage2D',
13175`glCopyTexSubImage1D', `glCopyTexSubImage2D', `glCopyTexSubImage3D', and
13176`glCopyPixels' commands. MODE accepts one of twelve or more predefined
13177values. (`GL_AUX0' through `GL_AUX3' are always defined.) In a fully
13178configured system, `GL_FRONT', `GL_LEFT', and `GL_FRONT_LEFT' all name
13179the front left buffer, `GL_FRONT_RIGHT' and `GL_RIGHT' name the front
13180right buffer, and `GL_BACK_LEFT' and `GL_BACK' name the back left
13181buffer.
13182
13183Nonstereo double-buffered configurations have only a front left and a
13184back left buffer. Single-buffered configurations have a front left and a
13185front right buffer if stereo, and only a front left buffer if nonstereo.
13186It is an error to specify a nonexistent buffer to `glReadBuffer'.
13187
13188MODE is initially `GL_FRONT' in single-buffered configurations and
13189`GL_BACK' in double-buffered configurations.
13190
13191`GL_INVALID_ENUM' is generated if MODE is not one of the twelve (or
13192more) accepted values.
13193
13194`GL_INVALID_OPERATION' is generated if MODE specifies a buffer that does
13195not exist.
13196
13197`GL_INVALID_OPERATION' is generated if `glReadBuffer' is executed
13198between the execution of `glBegin' and the corresponding execution of
13199`glEnd'.")
13200
7ec693ed 13201(define-foreign-procedure
bb894c9d
AW
13202 ((glReadPixels
13203 (x GLint)
13204 (y GLint)
13205 (width GLsizei)
13206 (height GLsizei)
13207 (format GLenum)
13208 (type GLenum)
13209 (data *)
13210 ->
13211 void))
3c9b6116
AW
13212 "Read a block of pixels from the frame buffer.
13213
13214X
13215 Y
13216
13217 Specify the window coordinates of the first pixel that is read from
13218 the frame buffer. This location is the lower left corner of a
13219 rectangular block of pixels.
13220
13221WIDTH
13222 HEIGHT
13223
13224 Specify the dimensions of the pixel rectangle. WIDTH and HEIGHT of
13225 one correspond to a single pixel.
13226
13227FORMAT
13228 Specifies the format of the pixel data. The following symbolic
13229 values are accepted: `GL_COLOR_INDEX', `GL_STENCIL_INDEX',
13230 `GL_DEPTH_COMPONENT', `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA',
13231 `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and
13232 `GL_LUMINANCE_ALPHA'.
13233
13234TYPE
13235 Specifies the data type of the pixel data. Must be one of
13236 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
13237 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
13238 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
13239 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
13240 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
13241 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
13242 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
13243 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV'.
13244
13245DATA
13246 Returns the pixel data.
13247
13248`glReadPixels' returns pixel data from the frame buffer, starting with
13249the pixel whose lower left corner is at location (X, Y), into client
13250memory starting at location DATA. Several parameters control the
13251processing of the pixel data before it is placed into client memory.
13252These parameters are set with three commands: `glPixelStore',
13253`glPixelTransfer', and `glPixelMap'. This reference page describes the
13254effects on `glReadPixels' of most, but not all of the parameters
13255specified by these three commands.
13256
13257If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
13258target (see `glBindBuffer') while a block of pixels is requested, DATA
13259is treated as a byte offset into the buffer object's data store rather
13260than a pointer to client memory.
13261
13262When the `ARB_imaging' extension is supported, the pixel data may be
13263processed by additional operations including color table lookup, color
13264matrix transformations, convolutions, histograms, and minimum and
13265maximum pixel value computations.
13266
13267`glReadPixels' returns values from each pixel with lower left corner at
13268(X+I,Y+J) for 0<=I<WIDTH and 0<=J<HEIGHT . This pixel is said to be the
13269I th pixel in the J th row. Pixels are returned in row order from the
13270lowest to the highest row, left to right in each row.
13271
13272FORMAT specifies the format for the returned pixel values; accepted
13273values are:
13274
13275`GL_COLOR_INDEX'
13276 Color indices are read from the color buffer selected by
13277 `glReadBuffer'. Each index is converted to fixed point, shifted
13278 left or right depending on the value and sign of `GL_INDEX_SHIFT',
13279 and added to `GL_INDEX_OFFSET'. If `GL_MAP_COLOR' is `GL_TRUE',
13280 indices are replaced by their mappings in the table
13281 `GL_PIXEL_MAP_I_TO_I'.
13282
13283`GL_STENCIL_INDEX'
13284 Stencil values are read from the stencil buffer. Each index is
13285 converted to fixed point, shifted left or right depending on the
13286 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'.
13287 If `GL_MAP_STENCIL' is `GL_TRUE', indices are replaced by their
13288 mappings in the table `GL_PIXEL_MAP_S_TO_S'.
13289
13290`GL_DEPTH_COMPONENT'
13291 Depth values are read from the depth buffer. Each component is
13292 converted to floating point such that the minimum depth value maps
13293 to 0 and the maximum value maps to 1. Each component is then
13294 multiplied by `GL_DEPTH_SCALE', added to `GL_DEPTH_BIAS', and
13295 finally clamped to the range [0,1] .
13296
13297`GL_RED'
13298`GL_GREEN'
13299`GL_BLUE'
13300`GL_ALPHA'
13301`GL_RGB'
13302`GL_BGR'
13303`GL_RGBA'
13304`GL_BGRA'
13305`GL_LUMINANCE'
13306`GL_LUMINANCE_ALPHA'
13307 Processing differs depending on whether color buffers store color
13308 indices or RGBA color components. If color indices are stored, they
13309 are read from the color buffer selected by `glReadBuffer'. Each
13310 index is converted to fixed point, shifted left or right depending
13311 on the value and sign of `GL_INDEX_SHIFT', and added to
13312 `GL_INDEX_OFFSET'. Indices are then replaced by the red, green,
13313 blue, and alpha values obtained by indexing the tables
13314 `GL_PIXEL_MAP_I_TO_R', `GL_PIXEL_MAP_I_TO_G',
13315 `GL_PIXEL_MAP_I_TO_B', and `GL_PIXEL_MAP_I_TO_A'. Each table must
13316 be of size 2^N , but N may be different for different tables.
13317 Before an index is used to look up a value in a table of size 2^N ,
13318 it must be masked against 2^N-1 .
13319
13320 If RGBA color components are stored in the color buffers, they are
13321 read from the color buffer selected by `glReadBuffer'. Each color
13322 component is converted to floating point such that zero intensity
13323 maps to 0.0 and full intensity maps to 1.0. Each component is then
13324 multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where C is
13325 RED, GREEN, BLUE, or ALPHA. Finally, if `GL_MAP_COLOR' is
13326 `GL_TRUE', each component is clamped to the range [0,1] , scaled to
13327 the size of its corresponding table, and is then replaced by its
13328 mapping in the table `GL_PIXEL_MAP_c_TO_c', where C is R, G, B, or
13329 A.
13330
13331 Unneeded data is then discarded. For example, `GL_RED' discards the
13332 green, blue, and alpha components, while `GL_RGB' discards only the
13333 alpha component. `GL_LUMINANCE' computes a single-component value
13334 as the sum of the red, green, and blue components, and
13335 `GL_LUMINANCE_ALPHA' does the same, while keeping alpha as a second
13336 value. The final values are clamped to the range [0,1] .
13337
13338The shift, scale, bias, and lookup factors just described are all
13339specified by `glPixelTransfer'. The lookup table contents themselves are
13340specified by `glPixelMap'.
13341
13342Finally, the indices or components are converted to the proper format,
13343as specified by TYPE. If FORMAT is `GL_COLOR_INDEX' or
13344`GL_STENCIL_INDEX' and TYPE is not `GL_FLOAT', each index is masked with
13345the mask value given in the following table. If TYPE is `GL_FLOAT', then
13346each integer index is converted to single-precision floating-point
13347format.
13348
13349If FORMAT is `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB',
13350`GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'
13351and TYPE is not `GL_FLOAT', each component is multiplied by the
13352multiplier shown in the following table. If type is `GL_FLOAT', then
13353each component is passed as is (or converted to the client's
13354single-precision floating-point format if it is different from the one
13355used by the GL).
13356
13357
13358
13359TYPE
13360 *Index Mask*, *Component Conversion*
13361
13362`GL_UNSIGNED_BYTE'
13363 2^8-1 , (2^8-1,)\u2062C
13364
13365`GL_BYTE'
13366 2^7-1 , (2^8-1,)\u2062C-1,/2
13367
13368`GL_BITMAP'
13369 1 , 1
13370
13371`GL_UNSIGNED_SHORT'
13372 2^16-1 , (2^16-1,)\u2062C
13373
13374`GL_SHORT'
13375 2^15-1 , (2^16-1,)\u2062C-1,/2
13376
13377`GL_UNSIGNED_INT'
13378 2^32-1 , (2^32-1,)\u2062C
13379
13380`GL_INT'
13381 2^31-1 , (2^32-1,)\u2062C-1,/2
13382
13383`GL_FLOAT'
13384 none , C
13385
13386Return values are placed in memory as follows. If FORMAT is
13387`GL_COLOR_INDEX', `GL_STENCIL_INDEX', `GL_DEPTH_COMPONENT', `GL_RED',
13388`GL_GREEN', `GL_BLUE', `GL_ALPHA', or `GL_LUMINANCE', a single value is
13389returned and the data for the I th pixel in the J th row is placed in
13390location (J,)\u2062WIDTH+I . `GL_RGB' and `GL_BGR' return three values,
13391`GL_RGBA' and `GL_BGRA' return four values, and `GL_LUMINANCE_ALPHA'
13392returns two values for each pixel, with all values corresponding to a
13393single pixel occupying contiguous space in DATA. Storage parameters set
13394by `glPixelStore', such as `GL_PACK_LSB_FIRST' and `GL_PACK_SWAP_BYTES',
13395affect the way that data is written into memory. See `glPixelStore' for
13396a description.
13397
13398`GL_INVALID_ENUM' is generated if FORMAT or TYPE is not an accepted
13399value.
13400
13401`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
13402`GL_COLOR_INDEX' or `GL_STENCIL_INDEX'.
13403
13404`GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
13405
13406`GL_INVALID_OPERATION' is generated if FORMAT is `GL_COLOR_INDEX' and
13407the color buffers store RGBA color components.
13408
13409`GL_INVALID_OPERATION' is generated if FORMAT is `GL_STENCIL_INDEX' and
13410there is no stencil buffer.
13411
13412`GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT'
13413and there is no depth buffer.
13414
13415`GL_INVALID_OPERATION' is generated if TYPE is one of
13416`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
13417`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
13418is not `GL_RGB'.
13419
13420`GL_INVALID_OPERATION' is generated if TYPE is one of
13421`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
13422`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
13423`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
13424`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
13425FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
13426
13427The formats `GL_BGR', and `GL_BGRA' and types `GL_UNSIGNED_BYTE_3_3_2',
13428`GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
13429`GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
13430`GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
13431`GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
13432`GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
13433`GL_UNSIGNED_INT_2_10_10_10_REV' are available only if the GL version is
134341.2 or greater.
13435
13436`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
13437bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
13438store is currently mapped.
13439
13440`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
13441bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
13442to the buffer object such that the memory writes required would exceed
13443the data store size.
13444
13445`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
13446bound to the `GL_PIXEL_PACK_BUFFER' target and DATA is not evenly
13447divisible into the number of bytes needed to store in memory a datum
13448indicated by TYPE.
8925f36f 13449
3c9b6116
AW
13450`GL_INVALID_OPERATION' is generated if `glReadPixels' is executed
13451between the execution of `glBegin' and the corresponding execution of
13452`glEnd'.")
8925f36f 13453
7ec693ed 13454(define-foreign-procedure
bb894c9d
AW
13455 ((glRectd
13456 (x1 GLdouble)
13457 (y1 GLdouble)
13458 (x2 GLdouble)
13459 (y2 GLdouble)
13460 ->
13461 void)
13462 (glRecti
13463 (x1 GLint)
13464 (y1 GLint)
13465 (x2 GLint)
13466 (y2 GLint)
13467 ->
13468 void))
3c9b6116 13469 "Draw a rectangle.
8925f36f 13470
3c9b6116
AW
13471X1
13472 Y1
8925f36f 13473
3c9b6116 13474 Specify one vertex of a rectangle.
8925f36f 13475
3c9b6116
AW
13476X2
13477 Y2
8925f36f 13478
3c9b6116 13479 Specify the opposite vertex of the rectangle.
8925f36f 13480
3c9b6116
AW
13481`glRect' supports efficient specification of rectangles as two corner
13482points. Each rectangle command takes four arguments, organized either as
13483two consecutive pairs of (X,Y) coordinates or as two pointers to arrays,
13484each containing an (X,Y) pair. The resulting rectangle is defined in the
13485Z=0 plane.
8925f36f 13486
3c9b6116
AW
13487`glRect'(X1, Y1, X2, Y2) is exactly equivalent to the following
13488sequence: Note that if the second vertex is above and to the right of
13489the first vertex, the rectangle is constructed with a counterclockwise
13490winding.
8925f36f 13491
3c9b6116
AW
13492
13493 glBegin(`GL_POLYGON');
13494 glVertex2(X1, Y1);
13495 glVertex2(X2, Y1);
13496 glVertex2(X2, Y2);
13497 glVertex2(X1, Y2);
13498 glEnd();
8925f36f 13499
3c9b6116
AW
13500`GL_INVALID_OPERATION' is generated if `glRect' is executed between the
13501execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 13502
7ec693ed 13503(define-foreign-procedure
bb894c9d 13504 ((glRenderMode (mode GLenum) -> GLint))
3c9b6116 13505 "Set rasterization mode.
8925f36f 13506
3c9b6116
AW
13507MODE
13508 Specifies the rasterization mode. Three values are accepted:
13509 `GL_RENDER', `GL_SELECT', and `GL_FEEDBACK'. The initial value is
13510 `GL_RENDER'.
13511
13512`glRenderMode' sets the rasterization mode. It takes one argument, MODE,
13513which can assume one of three predefined values:
13514
13515`GL_RENDER'
13516 Render mode. Primitives are rasterized, producing pixel fragments,
13517 which are written into the frame buffer. This is the normal mode
13518 and also the default mode.
13519
13520`GL_SELECT'
13521 Selection mode. No pixel fragments are produced, and no change to
13522 the frame buffer contents is made. Instead, a record of the names
13523 of primitives that would have been drawn if the render mode had
13524 been `GL_RENDER' is returned in a select buffer, which must be
13525 created (see `glSelectBuffer') before selection mode is entered.
13526
13527`GL_FEEDBACK'
13528 Feedback mode. No pixel fragments are produced, and no change to
13529 the frame buffer contents is made. Instead, the coordinates and
13530 attributes of vertices that would have been drawn if the render
13531 mode had been `GL_RENDER' is returned in a feedback buffer, which
13532 must be created (see `glFeedbackBuffer') before feedback mode is
13533 entered.
13534
13535The return value of `glRenderMode' is determined by the render mode at
13536the time `glRenderMode' is called, rather than by MODE. The values
13537returned for the three render modes are as follows:
13538
13539`GL_RENDER'
13540 0.
13541
13542`GL_SELECT'
13543 The number of hit records transferred to the select buffer.
13544
13545`GL_FEEDBACK'
13546 The number of values (not vertices) transferred to the feedback
13547 buffer.
13548
13549See the `glSelectBuffer' and `glFeedbackBuffer' reference pages for more
13550details concerning selection and feedback operation.
13551
13552`GL_INVALID_ENUM' is generated if MODE is not one of the three accepted
13553values.
13554
13555`GL_INVALID_OPERATION' is generated if `glSelectBuffer' is called while
13556the render mode is `GL_SELECT', or if `glRenderMode' is called with
13557argument `GL_SELECT' before `glSelectBuffer' is called at least once.
13558
13559`GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is called
13560while the render mode is `GL_FEEDBACK', or if `glRenderMode' is called
13561with argument `GL_FEEDBACK' before `glFeedbackBuffer' is called at least
13562once.
13563
13564`GL_INVALID_OPERATION' is generated if `glRenderMode' is executed
13565between the execution of `glBegin' and the corresponding execution of
13566`glEnd'.")
8925f36f 13567
7ec693ed 13568(define-foreign-procedure
bb894c9d 13569 ((glResetHistogram (target GLenum) -> void))
3c9b6116
AW
13570 "Reset histogram table entries to zero.
13571
13572TARGET
13573 Must be `GL_HISTOGRAM'.
13574
13575`glResetHistogram' resets all the elements of the current histogram
13576table to zero.
13577
13578`GL_INVALID_ENUM' is generated if TARGET is not `GL_HISTOGRAM'.
13579
13580`GL_INVALID_OPERATION' is generated if `glResetHistogram' is executed
13581between the execution of `glBegin' and the corresponding execution of
13582`glEnd'.")
8925f36f 13583
7ec693ed 13584(define-foreign-procedure
bb894c9d 13585 ((glResetMinmax (target GLenum) -> void))
3c9b6116
AW
13586 "Reset minmax table entries to initial values.
13587
13588TARGET
13589 Must be `GL_MINMAX'.
13590
13591`glResetMinmax' resets the elements of the current minmax table to their
13592initial values: the ``maximum'' element receives the minimum possible
13593component values, and the ``minimum'' element receives the maximum
13594possible component values.
13595
13596`GL_INVALID_ENUM' is generated if TARGET is not `GL_MINMAX'.
13597
13598`GL_INVALID_OPERATION' is generated if `glResetMinmax' is executed
13599between the execution of `glBegin' and the corresponding execution of
13600`glEnd'.")
8925f36f 13601
7ec693ed 13602(define-foreign-procedure
bb894c9d
AW
13603 ((glRotated
13604 (angle GLdouble)
13605 (x GLdouble)
13606 (y GLdouble)
13607 (z GLdouble)
13608 ->
13609 void))
3c9b6116
AW
13610 "Multiply the current matrix by a rotation matrix.
13611
13612ANGLE
13613 Specifies the angle of rotation, in degrees.
13614
13615X
13616 Y
13617
13618 Z
13619
13620 Specify the X, Y, and Z coordinates of a vector, respectively.
13621
13622`glRotate' produces a rotation of ANGLE degrees around the vector (X,YZ)
13623. The current matrix (see `glMatrixMode') is multiplied by a rotation
13624matrix with the product replacing the current matrix, as if
13625`glMultMatrix' were called with the following matrix as its argument:
13626
13627((X^2\u2061(1-C,)+C X\u2062Y\u2061(1-C,)-Z\u2062S X\u2062Z\u2061(1-C,)+Y\u2062S 0), (Y\u2062X\u2061(1-C,)+Z\u2062S
13628Y^2\u2061(1-C,)+C Y\u2062Z\u2061(1-C,)-X\u2062S 0), (X\u2062Z\u2061(1-C,)-Y\u2062S Y\u2062Z\u2061(1-C,)+X\u2062S
13629Z^2\u2061(1-C,)+C 0), (0 0 0 1),)
13630
13631
13632
13633Where C=COS\u2061(ANGLE,) , S=SIN\u2061(ANGLE,) , and ∥(X,YZ),∥=1 (if not, the GL
13634will normalize this vector).
13635
13636
13637
13638
13639
13640If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all
13641objects drawn after `glRotate' is called are rotated. Use `glPushMatrix'
13642and `glPopMatrix' to save and restore the unrotated coordinate system.
13643
13644`GL_INVALID_OPERATION' is generated if `glRotate' is executed between
13645the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 13646
7ec693ed 13647(define-foreign-procedure
bb894c9d
AW
13648 ((glSampleCoverage
13649 (value GLclampf)
13650 (invert GLboolean)
13651 ->
13652 void))
3c9b6116
AW
13653 "Specify multisample coverage parameters.
13654
13655VALUE
13656 Specify a single floating-point sample coverage value. The value is
13657 clamped to the range [0,1] . The initial value is 1.0.
13658
13659INVERT
13660 Specify a single boolean value representing if the coverage masks
13661 should be inverted. `GL_TRUE' and `GL_FALSE' are accepted. The
13662 initial value is `GL_FALSE'.
13663
13664Multisampling samples a pixel multiple times at various
13665implementation-dependent subpixel locations to generate antialiasing
13666effects. Multisampling transparently antialiases points, lines,
13667polygons, bitmaps, and images if it is enabled.
13668
13669VALUE is used in constructing a temporary mask used in determining which
13670samples will be used in resolving the final fragment color. This mask is
13671bitwise-anded with the coverage mask generated from the multisampling
13672computation. If the INVERT flag is set, the temporary mask is inverted
13673(all bits flipped) and then the bitwise-and is computed.
13674
13675If an implementation does not have any multisample buffers available, or
13676multisampling is disabled, rasterization occurs with only a single
13677sample computing a pixel's final RGB color.
13678
13679Provided an implementation supports multisample buffers, and
13680multisampling is enabled, then a pixel's final color is generated by
13681combining several samples per pixel. Each sample contains color, depth,
13682and stencil information, allowing those operations to be performed on
13683each sample.
13684
13685`GL_INVALID_OPERATION' is generated if `glSampleCoverage' is executed
13686between the execution of `glBegin' and the corresponding execution of
13687`glEnd'.")
8925f36f 13688
7ec693ed 13689(define-foreign-procedure
bb894c9d
AW
13690 ((glScaled
13691 (x GLdouble)
13692 (y GLdouble)
13693 (z GLdouble)
13694 ->
13695 void))
3c9b6116
AW
13696 "Multiply the current matrix by a general scaling matrix.
13697
13698X
13699 Y
13700
13701 Z
13702
13703 Specify scale factors along the X, Y, and Z axes, respectively.
13704
13705`glScale' produces a nonuniform scaling along the X, Y, and Z axes. The
13706three parameters indicate the desired scale factor along each of the
13707three axes.
13708
13709The current matrix (see `glMatrixMode') is multiplied by this scale
13710matrix, and the product replaces the current matrix as if `glMultMatrix'
13711were called with the following matrix as its argument:
13712
13713((X 0 0 0), (0 Y 0 0), (0 0 Z 0), (0 0 0 1),)
13714
13715If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all
13716objects drawn after `glScale' is called are scaled.
13717
13718Use `glPushMatrix' and `glPopMatrix' to save and restore the unscaled
13719coordinate system.
13720
13721`GL_INVALID_OPERATION' is generated if `glScale' is executed between the
13722execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 13723
7ec693ed 13724(define-foreign-procedure
bb894c9d
AW
13725 ((glScissor
13726 (x GLint)
13727 (y GLint)
13728 (width GLsizei)
13729 (height GLsizei)
13730 ->
13731 void))
3c9b6116
AW
13732 "Define the scissor box.
13733
13734X
13735 Y
13736
13737 Specify the lower left corner of the scissor box. Initially (0, 0).
13738
13739WIDTH
13740 HEIGHT
13741
13742 Specify the width and height of the scissor box. When a GL context
13743 is first attached to a window, WIDTH and HEIGHT are set to the
13744 dimensions of that window.
8925f36f 13745
3c9b6116
AW
13746`glScissor' defines a rectangle, called the scissor box, in window
13747coordinates. The first two arguments, X and Y, specify the lower left
13748corner of the box. WIDTH and HEIGHT specify the width and height of the
13749box.
13750
13751To enable and disable the scissor test, call `glEnable' and `glDisable'
13752with argument `GL_SCISSOR_TEST'. The test is initially disabled. While
13753the test is enabled, only pixels that lie within the scissor box can be
13754modified by drawing commands. Window coordinates have integer values at
13755the shared corners of frame buffer pixels. `glScissor(0,0,1,1)' allows
13756modification of only the lower left pixel in the window, and
13757`glScissor(0,0,0,0)' doesn't allow modification of any pixels in the
13758window.
13759
13760When the scissor test is disabled, it is as though the scissor box
13761includes the entire window.
13762
13763`GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
13764
13765`GL_INVALID_OPERATION' is generated if `glScissor' is executed between
13766the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 13767
7ec693ed 13768(define-foreign-procedure
bb894c9d
AW
13769 ((glSecondaryColorPointer
13770 (size GLint)
13771 (type GLenum)
13772 (stride GLsizei)
13773 (pointer *)
13774 ->
13775 void))
3c9b6116 13776 "Define an array of secondary colors.
8925f36f 13777
3c9b6116
AW
13778SIZE
13779 Specifies the number of components per color. Must be 3.
13780
13781TYPE
13782 Specifies the data type of each color component in the array.
13783 Symbolic constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
13784 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', or
13785 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
13786
13787STRIDE
13788 Specifies the byte offset between consecutive colors. If STRIDE is
13789 0, the colors are understood to be tightly packed in the array. The
13790 initial value is 0.
13791
13792POINTER
13793 Specifies a pointer to the first component of the first color
13794 element in the array. The initial value is 0.
13795
13796`glSecondaryColorPointer' specifies the location and data format of an
13797array of color components to use when rendering. SIZE specifies the
13798number of components per color, and must be 3. TYPE specifies the data
13799type of each color component, and STRIDE specifies the byte stride from
13800one color to the next, allowing vertices and attributes to be packed
13801into a single array or stored in separate arrays.
13802
13803If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
13804target (see `glBindBuffer') while a secondary color array is specified,
13805POINTER is treated as a byte offset into the buffer object's data store.
13806Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
13807secondary color vertex array client-side state
13808(`GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING').
13809
13810When a secondary color array is specified, SIZE, TYPE, STRIDE, and
13811POINTER are saved as client-side state, in addition to the current
13812vertex array buffer object binding.
13813
13814To enable and disable the secondary color array, call
13815`glEnableClientState' and `glDisableClientState' with the argument
13816`GL_SECONDARY_COLOR_ARRAY'. If enabled, the secondary color array is
13817used when `glArrayElement', `glDrawArrays', `glMultiDrawArrays',
13818`glDrawElements', `glMultiDrawElements', or `glDrawRangeElements' is
13819called.
13820
13821`GL_INVALID_VALUE' is generated if SIZE is not 3.
13822
13823`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
13824
13825`GL_INVALID_VALUE' is generated if STRIDE is negative.")
8925f36f 13826
7ec693ed 13827(define-foreign-procedure
bb894c9d
AW
13828 ((glSecondaryColor3i
13829 (red GLint)
13830 (green GLint)
13831 (blue GLint)
13832 ->
13833 void)
13834 (glSecondaryColor3d
13835 (red GLdouble)
13836 (green GLdouble)
13837 (blue GLdouble)
13838 ->
13839 void)
13840 (glSecondaryColor3ui
13841 (red GLuint)
13842 (green GLuint)
13843 (blue GLuint)
13844 ->
13845 void))
3c9b6116
AW
13846 "Set the current secondary color.
13847
13848RED
13849 GREEN
13850
13851 BLUE
13852
13853 Specify new red, green, and blue values for the current secondary
13854 color.
13855
13856The GL stores both a primary four-valued RGBA color and a secondary
13857four-valued RGBA color (where alpha is always set to 0.0) that is
13858associated with every vertex.
13859
13860The secondary color is interpolated and applied to each fragment during
13861rasterization when `GL_COLOR_SUM' is enabled. When lighting is enabled,
13862and `GL_SEPARATE_SPECULAR_COLOR' is specified, the value of the
13863secondary color is assigned the value computed from the specular term of
13864the lighting computation. Both the primary and secondary current colors
13865are applied to each fragment, regardless of the state of `GL_COLOR_SUM',
13866under such conditions. When `GL_SEPARATE_SPECULAR_COLOR' is specified,
13867the value returned from querying the current secondary color is
13868undefined.
13869
13870`glSecondaryColor3b', `glSecondaryColor3s', and `glSecondaryColor3i'
13871take three signed byte, short, or long integers as arguments. When *v*
13872is appended to the name, the color commands can take a pointer to an
13873array of such values.
13874
13875Color values are stored in floating-point format, with unspecified
13876mantissa and exponent sizes. Unsigned integer color components, when
13877specified, are linearly mapped to floating-point values such that the
13878largest representable value maps to 1.0 (full intensity), and 0 maps to
138790.0 (zero intensity). Signed integer color components, when specified,
13880are linearly mapped to floating-point values such that the most positive
13881representable value maps to 1.0, and the most negative representable
13882value maps to -1.0 . (Note that this mapping does not convert 0
13883precisely to 0.0). Floating-point values are mapped directly.
13884
13885Neither floating-point nor signed integer values are clamped to the
13886range [0,1] before the current color is updated. However, color
13887components are clamped to this range before they are interpolated or
13888written into a color buffer.")
8925f36f 13889
7ec693ed 13890(define-foreign-procedure
bb894c9d
AW
13891 ((glSelectBuffer
13892 (size GLsizei)
13893 (buffer *)
13894 ->
13895 void))
3c9b6116
AW
13896 "Establish a buffer for selection mode values.
13897
13898SIZE
13899 Specifies the size of BUFFER.
13900
13901BUFFER
13902 Returns the selection data.
13903
13904`glSelectBuffer' has two arguments: BUFFER is a pointer to an array of
13905unsigned integers, and SIZE indicates the size of the array. BUFFER
13906returns values from the name stack (see `glInitNames', `glLoadName',
13907`glPushName') when the rendering mode is `GL_SELECT' (see
13908`glRenderMode'). `glSelectBuffer' must be issued before selection mode
13909is enabled, and it must not be issued while the rendering mode is
13910`GL_SELECT'.
13911
13912A programmer can use selection to determine which primitives are drawn
13913into some region of a window. The region is defined by the current
13914modelview and perspective matrices.
13915
13916In selection mode, no pixel fragments are produced from rasterization.
13917Instead, if a primitive or a raster position intersects the clipping
13918volume defined by the viewing frustum and the user-defined clipping
13919planes, this primitive causes a selection hit. (With polygons, no hit
13920occurs if the polygon is culled.) When a change is made to the name
13921stack, or when `glRenderMode' is called, a hit record is copied to
13922BUFFER if any hits have occurred since the last such event (name stack
13923change or `glRenderMode' call). The hit record consists of the number of
13924names in the name stack at the time of the event, followed by the
13925minimum and maximum depth values of all vertices that hit since the
13926previous event, followed by the name stack contents, bottom name first.
13927
13928Depth values (which are in the range [0,1]) are multiplied by 2^32-1 ,
13929before being placed in the hit record.
13930
13931An internal index into BUFFER is reset to 0 whenever selection mode is
13932entered. Each time a hit record is copied into BUFFER, the index is
13933incremented to point to the cell just past the end of the block of
13934names\\(emthat is, to the next available cell If the hit record is larger
13935than the number of remaining locations in BUFFER, as much data as can
13936fit is copied, and the overflow flag is set. If the name stack is empty
13937when a hit record is copied, that record consists of 0 followed by the
13938minimum and maximum depth values.
13939
13940To exit selection mode, call `glRenderMode' with an argument other than
13941`GL_SELECT'. Whenever `glRenderMode' is called while the render mode is
13942`GL_SELECT', it returns the number of hit records copied to BUFFER,
13943resets the overflow flag and the selection buffer pointer, and
13944initializes the name stack to be empty. If the overflow bit was set when
13945`glRenderMode' was called, a negative hit record count is returned.
13946
13947`GL_INVALID_VALUE' is generated if SIZE is negative.
13948
13949`GL_INVALID_OPERATION' is generated if `glSelectBuffer' is called while
13950the render mode is `GL_SELECT', or if `glRenderMode' is called with
13951argument `GL_SELECT' before `glSelectBuffer' is called at least once.
13952
13953`GL_INVALID_OPERATION' is generated if `glSelectBuffer' is executed
13954between the execution of `glBegin' and the corresponding execution of
13955`glEnd'.")
8925f36f 13956
7ec693ed 13957(define-foreign-procedure
bb894c9d
AW
13958 ((glSeparableFilter2D
13959 (target GLenum)
13960 (internalformat GLenum)
13961 (width GLsizei)
13962 (height GLsizei)
13963 (format GLenum)
13964 (type GLenum)
13965 (row *)
13966 (column *)
13967 ->
13968 void))
3c9b6116 13969 "Define a separable two-dimensional convolution filter.
8925f36f 13970
3c9b6116
AW
13971TARGET
13972 Must be `GL_SEPARABLE_2D'.
13973
13974INTERNALFORMAT
13975 The internal format of the convolution filter kernel. The allowable
13976 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
13977 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
13978 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
13979 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
13980 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
13981 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
13982 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
13983 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
13984 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
13985 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
13986 `GL_RGBA12', or `GL_RGBA16'.
13987
13988WIDTH
13989 The number of elements in the pixel array referenced by ROW. (This
13990 is the width of the separable filter kernel.)
13991
13992HEIGHT
13993 The number of elements in the pixel array referenced by COLUMN.
13994 (This is the height of the separable filter kernel.)
13995
13996FORMAT
13997 The format of the pixel data in ROW and COLUMN. The allowable
13998 values are `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB',
13999 `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_INTENSITY', `GL_LUMINANCE', and
14000 `GL_LUMINANCE_ALPHA'.
14001
14002TYPE
14003 The type of the pixel data in ROW and COLUMN. Symbolic constants
14004 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
14005 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
14006 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
14007 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
14008 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
14009 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
14010 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
14011 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
14012 are accepted.
14013
14014ROW
14015 Pointer to a one-dimensional array of pixel data that is processed
14016 to build the row filter kernel.
14017
14018COLUMN
14019 Pointer to a one-dimensional array of pixel data that is processed
14020 to build the column filter kernel.
14021
14022`glSeparableFilter2D' builds a two-dimensional separable convolution
14023filter kernel from two arrays of pixels.
14024
14025The pixel arrays specified by (WIDTH, FORMAT, TYPE, ROW) and (HEIGHT,
14026FORMAT, TYPE, COLUMN) are processed just as if they had been passed to
14027`glDrawPixels', but processing stops after the final expansion to RGBA
14028is completed.
14029
14030If a non-zero named buffer object is bound to the
14031`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution
14032filter is specified, ROW and COLUMN are treated as byte offsets into the
14033buffer object's data store.
14034
14035Next, the R, G, B, and A components of all pixels in both arrays are
14036scaled by the four separable 2D `GL_CONVOLUTION_FILTER_SCALE' parameters
14037and biased by the four separable 2D `GL_CONVOLUTION_FILTER_BIAS'
14038parameters. (The scale and bias parameters are set by
14039`glConvolutionParameter' using the `GL_SEPARABLE_2D' target and the
14040names `GL_CONVOLUTION_FILTER_SCALE' and `GL_CONVOLUTION_FILTER_BIAS'.
14041The parameters themselves are vectors of four values that are applied to
14042red, green, blue, and alpha, in that order.) The R, G, B, and A values
14043are not clamped to [0,1] at any time during this process.
14044
14045Each pixel is then converted to the internal format specified by
14046INTERNALFORMAT. This conversion simply maps the component values of the
14047pixel (R, G, B, and A) to the values included in the internal format
14048(red, green, blue, alpha, luminance, and intensity). The mapping is as
14049follows:
14050
14051*Internal Format*
14052 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
14053
14054`GL_LUMINANCE'
14055 , , , , R ,
14056
14057`GL_LUMINANCE_ALPHA'
14058 , , , A , R ,
14059
14060`GL_INTENSITY'
14061 , , , , , R
14062
14063`GL_RGB'
14064 R , G , B , , ,
14065
14066`GL_RGBA'
14067 R , G , B , A , ,
14068
14069The red, green, blue, alpha, luminance, and/or intensity components of
14070the resulting pixels are stored in floating-point rather than integer
14071format. They form two one-dimensional filter kernel images. The row
14072image is indexed by coordinate I starting at zero and increasing from
14073left to right. Each location in the row image is derived from element I
14074of ROW. The column image is indexed by coordinate J starting at zero and
14075increasing from bottom to top. Each location in the column image is
14076derived from element J of COLUMN.
14077
14078Note that after a convolution is performed, the resulting color
14079components are also scaled by their corresponding
14080`GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
14081corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
14082the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
14083set by `glPixelTransfer'.
14084
14085`GL_INVALID_ENUM' is generated if TARGET is not `GL_SEPARABLE_2D'.
14086
14087`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
14088allowable values.
14089
14090`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
14091values.
14092
14093`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
14094values.
14095
14096`GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
14097than the maximum supported value. This value may be queried with
14098`glGetConvolutionParameter' using target `GL_SEPARABLE_2D' and name
14099`GL_MAX_CONVOLUTION_WIDTH'.
14100
14101`GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater
14102than the maximum supported value. This value may be queried with
14103`glGetConvolutionParameter' using target `GL_SEPARABLE_2D' and name
14104`GL_MAX_CONVOLUTION_HEIGHT'.
14105
14106`GL_INVALID_OPERATION' is generated if HEIGHT is one of
14107`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
14108`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
14109is not `GL_RGB'.
14110
14111`GL_INVALID_OPERATION' is generated if HEIGHT is one of
14112`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
14113`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
14114`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
14115`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
14116FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
14117
14118`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
14119bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
14120data store is currently mapped.
14121
14122`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
14123bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
14124unpacked from the buffer object such that the memory reads required
14125would exceed the data store size.
14126
14127`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
14128bound to the `GL_PIXEL_UNPACK_BUFFER' target and ROW or COLUMN is not
14129evenly divisible into the number of bytes needed to store in memory a
14130datum indicated by TYPE.
14131
14132`GL_INVALID_OPERATION' is generated if `glSeparableFilter2D' is executed
14133between the execution of `glBegin' and the corresponding execution of
14134`glEnd'.")
8925f36f 14135
7ec693ed 14136(define-foreign-procedure
bb894c9d 14137 ((glShadeModel (mode GLenum) -> void))
3c9b6116
AW
14138 "Select flat or smooth shading.
14139
14140MODE
14141 Specifies a symbolic value representing a shading technique.
14142 Accepted values are `GL_FLAT' and `GL_SMOOTH'. The initial value is
14143 `GL_SMOOTH'.
14144
14145GL primitives can have either flat or smooth shading. Smooth shading,
14146the default, causes the computed colors of vertices to be interpolated
14147as the primitive is rasterized, typically assigning different colors to
14148each resulting pixel fragment. Flat shading selects the computed color
14149of just one vertex and assigns it to all the pixel fragments generated
14150by rasterizing a single primitive. In either case, the computed color of
14151a vertex is the result of lighting if lighting is enabled, or it is the
14152current color at the time the vertex was specified if lighting is
14153disabled.
14154
14155Flat and smooth shading are indistinguishable for points. Starting when
14156`glBegin' is issued and counting vertices and primitives from 1, the GL
14157gives each flat-shaded line segment I the computed color of vertex I+1 ,
14158its second vertex. Counting similarly from 1, the GL gives each
14159flat-shaded polygon the computed color of the vertex listed in the
14160following table. This is the last vertex to specify the polygon in all
14161cases except single polygons, where the first vertex specifies the
14162flat-shaded color.
14163
14164
14165
14166* Primitive Type of Polygon I *
14167 *Vertex*
14168
14169Single polygon (I==1 )
14170 1
14171
14172Triangle strip
14173 I+2
14174
14175Triangle fan
14176 I+2
14177
14178Independent triangle
14179 3\u2062I
14180
14181Quad strip
14182 2\u2062I+2
14183
14184Independent quad
14185 4\u2062I
14186
14187Flat and smooth shading are specified by `glShadeModel' with MODE set to
14188`GL_FLAT' and `GL_SMOOTH', respectively.
14189
14190`GL_INVALID_ENUM' is generated if MODE is any value other than `GL_FLAT'
14191or `GL_SMOOTH'.
14192
14193`GL_INVALID_OPERATION' is generated if `glShadeModel' is executed
14194between the execution of `glBegin' and the corresponding execution of
14195`glEnd'.")
8925f36f 14196
7ec693ed 14197(define-foreign-procedure
bb894c9d
AW
14198 ((glShaderSource
14199 (shader GLuint)
14200 (count GLsizei)
14201 (string *)
14202 (length *)
14203 ->
14204 void))
3c9b6116
AW
14205 "Replaces the source code in a shader object.
14206
14207SHADER
14208 Specifies the handle of the shader object whose source code is to
14209 be replaced.
14210
14211COUNT
14212 Specifies the number of elements in the STRING and LENGTH arrays.
14213
14214STRING
14215 Specifies an array of pointers to strings containing the source
14216 code to be loaded into the shader.
14217
14218LENGTH
14219 Specifies an array of string lengths.
14220
14221`glShaderSource' sets the source code in SHADER to the source code in
14222the array of strings specified by STRING. Any source code previously
14223stored in the shader object is completely replaced. The number of
14224strings in the array is specified by COUNT. If LENGTH is `NULL', each
14225string is assumed to be null terminated. If LENGTH is a value other than
14226`NULL', it points to an array containing a string length for each of the
14227corresponding elements of STRING. Each element in the LENGTH array may
14228contain the length of the corresponding string (the null character is
14229not counted as part of the string length) or a value less than 0 to
14230indicate that the string is null terminated. The source code strings are
14231not scanned or parsed at this time; they are simply copied into the
14232specified shader object.
14233
14234`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
14235OpenGL.
14236
14237`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
14238
14239`GL_INVALID_VALUE' is generated if COUNT is less than 0.
14240
14241`GL_INVALID_OPERATION' is generated if `glShaderSource' is executed
14242between the execution of `glBegin' and the corresponding execution of
14243`glEnd'.")
8925f36f 14244
7ec693ed 14245(define-foreign-procedure
bb894c9d
AW
14246 ((glStencilFuncSeparate
14247 (face GLenum)
14248 (func GLenum)
14249 (ref GLint)
14250 (mask GLuint)
14251 ->
14252 void))
3c9b6116
AW
14253 "Set front and/or back function and reference value for stencil testing.
14254
14255FACE
14256 Specifies whether front and/or back stencil state is updated. Three
14257 symbolic constants are valid: `GL_FRONT', `GL_BACK', and
14258 `GL_FRONT_AND_BACK'.
14259
14260FUNC
14261 Specifies the test function. Eight symbolic constants are valid:
14262 `GL_NEVER', `GL_LESS', `GL_LEQUAL', `GL_GREATER', `GL_GEQUAL',
14263 `GL_EQUAL', `GL_NOTEQUAL', and `GL_ALWAYS'. The initial value is
14264 `GL_ALWAYS'.
14265
14266REF
14267 Specifies the reference value for the stencil test. REF is clamped
14268 to the range [0,2^N-1] , where N is the number of bitplanes in the
14269 stencil buffer. The initial value is 0.
14270
14271MASK
14272 Specifies a mask that is ANDed with both the reference value and
14273 the stored stencil value when the test is done. The initial value
14274 is all 1's.
14275
14276Stenciling, like depth-buffering, enables and disables drawing on a
14277per-pixel basis. You draw into the stencil planes using GL drawing
14278primitives, then render geometry and images, using the stencil planes to
14279mask out portions of the screen. Stenciling is typically used in
14280multipass rendering algorithms to achieve special effects, such as
14281decals, outlining, and constructive solid geometry rendering.
14282
14283The stencil test conditionally eliminates a pixel based on the outcome
14284of a comparison between the reference value and the value in the stencil
14285buffer. To enable and disable the test, call `glEnable' and `glDisable'
14286with argument `GL_STENCIL_TEST'. To specify actions based on the outcome
14287of the stencil test, call `glStencilOp' or `glStencilOpSeparate'.
14288
14289There can be two separate sets of FUNC, REF, and MASK parameters; one
14290affects back-facing polygons, and the other affects front-facing
14291polygons as well as other non-polygon primitives. `glStencilFunc' sets
14292both front and back stencil state to the same values, as if
14293`glStencilFuncSeparate' were called with FACE set to
14294`GL_FRONT_AND_BACK'.
14295
14296FUNC is a symbolic constant that determines the stencil comparison
14297function. It accepts one of eight values, shown in the following list.
14298REF is an integer reference value that is used in the stencil
14299comparison. It is clamped to the range [0,2^N-1] , where N is the number
14300of bitplanes in the stencil buffer. MASK is bitwise ANDed with both the
14301reference value and the stored stencil value, with the ANDed values
14302participating in the comparison.
14303
14304If STENCIL represents the value stored in the corresponding stencil
14305buffer location, the following list shows the effect of each comparison
14306function that can be specified by FUNC. Only if the comparison succeeds
14307is the pixel passed through to the next stage in the rasterization
14308process (see `glStencilOp'). All tests treat STENCIL values as unsigned
14309integers in the range [0,2^N-1] , where N is the number of bitplanes in
14310the stencil buffer.
14311
14312The following values are accepted by FUNC:
14313
14314`GL_NEVER'
14315 Always fails.
14316
14317`GL_LESS'
14318 Passes if ( REF & MASK ) < ( STENCIL & MASK ).
14319
14320`GL_LEQUAL'
14321 Passes if ( REF & MASK ) <= ( STENCIL & MASK ).
14322
14323`GL_GREATER'
14324 Passes if ( REF & MASK ) > ( STENCIL & MASK ).
14325
14326`GL_GEQUAL'
14327 Passes if ( REF & MASK ) >= ( STENCIL & MASK ).
14328
14329`GL_EQUAL'
14330 Passes if ( REF & MASK ) = ( STENCIL & MASK ).
14331
14332`GL_NOTEQUAL'
14333 Passes if ( REF & MASK ) != ( STENCIL & MASK ).
14334
14335`GL_ALWAYS'
14336 Always passes.
14337
14338`GL_INVALID_ENUM' is generated if FUNC is not one of the eight accepted
14339values.
14340
14341`GL_INVALID_OPERATION' is generated if `glStencilFuncSeparate' is
14342executed between the execution of `glBegin' and the corresponding
14343execution of `glEnd'.")
8925f36f 14344
7ec693ed 14345(define-foreign-procedure
bb894c9d
AW
14346 ((glStencilFunc
14347 (func GLenum)
14348 (ref GLint)
14349 (mask GLuint)
14350 ->
14351 void))
3c9b6116
AW
14352 "Set front and back function and reference value for stencil testing.
14353
14354FUNC
14355 Specifies the test function. Eight symbolic constants are valid:
14356 `GL_NEVER', `GL_LESS', `GL_LEQUAL', `GL_GREATER', `GL_GEQUAL',
14357 `GL_EQUAL', `GL_NOTEQUAL', and `GL_ALWAYS'. The initial value is
14358 `GL_ALWAYS'.
14359
14360REF
14361 Specifies the reference value for the stencil test. REF is clamped
14362 to the range [0,2^N-1] , where N is the number of bitplanes in the
14363 stencil buffer. The initial value is 0.
14364
14365MASK
14366 Specifies a mask that is ANDed with both the reference value and
14367 the stored stencil value when the test is done. The initial value
14368 is all 1's.
14369
14370Stenciling, like depth-buffering, enables and disables drawing on a
14371per-pixel basis. Stencil planes are first drawn into using GL drawing
14372primitives, then geometry and images are rendered using the stencil
14373planes to mask out portions of the screen. Stenciling is typically used
14374in multipass rendering algorithms to achieve special effects, such as
14375decals, outlining, and constructive solid geometry rendering.
14376
14377The stencil test conditionally eliminates a pixel based on the outcome
14378of a comparison between the reference value and the value in the stencil
14379buffer. To enable and disable the test, call `glEnable' and `glDisable'
14380with argument `GL_STENCIL_TEST'. To specify actions based on the outcome
14381of the stencil test, call `glStencilOp' or `glStencilOpSeparate'.
14382
14383There can be two separate sets of FUNC, REF, and MASK parameters; one
14384affects back-facing polygons, and the other affects front-facing
14385polygons as well as other non-polygon primitives. `glStencilFunc' sets
14386both front and back stencil state to the same values. Use
14387`glStencilFuncSeparate' to set front and back stencil state to different
14388values.
14389
14390FUNC is a symbolic constant that determines the stencil comparison
14391function. It accepts one of eight values, shown in the following list.
14392REF is an integer reference value that is used in the stencil
14393comparison. It is clamped to the range [0,2^N-1] , where N is the number
14394of bitplanes in the stencil buffer. MASK is bitwise ANDed with both the
14395reference value and the stored stencil value, with the ANDed values
14396participating in the comparison.
14397
14398If STENCIL represents the value stored in the corresponding stencil
14399buffer location, the following list shows the effect of each comparison
14400function that can be specified by FUNC. Only if the comparison succeeds
14401is the pixel passed through to the next stage in the rasterization
14402process (see `glStencilOp'). All tests treat STENCIL values as unsigned
14403integers in the range [0,2^N-1] , where N is the number of bitplanes in
14404the stencil buffer.
14405
14406The following values are accepted by FUNC:
14407
14408`GL_NEVER'
14409 Always fails.
14410
14411`GL_LESS'
14412 Passes if ( REF & MASK ) < ( STENCIL & MASK ).
14413
14414`GL_LEQUAL'
14415 Passes if ( REF & MASK ) <= ( STENCIL & MASK ).
14416
14417`GL_GREATER'
14418 Passes if ( REF & MASK ) > ( STENCIL & MASK ).
14419
14420`GL_GEQUAL'
14421 Passes if ( REF & MASK ) >= ( STENCIL & MASK ).
14422
14423`GL_EQUAL'
14424 Passes if ( REF & MASK ) = ( STENCIL & MASK ).
14425
14426`GL_NOTEQUAL'
14427 Passes if ( REF & MASK ) != ( STENCIL & MASK ).
14428
14429`GL_ALWAYS'
14430 Always passes.
14431
14432`GL_INVALID_ENUM' is generated if FUNC is not one of the eight accepted
14433values.
14434
14435`GL_INVALID_OPERATION' is generated if `glStencilFunc' is executed
14436between the execution of `glBegin' and the corresponding execution of
14437`glEnd'.")
8925f36f 14438
7ec693ed 14439(define-foreign-procedure
bb894c9d
AW
14440 ((glStencilMaskSeparate
14441 (face GLenum)
14442 (mask GLuint)
14443 ->
14444 void))
3c9b6116
AW
14445 "Control the front and/or back writing of individual bits in the stencil
14446planes.
14447
14448FACE
14449 Specifies whether the front and/or back stencil writemask is
14450 updated. Three symbolic constants are valid: `GL_FRONT', `GL_BACK',
14451 and `GL_FRONT_AND_BACK'.
14452
14453MASK
14454 Specifies a bit mask to enable and disable writing of individual
14455 bits in the stencil planes. Initially, the mask is all 1's.
14456
14457`glStencilMaskSeparate' controls the writing of individual bits in the
14458stencil planes. The least significant N bits of MASK, where N is the
14459number of bits in the stencil buffer, specify a mask. Where a 1 appears
14460in the mask, it's possible to write to the corresponding bit in the
14461stencil buffer. Where a 0 appears, the corresponding bit is
14462write-protected. Initially, all bits are enabled for writing.
14463
14464There can be two separate MASK writemasks; one affects back-facing
14465polygons, and the other affects front-facing polygons as well as other
14466non-polygon primitives. `glStencilMask' sets both front and back stencil
14467writemasks to the same values, as if `glStencilMaskSeparate' were called
14468with FACE set to `GL_FRONT_AND_BACK'.
14469
14470`GL_INVALID_OPERATION' is generated if `glStencilMaskSeparate' is
14471executed between the execution of `glBegin' and the corresponding
14472execution of `glEnd'.")
8925f36f 14473
7ec693ed 14474(define-foreign-procedure
bb894c9d 14475 ((glStencilMask (mask GLuint) -> void))
3c9b6116
AW
14476 "Control the front and back writing of individual bits in the stencil
14477planes.
14478
14479MASK
14480 Specifies a bit mask to enable and disable writing of individual
14481 bits in the stencil planes. Initially, the mask is all 1's.
14482
14483`glStencilMask' controls the writing of individual bits in the stencil
14484planes. The least significant N bits of MASK, where N is the number of
14485bits in the stencil buffer, specify a mask. Where a 1 appears in the
14486mask, it's possible to write to the corresponding bit in the stencil
14487buffer. Where a 0 appears, the corresponding bit is write-protected.
14488Initially, all bits are enabled for writing.
14489
14490There can be two separate MASK writemasks; one affects back-facing
14491polygons, and the other affects front-facing polygons as well as other
14492non-polygon primitives. `glStencilMask' sets both front and back stencil
14493writemasks to the same values. Use `glStencilMaskSeparate' to set front
14494and back stencil writemasks to different values.
14495
14496`GL_INVALID_OPERATION' is generated if `glStencilMask' is executed
14497between the execution of `glBegin' and the corresponding execution of
14498`glEnd'.")
8925f36f 14499
7ec693ed 14500(define-foreign-procedure
bb894c9d
AW
14501 ((glStencilOpSeparate
14502 (face GLenum)
14503 (sfail GLenum)
14504 (dpfail GLenum)
14505 (dppass GLenum)
14506 ->
14507 void))
3c9b6116
AW
14508 "Set front and/or back stencil test actions.
14509
14510FACE
14511 Specifies whether front and/or back stencil state is updated. Three
14512 symbolic constants are valid: `GL_FRONT', `GL_BACK', and
14513 `GL_FRONT_AND_BACK'.
14514
14515SFAIL
14516 Specifies the action to take when the stencil test fails. Eight
14517 symbolic constants are accepted: `GL_KEEP', `GL_ZERO',
14518 `GL_REPLACE', `GL_INCR', `GL_INCR_WRAP', `GL_DECR', `GL_DECR_WRAP',
14519 and `GL_INVERT'. The initial value is `GL_KEEP'.
14520
14521DPFAIL
14522 Specifies the stencil action when the stencil test passes, but the
14523 depth test fails. DPFAIL accepts the same symbolic constants as
14524 SFAIL. The initial value is `GL_KEEP'.
14525
14526DPPASS
14527 Specifies the stencil action when both the stencil test and the
14528 depth test pass, or when the stencil test passes and either there
14529 is no depth buffer or depth testing is not enabled. DPPASS accepts
14530 the same symbolic constants as SFAIL. The initial value is
14531 `GL_KEEP'.
14532
14533Stenciling, like depth-buffering, enables and disables drawing on a
14534per-pixel basis. You draw into the stencil planes using GL drawing
14535primitives, then render geometry and images, using the stencil planes to
14536mask out portions of the screen. Stenciling is typically used in
14537multipass rendering algorithms to achieve special effects, such as
14538decals, outlining, and constructive solid geometry rendering.
14539
14540The stencil test conditionally eliminates a pixel based on the outcome
14541of a comparison between the value in the stencil buffer and a reference
14542value. To enable and disable the test, call `glEnable' and `glDisable'
14543with argument `GL_STENCIL_TEST'; to control it, call `glStencilFunc' or
14544`glStencilFuncSeparate'.
14545
14546There can be two separate sets of SFAIL, DPFAIL, and DPPASS parameters;
14547one affects back-facing polygons, and the other affects front-facing
14548polygons as well as other non-polygon primitives. `glStencilOp' sets
14549both front and back stencil state to the same values, as if
14550`glStencilOpSeparate' were called with FACE set to `GL_FRONT_AND_BACK'.
14551
14552`glStencilOpSeparate' takes three arguments that indicate what happens
14553to the stored stencil value while stenciling is enabled. If the stencil
14554test fails, no change is made to the pixel's color or depth buffers, and
14555SFAIL specifies what happens to the stencil buffer contents. The
14556following eight actions are possible.
14557
14558`GL_KEEP'
14559 Keeps the current value.
14560
14561`GL_ZERO'
14562 Sets the stencil buffer value to 0.
14563
14564`GL_REPLACE'
14565 Sets the stencil buffer value to REF, as specified by
14566 `glStencilFunc'.
14567
14568`GL_INCR'
14569 Increments the current stencil buffer value. Clamps to the maximum
14570 representable unsigned value.
14571
14572`GL_INCR_WRAP'
14573 Increments the current stencil buffer value. Wraps stencil buffer
14574 value to zero when incrementing the maximum representable unsigned
14575 value.
14576
14577`GL_DECR'
14578 Decrements the current stencil buffer value. Clamps to 0.
14579
14580`GL_DECR_WRAP'
14581 Decrements the current stencil buffer value. Wraps stencil buffer
14582 value to the maximum representable unsigned value when decrementing
14583 a stencil buffer value of zero.
14584
14585`GL_INVERT'
14586 Bitwise inverts the current stencil buffer value.
14587
14588Stencil buffer values are treated as unsigned integers. When incremented
14589and decremented, values are clamped to 0 and 2^N-1 , where N is the
14590value returned by querying `GL_STENCIL_BITS'.
14591
14592The other two arguments to `glStencilOpSeparate' specify stencil buffer
14593actions that depend on whether subsequent depth buffer tests succeed
14594(DPPASS) or fail (DPFAIL) (see `glDepthFunc'). The actions are specified
14595using the same eight symbolic constants as SFAIL. Note that DPFAIL is
14596ignored when there is no depth buffer, or when the depth buffer is not
14597enabled. In these cases, SFAIL and DPPASS specify stencil action when
14598the stencil test fails and passes, respectively.
14599
14600`GL_INVALID_ENUM' is generated if FACE is any value other than
14601`GL_FRONT', `GL_BACK', or `GL_FRONT_AND_BACK'.
14602
14603`GL_INVALID_ENUM' is generated if SFAIL, DPFAIL, or DPPASS is any value
14604other than the eight defined constant values.
14605
14606`GL_INVALID_OPERATION' is generated if `glStencilOpSeparate' is executed
14607between the execution of `glBegin' and the corresponding execution of
14608`glEnd'.")
8925f36f 14609
7ec693ed 14610(define-foreign-procedure
bb894c9d
AW
14611 ((glStencilOp
14612 (sfail GLenum)
14613 (dpfail GLenum)
14614 (dppass GLenum)
14615 ->
14616 void))
3c9b6116
AW
14617 "Set front and back stencil test actions.
14618
14619SFAIL
14620 Specifies the action to take when the stencil test fails. Eight
14621 symbolic constants are accepted: `GL_KEEP', `GL_ZERO',
14622 `GL_REPLACE', `GL_INCR', `GL_INCR_WRAP', `GL_DECR', `GL_DECR_WRAP',
14623 and `GL_INVERT'. The initial value is `GL_KEEP'.
14624
14625DPFAIL
14626 Specifies the stencil action when the stencil test passes, but the
14627 depth test fails. DPFAIL accepts the same symbolic constants as
14628 SFAIL. The initial value is `GL_KEEP'.
14629
14630DPPASS
14631 Specifies the stencil action when both the stencil test and the
14632 depth test pass, or when the stencil test passes and either there
14633 is no depth buffer or depth testing is not enabled. DPPASS accepts
14634 the same symbolic constants as SFAIL. The initial value is
14635 `GL_KEEP'.
14636
14637Stenciling, like depth-buffering, enables and disables drawing on a
14638per-pixel basis. You draw into the stencil planes using GL drawing
14639primitives, then render geometry and images, using the stencil planes to
14640mask out portions of the screen. Stenciling is typically used in
14641multipass rendering algorithms to achieve special effects, such as
14642decals, outlining, and constructive solid geometry rendering.
14643
14644The stencil test conditionally eliminates a pixel based on the outcome
14645of a comparison between the value in the stencil buffer and a reference
14646value. To enable and disable the test, call `glEnable' and `glDisable'
14647with argument `GL_STENCIL_TEST'; to control it, call `glStencilFunc' or
14648`glStencilFuncSeparate'.
14649
14650There can be two separate sets of SFAIL, DPFAIL, and DPPASS parameters;
14651one affects back-facing polygons, and the other affects front-facing
14652polygons as well as other non-polygon primitives. `glStencilOp' sets
14653both front and back stencil state to the same values. Use
14654`glStencilOpSeparate' to set front and back stencil state to different
14655values.
14656
14657`glStencilOp' takes three arguments that indicate what happens to the
14658stored stencil value while stenciling is enabled. If the stencil test
14659fails, no change is made to the pixel's color or depth buffers, and
14660SFAIL specifies what happens to the stencil buffer contents. The
14661following eight actions are possible.
14662
14663`GL_KEEP'
14664 Keeps the current value.
14665
14666`GL_ZERO'
14667 Sets the stencil buffer value to 0.
14668
14669`GL_REPLACE'
14670 Sets the stencil buffer value to REF, as specified by
14671 `glStencilFunc'.
14672
14673`GL_INCR'
14674 Increments the current stencil buffer value. Clamps to the maximum
14675 representable unsigned value.
14676
14677`GL_INCR_WRAP'
14678 Increments the current stencil buffer value. Wraps stencil buffer
14679 value to zero when incrementing the maximum representable unsigned
14680 value.
14681
14682`GL_DECR'
14683 Decrements the current stencil buffer value. Clamps to 0.
14684
14685`GL_DECR_WRAP'
14686 Decrements the current stencil buffer value. Wraps stencil buffer
14687 value to the maximum representable unsigned value when decrementing
14688 a stencil buffer value of zero.
14689
14690`GL_INVERT'
14691 Bitwise inverts the current stencil buffer value.
14692
14693Stencil buffer values are treated as unsigned integers. When incremented
14694and decremented, values are clamped to 0 and 2^N-1 , where N is the
14695value returned by querying `GL_STENCIL_BITS'.
14696
14697The other two arguments to `glStencilOp' specify stencil buffer actions
14698that depend on whether subsequent depth buffer tests succeed (DPPASS) or
14699fail (DPFAIL) (see `glDepthFunc'). The actions are specified using the
14700same eight symbolic constants as SFAIL. Note that DPFAIL is ignored when
14701there is no depth buffer, or when the depth buffer is not enabled. In
14702these cases, SFAIL and DPPASS specify stencil action when the stencil
14703test fails and passes, respectively.
14704
14705`GL_INVALID_ENUM' is generated if SFAIL, DPFAIL, or DPPASS is any value
14706other than the eight defined constant values.
14707
14708`GL_INVALID_OPERATION' is generated if `glStencilOp' is executed between
14709the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 14710
7ec693ed 14711(define-foreign-procedure
bb894c9d
AW
14712 ((glTexCoordPointer
14713 (size GLint)
14714 (type GLenum)
14715 (stride GLsizei)
14716 (pointer *)
14717 ->
14718 void))
3c9b6116
AW
14719 "Define an array of texture coordinates.
14720
14721SIZE
14722 Specifies the number of coordinates per array element. Must be 1,
14723 2, 3, or 4. The initial value is 4.
14724
14725TYPE
14726 Specifies the data type of each texture coordinate. Symbolic
14727 constants `GL_SHORT', `GL_INT', `GL_FLOAT', or `GL_DOUBLE' are
14728 accepted. The initial value is `GL_FLOAT'.
14729
14730STRIDE
14731 Specifies the byte offset between consecutive texture coordinate
14732 sets. If STRIDE is 0, the array elements are understood to be
14733 tightly packed. The initial value is 0.
14734
14735POINTER
14736 Specifies a pointer to the first coordinate of the first texture
14737 coordinate set in the array. The initial value is 0.
14738
14739`glTexCoordPointer' specifies the location and data format of an array
14740of texture coordinates to use when rendering. SIZE specifies the number
14741of coordinates per texture coordinate set, and must be 1, 2, 3, or 4.
14742TYPE specifies the data type of each texture coordinate, and STRIDE
14743specifies the byte stride from one texture coordinate set to the next,
14744allowing vertices and attributes to be packed into a single array or
14745stored in separate arrays. (Single-array storage may be more efficient
14746on some implementations; see `glInterleavedArrays'.)
14747
14748If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
14749target (see `glBindBuffer') while a texture coordinate array is
14750specified, POINTER is treated as a byte offset into the buffer object's
14751data store. Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING')
14752is saved as texture coordinate vertex array client-side state
14753(`GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING').
14754
14755When a texture coordinate array is specified, SIZE, TYPE, STRIDE, and
14756POINTER are saved as client-side state, in addition to the current
14757vertex array buffer object binding.
14758
14759To enable and disable a texture coordinate array, call
14760`glEnableClientState' and `glDisableClientState' with the argument
14761`GL_TEXTURE_COORD_ARRAY'. If enabled, the texture coordinate array is
14762used when `glArrayElement', `glDrawArrays', `glMultiDrawArrays',
14763`glDrawElements', `glMultiDrawElements', or `glDrawRangeElements' is
14764called.
14765
14766`GL_INVALID_VALUE' is generated if SIZE is not 1, 2, 3, or 4.
14767
14768`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
14769
14770`GL_INVALID_VALUE' is generated if STRIDE is negative.")
8925f36f 14771
7ec693ed 14772(define-foreign-procedure
bb894c9d
AW
14773 ((glTexCoord1i (s GLint) -> void)
14774 (glTexCoord1d (s GLdouble) -> void)
14775 (glTexCoord2i (s GLint) (t GLint) -> void)
14776 (glTexCoord2d (s GLdouble) (t GLdouble) -> void)
14777 (glTexCoord3i
14778 (s GLint)
14779 (t GLint)
14780 (r GLint)
14781 ->
14782 void)
14783 (glTexCoord3d
14784 (s GLdouble)
14785 (t GLdouble)
14786 (r GLdouble)
14787 ->
14788 void)
14789 (glTexCoord4i
14790 (s GLint)
14791 (t GLint)
14792 (r GLint)
14793 (q GLint)
14794 ->
14795 void)
14796 (glTexCoord4d
14797 (s GLdouble)
14798 (t GLdouble)
14799 (r GLdouble)
14800 (q GLdouble)
14801 ->
14802 void))
3c9b6116
AW
14803 "Set the current texture coordinates.
14804
14805S
14806 T
14807
14808 R
14809
14810 Q
14811
14812 Specify S, T, R, and Q texture coordinates. Not all parameters are
14813 present in all forms of the command.
14814
14815`glTexCoord' specifies texture coordinates in one, two, three, or four
14816dimensions. `glTexCoord1' sets the current texture coordinates to
14817(S,001) ; a call to `glTexCoord2' sets them to (S,T01) . Similarly,
14818`glTexCoord3' specifies the texture coordinates as (S,TR1) , and
14819`glTexCoord4' defines all four components explicitly as (S,TRQ) .
14820
14821The current texture coordinates are part of the data that is associated
14822with each vertex and with the current raster position. Initially, the
14823values for S, T, R, and Q are (0, 0, 0, 1).")
8925f36f 14824
7ec693ed 14825(define-foreign-procedure
bb894c9d
AW
14826 ((glTexEnvf
14827 (target GLenum)
14828 (pname GLenum)
14829 (param GLfloat)
14830 ->
14831 void)
14832 (glTexEnvi
14833 (target GLenum)
14834 (pname GLenum)
14835 (param GLint)
14836 ->
14837 void))
3c9b6116
AW
14838 "Set texture environment parameters.
14839
14840TARGET
14841 Specifies a texture environment. May be `GL_TEXTURE_ENV',
14842 `GL_TEXTURE_FILTER_CONTROL' or `GL_POINT_SPRITE'.
14843
14844PNAME
14845 Specifies the symbolic name of a single-valued texture environment
14846 parameter. May be either `GL_TEXTURE_ENV_MODE',
14847 `GL_TEXTURE_LOD_BIAS', `GL_COMBINE_RGB', `GL_COMBINE_ALPHA',
14848 `GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
14849 `GL_SRC1_ALPHA', `GL_SRC2_ALPHA', `GL_OPERAND0_RGB',
14850 `GL_OPERAND1_RGB', `GL_OPERAND2_RGB', `GL_OPERAND0_ALPHA',
14851 `GL_OPERAND1_ALPHA', `GL_OPERAND2_ALPHA', `GL_RGB_SCALE',
14852 `GL_ALPHA_SCALE', or `GL_COORD_REPLACE'.
14853
14854PARAM
14855 Specifies a single symbolic constant, one of `GL_ADD',
14856 `GL_ADD_SIGNED', `GL_INTERPOLATE', `GL_MODULATE', `GL_DECAL',
14857 `GL_BLEND', `GL_REPLACE', `GL_SUBTRACT', `GL_COMBINE',
14858 `GL_TEXTURE', `GL_CONSTANT', `GL_PRIMARY_COLOR', `GL_PREVIOUS',
14859 `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR', `GL_SRC_ALPHA',
14860 `GL_ONE_MINUS_SRC_ALPHA', a single boolean value for the point
14861 sprite texture coordinate replacement, a single floating-point
14862 value for the texture level-of-detail bias, or 1.0, 2.0, or 4.0
14863 when specifying the `GL_RGB_SCALE' or `GL_ALPHA_SCALE'.
14864
14865A texture environment specifies how texture values are interpreted when
14866a fragment is textured. When TARGET is `GL_TEXTURE_FILTER_CONTROL',
14867PNAME must be `GL_TEXTURE_LOD_BIAS'. When TARGET is `GL_TEXTURE_ENV',
14868PNAME can be `GL_TEXTURE_ENV_MODE', `GL_TEXTURE_ENV_COLOR',
14869`GL_COMBINE_RGB', `GL_COMBINE_ALPHA', `GL_RGB_SCALE', `GL_ALPHA_SCALE',
14870`GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
14871`GL_SRC1_ALPHA', or `GL_SRC2_ALPHA'.
14872
14873If PNAME is `GL_TEXTURE_ENV_MODE', then PARAMS is (or points to) the
14874symbolic name of a texture function. Six texture functions may be
14875specified: `GL_ADD', `GL_MODULATE', `GL_DECAL', `GL_BLEND',
14876`GL_REPLACE', or `GL_COMBINE'.
14877
14878The following table shows the correspondence of filtered texture values
14879R_T , G_T , B_T , A_T , L_T , I_T to texture source components. C_S and
14880A_S are used by the texture functions described below.
14881
14882
14883
14884Texture Base Internal Format
14885 `C'_S , `A'_S
14886
14887`GL_ALPHA'
14888 (0, 0, 0) , A_T
14889
14890`GL_LUMINANCE'
14891 ( L_T , L_T , L_T ) , 1
14892
14893`GL_LUMINANCE_ALPHA'
14894 ( L_T , L_T , L_T ) , A_T
14895
14896`GL_INTENSITY'
14897 ( I_T , I_T , I_T ) , I_T
14898
14899`GL_RGB'
14900 ( R_T , G_T , B_T ) , 1
14901
14902`GL_RGBA'
14903 ( R_T , G_T , B_T ) , A_T
14904
14905A texture function acts on the fragment to be textured using the texture
14906image value that applies to the fragment (see `glTexParameter') and
14907produces an RGBA color for that fragment. The following table shows how
14908the RGBA color is produced for each of the first five texture functions
14909that can be chosen. C is a triple of color values (RGB) and A is the
14910associated alpha value. RGBA values extracted from a texture image are
14911in the range [0,1]. The subscript P refers to the color computed from
14912the previous texture stage (or the incoming fragment if processing
14913texture stage 0), the subscript S to the texture source color, the
14914subscript C to the texture environment color, and the subscript V
14915indicates a value produced by the texture function.
14916
14917
14918
14919Texture Base Internal Format
14920 `Value', `GL_REPLACE' Function , `GL_MODULATE' Function ,
14921 `GL_DECAL' Function , `GL_BLEND' Function , `GL_ADD' Function
14922
14923`GL_ALPHA'
14924 C_V= , C_P , C_P , undefined , C_P , C_P
14925
14926
14927 A_V= , A_S , A_P\u2062A_S , , A_V=A_P\u2062A_S , A_P\u2062A_S
14928
14929`GL_LUMINANCE'
14930 C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
14931
14932(or 1)
14933 A_V= , A_P , A_P , , A_P , A_P
14934
14935`GL_LUMINANCE_ALPHA'
14936 C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
14937
14938(or 2)
14939 A_V= , A_S , A_P\u2062A_S , , A_P\u2062A_S , A_P\u2062A_S
14940
14941`GL_INTENSITY'
14942 C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
14943
14944
14945 A_V= , A_S , A_P\u2062A_S , , A_P\u2062(1-A_S,)+A_C\u2062A_S , A_P+A_S
14946
14947`GL_RGB'
14948 C_V= , C_S , C_P\u2062C_S , C_S , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
14949
14950(or 3)
14951 A_V= , A_P , A_P , A_P , A_P , A_P
14952
14953`GL_RGBA'
14954 C_V= , C_S , C_P\u2062C_S , C_P\u2062(1-A_S,)+C_S\u2062A_S , C_P\u2062(1-C_S,)+C_C\u2062C_S
14955 , C_P+C_S
14956
14957(or 4)
14958 A_V= , A_S , A_P\u2062A_S , A_P , A_P\u2062A_S , A_P\u2062A_S
14959
14960If PNAME is `GL_TEXTURE_ENV_MODE', and PARAMS is `GL_COMBINE', the form
14961of the texture function depends on the values of `GL_COMBINE_RGB' and
14962`GL_COMBINE_ALPHA'.
14963
14964The following describes how the texture sources, as specified by
14965`GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
14966`GL_SRC1_ALPHA', and `GL_SRC2_ALPHA', are combined to produce a final
14967texture color. In the following tables, `GL_SRC0_c' is represented by
14968ARG0 , `GL_SRC1_c' is represented by ARG1 , and `GL_SRC2_c' is
14969represented by ARG2 .
14970
14971`GL_COMBINE_RGB' accepts any of `GL_REPLACE', `GL_MODULATE', `GL_ADD',
14972`GL_ADD_SIGNED', `GL_INTERPOLATE', `GL_SUBTRACT', `GL_DOT3_RGB', or
14973`GL_DOT3_RGBA'.
14974
14975
14976
14977*`GL_COMBINE_RGB'*
14978 *Texture Function*
14979
14980`GL_REPLACE'
14981 ARG0
14982
14983`GL_MODULATE'
14984 ARG0×ARG1
14985
14986`GL_ADD'
14987 ARG0+ARG1
14988
14989`GL_ADD_SIGNED'
14990 ARG0+ARG1-0.5
14991
14992`GL_INTERPOLATE'
14993 ARG0×ARG2+ARG1×(1-ARG2,)
14994
14995`GL_SUBTRACT'
14996 ARG0-ARG1
14997
14998`GL_DOT3_RGB' or `GL_DOT3_RGBA'
14999 4×(((ARG0_R,-0.5,)×(ARG1_R,-0.5,),)+((ARG0_G,-0.5,)×(ARG1_G,-0.5,),
15000 )+((ARG0_B,-0.5,)×(ARG1_B,-0.5,),),)
15001
15002The scalar results for `GL_DOT3_RGB' and `GL_DOT3_RGBA' are placed into
15003each of the 3 (RGB) or 4 (RGBA) components on output.
15004
15005Likewise, `GL_COMBINE_ALPHA' accepts any of `GL_REPLACE', `GL_MODULATE',
15006`GL_ADD', `GL_ADD_SIGNED', `GL_INTERPOLATE', or `GL_SUBTRACT'. The
15007following table describes how alpha values are combined:
15008
15009
15010
15011*`GL_COMBINE_ALPHA'*
15012 *Texture Function*
15013
15014`GL_REPLACE'
15015 ARG0
15016
15017`GL_MODULATE'
15018 ARG0×ARG1
15019
15020`GL_ADD'
15021 ARG0+ARG1
15022
15023`GL_ADD_SIGNED'
15024 ARG0+ARG1-0.5
15025
15026`GL_INTERPOLATE'
15027 ARG0×ARG2+ARG1×(1-ARG2,)
15028
15029`GL_SUBTRACT'
15030 ARG0-ARG1
15031
15032In the following tables, the value C_S represents the color sampled from
15033the currently bound texture, C_C represents the constant
15034texture-environment color, C_F represents the primary color of the
15035incoming fragment, and C_P represents the color computed from the
15036previous texture stage or C_F if processing texture stage 0. Likewise,
15037A_S , A_C , A_F , and A_P represent the respective alpha values.
15038
15039The following table describes the values assigned to ARG0 , ARG1 , and
15040ARG2 based upon the RGB sources and operands:
15041
15042
15043
15044*`GL_SRCn_RGB'*
15045 *`GL_OPERANDn_RGB'*, *Argument Value*
15046
15047`GL_TEXTURE'
15048 `GL_SRC_COLOR', C_S,
15049
15050
15051 `GL_ONE_MINUS_SRC_COLOR', 1-C_S,
15052
15053
15054 `GL_SRC_ALPHA', A_S,
15055
15056
15057 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
15058
15059`GL_TEXTUREn'
15060 `GL_SRC_COLOR', C_S,
15061
15062
15063 `GL_ONE_MINUS_SRC_COLOR', 1-C_S,
15064
15065
15066 `GL_SRC_ALPHA', A_S,
15067
15068
15069 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
15070
15071`GL_CONSTANT'
15072 `GL_SRC_COLOR', C_C,
15073
15074
15075 `GL_ONE_MINUS_SRC_COLOR', 1-C_C,
15076
15077
15078 `GL_SRC_ALPHA', A_C,
15079
15080
15081 `GL_ONE_MINUS_SRC_ALPHA', 1-A_C,
15082
15083`GL_PRIMARY_COLOR'
15084 `GL_SRC_COLOR', C_F,
15085
8925f36f 15086
3c9b6116 15087 `GL_ONE_MINUS_SRC_COLOR', 1-C_F,
8925f36f 15088
8925f36f 15089
3c9b6116 15090 `GL_SRC_ALPHA', A_F,
8925f36f 15091
8925f36f 15092
3c9b6116 15093 `GL_ONE_MINUS_SRC_ALPHA', 1-A_F,
8925f36f 15094
3c9b6116
AW
15095`GL_PREVIOUS'
15096 `GL_SRC_COLOR', C_P,
8925f36f 15097
8925f36f 15098
3c9b6116 15099 `GL_ONE_MINUS_SRC_COLOR', 1-C_P,
8925f36f 15100
8925f36f 15101
3c9b6116 15102 `GL_SRC_ALPHA', A_P,
8925f36f 15103
8925f36f 15104
3c9b6116 15105 `GL_ONE_MINUS_SRC_ALPHA', 1-A_P,
8925f36f 15106
3c9b6116
AW
15107For `GL_TEXTUREn' sources, C_S and A_S represent the color and alpha,
15108respectively, produced from texture stage N .
8925f36f 15109
3c9b6116
AW
15110The follow table describes the values assigned to ARG0 , ARG1 , and ARG2
15111based upon the alpha sources and operands:
8925f36f 15112
8925f36f 15113
8925f36f 15114
3c9b6116
AW
15115*`GL_SRCn_ALPHA'*
15116 *`GL_OPERANDn_ALPHA'*, *Argument Value*
8925f36f 15117
3c9b6116
AW
15118`GL_TEXTURE'
15119 `GL_SRC_ALPHA', A_S,
8925f36f 15120
8925f36f 15121
3c9b6116 15122 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
8925f36f 15123
3c9b6116
AW
15124`GL_TEXTUREn'
15125 `GL_SRC_ALPHA', A_S,
8925f36f 15126
8925f36f 15127
3c9b6116 15128 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
8925f36f 15129
3c9b6116
AW
15130`GL_CONSTANT'
15131 `GL_SRC_ALPHA', A_C,
8925f36f 15132
8925f36f 15133
3c9b6116 15134 `GL_ONE_MINUS_SRC_ALPHA', 1-A_C,
8925f36f 15135
3c9b6116
AW
15136`GL_PRIMARY_COLOR'
15137 `GL_SRC_ALPHA', A_F,
8925f36f 15138
8925f36f 15139
3c9b6116
AW
15140 `GL_ONE_MINUS_SRC_ALPHA', 1-A_F,
15141
15142`GL_PREVIOUS'
15143 `GL_SRC_ALPHA', A_P,
15144
15145
15146 `GL_ONE_MINUS_SRC_ALPHA', 1-A_P,
15147
15148The RGB and alpha results of the texture function are multipled by the
15149values of `GL_RGB_SCALE' and `GL_ALPHA_SCALE', respectively, and clamped
15150to the range [0,1] .
15151
15152If PNAME is `GL_TEXTURE_ENV_COLOR', PARAMS is a pointer to an array that
15153holds an RGBA color consisting of four values. Integer color components
15154are interpreted linearly such that the most positive integer maps to
151551.0, and the most negative integer maps to -1.0. The values are clamped
15156to the range [0,1] when they are specified. C_C takes these four values.
15157
15158If PNAME is `GL_TEXTURE_LOD_BIAS', the value specified is added to the
15159texture level-of-detail parameter, that selects which mipmap, or mipmaps
15160depending upon the selected `GL_TEXTURE_MIN_FILTER', will be sampled.
15161
15162`GL_TEXTURE_ENV_MODE' defaults to `GL_MODULATE' and
15163`GL_TEXTURE_ENV_COLOR' defaults to (0, 0, 0, 0).
8925f36f 15164
3c9b6116
AW
15165If TARGET is `GL_POINT_SPRITE' and PNAME is `GL_COORD_REPLACE', the
15166boolean value specified is used to either enable or disable point sprite
15167texture coordinate replacement. The default value is `GL_FALSE'.
8925f36f 15168
3c9b6116
AW
15169`GL_INVALID_ENUM' is generated when TARGET or PNAME is not one of the
15170accepted defined values, or when PARAMS should have a defined constant
15171value (based on the value of PNAME) and does not.
15172
15173`GL_INVALID_VALUE' is generated if the PARAMS value for `GL_RGB_SCALE'
15174or `GL_ALPHA_SCALE' are not one of 1.0, 2.0, or 4.0.
15175
15176`GL_INVALID_OPERATION' is generated if `glTexEnv' is executed between
15177the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 15178
7ec693ed 15179(define-foreign-procedure
bb894c9d
AW
15180 ((glTexGeni
15181 (coord GLenum)
15182 (pname GLenum)
15183 (param GLint)
15184 ->
15185 void)
15186 (glTexGend
15187 (coord GLenum)
15188 (pname GLenum)
15189 (param GLdouble)
15190 ->
15191 void))
3c9b6116 15192 "Control the generation of texture coordinates.
8925f36f 15193
3c9b6116
AW
15194COORD
15195 Specifies a texture coordinate. Must be one of `GL_S', `GL_T',
15196 `GL_R', or `GL_Q'.
8925f36f 15197
3c9b6116
AW
15198PNAME
15199 Specifies the symbolic name of the texture-coordinate generation
15200 function. Must be `GL_TEXTURE_GEN_MODE'.
8925f36f 15201
3c9b6116
AW
15202PARAM
15203 Specifies a single-valued texture generation parameter, one of
15204 `GL_OBJECT_LINEAR', `GL_EYE_LINEAR', `GL_SPHERE_MAP',
15205 `GL_NORMAL_MAP', or `GL_REFLECTION_MAP'.
8925f36f 15206
3c9b6116
AW
15207`glTexGen' selects a texture-coordinate generation function or supplies
15208coefficients for one of the functions. COORD names one of the (S, T, R,
15209Q) texture coordinates; it must be one of the symbols `GL_S', `GL_T',
15210`GL_R', or `GL_Q'. PNAME must be one of three symbolic constants:
15211`GL_TEXTURE_GEN_MODE', `GL_OBJECT_PLANE', or `GL_EYE_PLANE'. If PNAME is
15212`GL_TEXTURE_GEN_MODE', then PARAMS chooses a mode, one of
15213`GL_OBJECT_LINEAR', `GL_EYE_LINEAR', `GL_SPHERE_MAP', `GL_NORMAL_MAP',
15214or `GL_REFLECTION_MAP'. If PNAME is either `GL_OBJECT_PLANE' or
15215`GL_EYE_PLANE', PARAMS contains coefficients for the corresponding
15216texture generation function.
8925f36f 15217
3c9b6116 15218If the texture generation function is `GL_OBJECT_LINEAR', the function
8925f36f 15219
3c9b6116 15220G=P_1×X_O+P_2×Y_O+P_3×Z_O+P_4×W_O
8925f36f 15221
3c9b6116
AW
15222is used, where G is the value computed for the coordinate named in
15223COORD, P_1 , P_2 , P_3 , and P_4 are the four values supplied in PARAMS,
15224and X_O , Y_O , Z_O , and W_O are the object coordinates of the vertex.
15225This function can be used, for example, to texture-map terrain using sea
15226level as a reference plane (defined by P_1 , P_2 , P_3 , and P_4 ). The
15227altitude of a terrain vertex is computed by the `GL_OBJECT_LINEAR'
15228coordinate generation function as its distance from sea level; that
15229altitude can then be used to index the texture image to map white snow
15230onto peaks and green grass onto foothills.
8925f36f 15231
3c9b6116
AW
15232If the texture generation function is `GL_EYE_LINEAR', the function
15233
15234G=P_1,^″×X_E+P_2,^″×Y_E+P_3,^″×Z_E+P_4,^″×W_E
15235
15236is used, where
15237
15238(P_1,^″\u2062P_2,^″\u2062P_3,^″\u2062P_4,^″,)=(P_1\u2062P_2\u2062P_3\u2062P_4,)\u2062M^-1
15239
15240and X_E , Y_E , Z_E , and W_E are the eye coordinates of the vertex, P_1
15241, P_2 , P_3 , and P_4 are the values supplied in PARAMS, and M is the
15242modelview matrix when `glTexGen' is invoked. If M is poorly conditioned
15243or singular, texture coordinates generated by the resulting function may
15244be inaccurate or undefined.
15245
15246Note that the values in PARAMS define a reference plane in eye
15247coordinates. The modelview matrix that is applied to them may not be the
15248same one in effect when the polygon vertices are transformed. This
15249function establishes a field of texture coordinates that can produce
15250dynamic contour lines on moving objects.
15251
15252If the texture generation function is `GL_SPHERE_MAP' and COORD is
15253either `GL_S' or `GL_T', S and T texture coordinates are generated as
15254follows. Let U be the unit vector pointing from the origin to the
15255polygon vertex (in eye coordinates). Let N sup prime be the current
15256normal, after transformation to eye coordinates. Let
15257
15258F=(F_X\u2062F_Y\u2062F_Z,)^T be the reflection vector such that
15259
15260F=U-2\u2062N^″\u2062N^″,^T\u2062U
15261
15262Finally, let M=2\u2062√(F_X,^2+F_Y,^2+(F_Z+1,)^2,) . Then the values assigned
15263to the S and T texture coordinates are
15264
15265S=F_X/M+1/2
15266
15267T=F_Y/M+1/2
15268
15269To enable or disable a texture-coordinate generation function, call
15270`glEnable' or `glDisable' with one of the symbolic texture-coordinate
15271names (`GL_TEXTURE_GEN_S', `GL_TEXTURE_GEN_T', `GL_TEXTURE_GEN_R', or
15272`GL_TEXTURE_GEN_Q') as the argument. When enabled, the specified texture
15273coordinate is computed according to the generating function associated
15274with that coordinate. When disabled, subsequent vertices take the
15275specified texture coordinate from the current set of texture
15276coordinates. Initially, all texture generation functions are set to
15277`GL_EYE_LINEAR' and are disabled. Both S plane equations are (1, 0, 0,
152780), both T plane equations are (0, 1, 0, 0), and all R and Q plane
15279equations are (0, 0, 0, 0).
15280
15281When the `ARB_multitexture' extension is supported, `glTexGen' sets the
15282texture generation parameters for the currently active texture unit,
15283selected with `glActiveTexture'.
15284
15285`GL_INVALID_ENUM' is generated when COORD or PNAME is not an accepted
15286defined value, or when PNAME is `GL_TEXTURE_GEN_MODE' and PARAMS is not
15287an accepted defined value.
15288
15289`GL_INVALID_ENUM' is generated when PNAME is `GL_TEXTURE_GEN_MODE',
15290PARAMS is `GL_SPHERE_MAP', and COORD is either `GL_R' or `GL_Q'.
15291
15292`GL_INVALID_OPERATION' is generated if `glTexGen' is executed between
15293the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 15294
7ec693ed 15295(define-foreign-procedure
bb894c9d
AW
15296 ((glTexImage1D
15297 (target GLenum)
15298 (level GLint)
15299 (internalFormat GLint)
15300 (width GLsizei)
15301 (border GLint)
15302 (format GLenum)
15303 (type GLenum)
15304 (data *)
15305 ->
15306 void))
3c9b6116 15307 "Specify a one-dimensional texture image.
8925f36f 15308
3c9b6116
AW
15309TARGET
15310 Specifies the target texture. Must be `GL_TEXTURE_1D' or
15311 `GL_PROXY_TEXTURE_1D'.
8925f36f 15312
3c9b6116
AW
15313LEVEL
15314 Specifies the level-of-detail number. Level 0 is the base image
15315 level. Level N is the Nth mipmap reduction image.
8925f36f 15316
3c9b6116
AW
15317INTERNALFORMAT
15318 Specifies the number of color components in the texture. Must be 1,
15319 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA',
15320 `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
15321 `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE',
15322 `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY',
15323 `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT',
15324 `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24',
15325 `GL_DEPTH_COMPONENT32', `GL_LUMINANCE', `GL_LUMINANCE4',
15326 `GL_LUMINANCE8', `GL_LUMINANCE12', `GL_LUMINANCE16',
15327 `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
15328 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
15329 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
15330 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
15331 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
15332 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
15333 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
15334 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
15335 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
15336 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
15337 `GL_SRGB8_ALPHA8'.
8925f36f 15338
3c9b6116
AW
15339WIDTH
15340 Specifies the width of the texture image including the border if
15341 any. If the GL version does not support non-power-of-two sizes,
15342 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
15343 implementations support texture images that are at least 64 texels
15344 wide. The height of the 1D texture image is 1.
8925f36f 15345
3c9b6116
AW
15346BORDER
15347 Specifies the width of the border. Must be either 0 or 1.
8925f36f 15348
3c9b6116
AW
15349FORMAT
15350 Specifies the format of the pixel data. The following symbolic
15351 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
15352 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
15353 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
8925f36f 15354
3c9b6116
AW
15355TYPE
15356 Specifies the data type of the pixel data. The following symbolic
15357 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
15358 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
15359 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
15360 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
15361 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
15362 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
15363 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
15364 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
15365
15366DATA
15367 Specifies a pointer to the image data in memory.
15368
15369Texturing maps a portion of a specified texture image onto each
15370graphical primitive for which texturing is enabled. To enable and
15371disable one-dimensional texturing, call `glEnable' and `glDisable' with
15372argument `GL_TEXTURE_1D'.
15373
15374Texture images are defined with `glTexImage1D'. The arguments describe
15375the parameters of the texture image, such as width, width of the border,
15376level-of-detail number (see `glTexParameter'), and the internal
15377resolution and format used to store the image. The last three arguments
15378describe how the image is represented in memory; they are identical to
15379the pixel formats used for `glDrawPixels'.
15380
15381If TARGET is `GL_PROXY_TEXTURE_1D', no data is read from DATA, but all
15382of the texture image state is recalculated, checked for consistency, and
15383checked against the implementation's capabilities. If the implementation
15384cannot handle a texture of the requested texture size, it sets all of
15385the image state to 0, but does not generate an error (see `glGetError').
15386To query for an entire mipmap array, use an image array level greater
15387than or equal to 1.
15388
15389If TARGET is `GL_TEXTURE_1D', data is read from DATA as a sequence of
15390signed or unsigned bytes, shorts, or longs, or single-precision
15391floating-point values, depending on TYPE. These values are grouped into
15392sets of one, two, three, or four values, depending on FORMAT, to form
15393elements. If TYPE is `GL_BITMAP', the data is considered as a string of
15394unsigned bytes (and FORMAT must be `GL_COLOR_INDEX'). Each data byte is
15395treated as eight 1-bit elements, with bit ordering determined by
15396`GL_UNPACK_LSB_FIRST' (see `glPixelStore').
15397
15398If a non-zero named buffer object is bound to the
15399`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
15400image is specified, DATA is treated as a byte offset into the buffer
15401object's data store.
15402
15403The first element corresponds to the left end of the texture array.
15404Subsequent elements progress left-to-right through the remaining texels
15405in the texture array. The final element corresponds to the right end of
15406the texture array.
15407
15408FORMAT determines the composition of each element in DATA. It can assume
15409one of these symbolic values:
15410
15411`GL_COLOR_INDEX'
15412 Each element is a single value, a color index. The GL converts it
15413 to fixed point (with an unspecified number of zero bits to the
15414 right of the binary point), shifted left or right depending on the
15415 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'
15416 (see `glPixelTransfer'). The resulting index is converted to a set
15417 of color components using the `GL_PIXEL_MAP_I_TO_R',
15418 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
15419 `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1].
15420
15421`GL_RED'
15422 Each element is a single red component. The GL converts it to
15423 floating point and assembles it into an RGBA element by attaching 0
15424 for green and blue, and 1 for alpha. Each component is then
15425 multiplied by the signed scale factor `GL_c_SCALE', added to the
15426 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15427 `glPixelTransfer').
15428
15429`GL_GREEN'
15430 Each element is a single green component. The GL converts it to
15431 floating point and assembles it into an RGBA element by attaching 0
15432 for red and blue, and 1 for alpha. Each component is then
15433 multiplied by the signed scale factor `GL_c_SCALE', added to the
15434 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15435 `glPixelTransfer').
15436
15437`GL_BLUE'
15438 Each element is a single blue component. The GL converts it to
15439 floating point and assembles it into an RGBA element by attaching 0
15440 for red and green, and 1 for alpha. Each component is then
15441 multiplied by the signed scale factor `GL_c_SCALE', added to the
15442 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15443 `glPixelTransfer').
15444
15445`GL_ALPHA'
15446 Each element is a single alpha component. The GL converts it to
15447 floating point and assembles it into an RGBA element by attaching 0
15448 for red, green, and blue. Each component is then multiplied by the
15449 signed scale factor `GL_c_SCALE', added to the signed bias
15450 `GL_c_BIAS', and clamped to the range [0,1] (see
15451 `glPixelTransfer').
15452
15453`GL_INTENSITY'
15454 Each element is a single intensity value. The GL converts it to
15455 floating point, then assembles it into an RGBA element by
15456 replicating the intensity value three times for red, green, blue,
15457 and alpha. Each component is then multiplied by the signed scale
15458 factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and
15459 clamped to the range [0,1] (see `glPixelTransfer').
15460
15461`GL_RGB'
15462`GL_BGR'
15463 Each element is an RGB triple. The GL converts it to floating point
15464 and assembles it into an RGBA element by attaching 1 for alpha.
15465 Each component is then multiplied by the signed scale factor
15466 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
15467 the range [0,1] (see `glPixelTransfer').
15468
15469`GL_RGBA'
15470`GL_BGRA'
15471 Each element contains all four components. Each component is
15472 multiplied by the signed scale factor `GL_c_SCALE', added to the
15473 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15474 `glPixelTransfer').
15475
15476`GL_LUMINANCE'
15477 Each element is a single luminance value. The GL converts it to
15478 floating point, then assembles it into an RGBA element by
15479 replicating the luminance value three times for red, green, and
15480 blue and attaching 1 for alpha. Each component is then multiplied
15481 by the signed scale factor `GL_c_SCALE', added to the signed bias
15482 `GL_c_BIAS', and clamped to the range [0,1] (see
15483 `glPixelTransfer').
15484
15485`GL_LUMINANCE_ALPHA'
15486 Each element is a luminance/alpha pair. The GL converts it to
15487 floating point, then assembles it into an RGBA element by
15488 replicating the luminance value three times for red, green, and
15489 blue. Each component is then multiplied by the signed scale factor
15490 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
15491 the range [0,1] (see `glPixelTransfer').
15492
15493`GL_DEPTH_COMPONENT'
15494 Each element is a single depth value. The GL converts it to
15495 floating point, multiplies by the signed scale factor
15496 `GL_DEPTH_SCALE', adds the signed bias `GL_DEPTH_BIAS', and clamps
15497 to the range [0,1] (see `glPixelTransfer').
15498
15499Refer to the `glDrawPixels' reference page for a description of the
15500acceptable values for the TYPE parameter.
15501
15502If an application wants to store the texture at a certain resolution or
15503in a certain format, it can request the resolution and format with
15504INTERNALFORMAT. The GL will choose an internal representation that
15505closely approximates that requested by INTERNALFORMAT, but it may not
15506match exactly. (The representations specified by `GL_LUMINANCE',
15507`GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The
15508numeric values 1, 2, 3, and 4 may also be used to specify the above
15509representations.)
15510
15511If the INTERNALFORMAT parameter is one of the generic compressed
15512formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY',
15513`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
15514`GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the
15515internal format with the symbolic constant for a specific internal
15516format and compress the texture before storage. If no corresponding
15517internal format is available, or the GL can not compress that image for
15518any reason, the internal format is instead replaced with a corresponding
15519base internal format.
15520
15521If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8',
15522`GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8',
15523`GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is
15524treated as if the red, green, blue, or luminance components are encoded
15525in the sRGB color space. Any alpha component is left unchanged. The
15526conversion from the sRGB encoded component C_S to a linear component C_L
15527is:
15528
15529C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if
15530C_S>0.04045)
15531
15532Assume C_S is the sRGB component in the range [0,1].
15533
15534Use the `GL_PROXY_TEXTURE_1D' target to try out a resolution and format.
15535The implementation will update and recompute its best match for the
15536requested storage resolution and format. To then query this state, call
15537`glGetTexLevelParameter'. If the texture cannot be accommodated, texture
15538state is set to 0.
15539
15540A one-component texture image uses only the red component of the RGBA
15541color from DATA. A two-component image uses the R and A values. A
15542three-component image uses the R, G, and B values. A four-component
15543image uses all of the RGBA components.
15544
15545Depth textures can be treated as LUMINANCE, INTENSITY or ALPHA textures
15546during texture filtering and application.\xa0Image-based shadowing\xa0can\xa0be
15547\xa0enabled\xa0by\xa0comparing texture r coordinates to depth texture values to
15548generate a boolean result. See `glTexParameter' for details on texture
15549comparison.
15550
15551`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_1D' or
15552`GL_PROXY_TEXTURE_1D'.
15553
15554`GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
15555constant. Format constants other than `GL_STENCIL_INDEX' are accepted.
15556
15557`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
15558
15559`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
15560`GL_COLOR_INDEX'.
15561
15562`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
8925f36f 15563
3c9b6116
AW
15564`GL_INVALID_VALUE' may be generated if LEVEL is greater than
15565LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
8925f36f 15566
3c9b6116
AW
15567`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or
15568one of the accepted resolution and format symbolic constants.
8925f36f 15569
3c9b6116
AW
15570`GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than
155712 + `GL_MAX_TEXTURE_SIZE'.
8925f36f 15572
3c9b6116
AW
15573`GL_INVALID_VALUE' is generated if non-power-of-two textures are not
15574supported and the WIDTH cannot be represented as 2^N+2\u2061(BORDER,) for
15575some integer value of N.
8925f36f 15576
3c9b6116 15577`GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
8925f36f 15578
3c9b6116
AW
15579`GL_INVALID_OPERATION' is generated if TYPE is one of
15580`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
15581`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
15582is not `GL_RGB'.
8925f36f 15583
3c9b6116
AW
15584`GL_INVALID_OPERATION' is generated if TYPE is one of
15585`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
15586`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
15587`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
15588`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
15589FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8925f36f 15590
3c9b6116
AW
15591`GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT'
15592and INTERNALFORMAT is not `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
15593`GL_DEPTH_COMPONENT24', or `GL_DEPTH_COMPONENT32'.
8925f36f 15594
3c9b6116
AW
15595`GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
15596`GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
15597`GL_DEPTH_COMPONENT32', and FORMAT is not `GL_DEPTH_COMPONENT'.
8925f36f 15598
3c9b6116
AW
15599`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15600bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
15601data store is currently mapped.
8925f36f 15602
3c9b6116
AW
15603`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15604bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
15605unpacked from the buffer object such that the memory reads required
15606would exceed the data store size.
8925f36f 15607
3c9b6116
AW
15608`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15609bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
15610divisible into the number of bytes needed to store in memory a datum
15611indicated by TYPE.
15612
15613`GL_INVALID_OPERATION' is generated if `glTexImage1D' is executed
15614between the execution of `glBegin' and the corresponding execution of
15615`glEnd'.")
8925f36f 15616
7ec693ed 15617(define-foreign-procedure
bb894c9d
AW
15618 ((glTexImage2D
15619 (target GLenum)
15620 (level GLint)
15621 (internalFormat GLint)
15622 (width GLsizei)
15623 (height GLsizei)
15624 (border GLint)
15625 (format GLenum)
15626 (type GLenum)
15627 (data *)
15628 ->
15629 void))
3c9b6116 15630 "Specify a two-dimensional texture image.
8925f36f 15631
3c9b6116
AW
15632TARGET
15633 Specifies the target texture. Must be `GL_TEXTURE_2D',
15634 `GL_PROXY_TEXTURE_2D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
15635 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
15636 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
15637 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'.
8925f36f 15638
3c9b6116
AW
15639LEVEL
15640 Specifies the level-of-detail number. Level 0 is the base image
15641 level. Level N is the Nth mipmap reduction image.
8925f36f 15642
3c9b6116
AW
15643INTERNALFORMAT
15644 Specifies the number of color components in the texture. Must be 1,
15645 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA',
15646 `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
15647 `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE',
15648 `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY',
15649 `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT',
15650 `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24',
15651 `GL_DEPTH_COMPONENT32', `GL_LUMINANCE', `GL_LUMINANCE4',
15652 `GL_LUMINANCE8', `GL_LUMINANCE12', `GL_LUMINANCE16',
15653 `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
15654 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
15655 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
15656 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
15657 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
15658 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
15659 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
15660 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
15661 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
15662 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
15663 `GL_SRGB8_ALPHA8'.
8925f36f 15664
3c9b6116
AW
15665WIDTH
15666 Specifies the width of the texture image including the border if
15667 any. If the GL version does not support non-power-of-two sizes,
15668 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
15669 implementations support texture images that are at least 64 texels
15670 wide.
8925f36f 15671
3c9b6116
AW
15672HEIGHT
15673 Specifies the height of the texture image including the border if
15674 any. If the GL version does not support non-power-of-two sizes,
15675 this value must be 2^M+2\u2061(BORDER,) for some integer M . All
15676 implementations support texture images that are at least 64 texels
15677 high.
8925f36f 15678
3c9b6116
AW
15679BORDER
15680 Specifies the width of the border. Must be either 0 or 1.
8925f36f 15681
3c9b6116
AW
15682FORMAT
15683 Specifies the format of the pixel data. The following symbolic
15684 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
15685 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
15686 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
8925f36f 15687
3c9b6116
AW
15688TYPE
15689 Specifies the data type of the pixel data. The following symbolic
15690 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
15691 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
15692 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
15693 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
15694 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
15695 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
15696 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
15697 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
8925f36f 15698
3c9b6116
AW
15699DATA
15700 Specifies a pointer to the image data in memory.
8925f36f 15701
3c9b6116
AW
15702Texturing maps a portion of a specified texture image onto each
15703graphical primitive for which texturing is enabled. To enable and
15704disable two-dimensional texturing, call `glEnable' and `glDisable' with
15705argument `GL_TEXTURE_2D'. To enable and disable texturing using
15706cube-mapped texture, call `glEnable' and `glDisable' with argument
15707`GL_TEXTURE_CUBE_MAP'.
15708
15709To define texture images, call `glTexImage2D'. The arguments describe
15710the parameters of the texture image, such as height, width, width of the
15711border, level-of-detail number (see `glTexParameter'), and number of
15712color components provided. The last three arguments describe how the
15713image is represented in memory; they are identical to the pixel formats
15714used for `glDrawPixels'.
15715
15716If TARGET is `GL_PROXY_TEXTURE_2D' or `GL_PROXY_TEXTURE_CUBE_MAP', no
15717data is read from DATA, but all of the texture image state is
15718recalculated, checked for consistency, and checked against the
15719implementation's capabilities. If the implementation cannot handle a
15720texture of the requested texture size, it sets all of the image state to
157210, but does not generate an error (see `glGetError'). To query for an
15722entire mipmap array, use an image array level greater than or equal to
157231.
15724
15725If TARGET is `GL_TEXTURE_2D', or one of the `GL_TEXTURE_CUBE_MAP'
15726targets, data is read from DATA as a sequence of signed or unsigned
15727bytes, shorts, or longs, or single-precision floating-point values,
15728depending on TYPE. These values are grouped into sets of one, two,
15729three, or four values, depending on FORMAT, to form elements. If TYPE is
15730`GL_BITMAP', the data is considered as a string of unsigned bytes (and
15731FORMAT must be `GL_COLOR_INDEX'). Each data byte is treated as eight
157321-bit elements, with bit ordering determined by `GL_UNPACK_LSB_FIRST'
15733(see `glPixelStore').
15734
15735If a non-zero named buffer object is bound to the
15736`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
15737image is specified, DATA is treated as a byte offset into the buffer
15738object's data store.
15739
15740The first element corresponds to the lower left corner of the texture
15741image. Subsequent elements progress left-to-right through the remaining
15742texels in the lowest row of the texture image, and then in successively
15743higher rows of the texture image. The final element corresponds to the
15744upper right corner of the texture image.
15745
15746FORMAT determines the composition of each element in DATA. It can assume
15747one of these symbolic values:
15748
15749`GL_COLOR_INDEX'
15750 Each element is a single value, a color index. The GL converts it
15751 to fixed point (with an unspecified number of zero bits to the
15752 right of the binary point), shifted left or right depending on the
15753 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'
15754 (see `glPixelTransfer'). The resulting index is converted to a set
15755 of color components using the `GL_PIXEL_MAP_I_TO_R',
15756 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
15757 `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1].
15758
15759`GL_RED'
15760 Each element is a single red component. The GL converts it to
15761 floating point and assembles it into an RGBA element by attaching 0
15762 for green and blue, and 1 for alpha. Each component is then
15763 multiplied by the signed scale factor `GL_c_SCALE', added to the
15764 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15765 `glPixelTransfer').
15766
15767`GL_GREEN'
15768 Each element is a single green component. The GL converts it to
15769 floating point and assembles it into an RGBA element by attaching 0
15770 for red and blue, and 1 for alpha. Each component is then
15771 multiplied by the signed scale factor `GL_c_SCALE', added to the
15772 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15773 `glPixelTransfer').
15774
15775`GL_BLUE'
15776 Each element is a single blue component. The GL converts it to
15777 floating point and assembles it into an RGBA element by attaching 0
15778 for red and green, and 1 for alpha. Each component is then
15779 multiplied by the signed scale factor `GL_c_SCALE', added to the
15780 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15781 `glPixelTransfer').
15782
15783`GL_ALPHA'
15784 Each element is a single alpha component. The GL converts it to
15785 floating point and assembles it into an RGBA element by attaching 0
15786 for red, green, and blue. Each component is then multiplied by the
15787 signed scale factor `GL_c_SCALE', added to the signed bias
15788 `GL_c_BIAS', and clamped to the range [0,1] (see
15789 `glPixelTransfer').
15790
15791`GL_INTENSITY'
15792 Each element is a single intensity value. The GL converts it to
15793 floating point, then assembles it into an RGBA element by
15794 replicating the intensity value three times for red, green, blue,
15795 and alpha. Each component is then multiplied by the signed scale
15796 factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and
15797 clamped to the range [0,1] (see `glPixelTransfer').
15798
15799`GL_RGB'
15800`GL_BGR'
15801 Each element is an RGB triple. The GL converts it to floating point
15802 and assembles it into an RGBA element by attaching 1 for alpha.
15803 Each component is then multiplied by the signed scale factor
15804 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
15805 the range [0,1] (see `glPixelTransfer').
15806
15807`GL_RGBA'
15808`GL_BGRA'
15809 Each element contains all four components. Each component is
15810 multiplied by the signed scale factor `GL_c_SCALE', added to the
15811 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15812 `glPixelTransfer').
15813
15814`GL_LUMINANCE'
15815 Each element is a single luminance value. The GL converts it to
15816 floating point, then assembles it into an RGBA element by
15817 replicating the luminance value three times for red, green, and
15818 blue and attaching 1 for alpha. Each component is then multiplied
15819 by the signed scale factor `GL_c_SCALE', added to the signed bias
15820 `GL_c_BIAS', and clamped to the range [0,1] (see
15821 `glPixelTransfer').
15822
15823`GL_LUMINANCE_ALPHA'
15824 Each element is a luminance/alpha pair. The GL converts it to
15825 floating point, then assembles it into an RGBA element by
15826 replicating the luminance value three times for red, green, and
15827 blue. Each component is then multiplied by the signed scale factor
15828 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
15829 the range [0,1] (see `glPixelTransfer').
15830
15831`GL_DEPTH_COMPONENT'
15832 Each element is a single depth value. The GL converts it to
15833 floating point, multiplies by the signed scale factor
15834 `GL_DEPTH_SCALE', adds the signed bias `GL_DEPTH_BIAS', and clamps
15835 to the range [0,1] (see `glPixelTransfer').
15836
15837Refer to the `glDrawPixels' reference page for a description of the
15838acceptable values for the TYPE parameter.
15839
15840If an application wants to store the texture at a certain resolution or
15841in a certain format, it can request the resolution and format with
15842INTERNALFORMAT. The GL will choose an internal representation that
15843closely approximates that requested by INTERNALFORMAT, but it may not
15844match exactly. (The representations specified by `GL_LUMINANCE',
15845`GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The
15846numeric values 1, 2, 3, and 4 may also be used to specify the above
15847representations.)
15848
15849If the INTERNALFORMAT parameter is one of the generic compressed
15850formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY',
15851`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
15852`GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the
15853internal format with the symbolic constant for a specific internal
15854format and compress the texture before storage. If no corresponding
15855internal format is available, or the GL can not compress that image for
15856any reason, the internal format is instead replaced with a corresponding
15857base internal format.
15858
15859If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8',
15860`GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8',
15861`GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is
15862treated as if the red, green, blue, or luminance components are encoded
15863in the sRGB color space. Any alpha component is left unchanged. The
15864conversion from the sRGB encoded component C_S to a linear component C_L
15865is:
15866
15867C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if
15868C_S>0.04045)
15869
15870Assume C_S is the sRGB component in the range [0,1].
15871
15872Use the `GL_PROXY_TEXTURE_2D' or `GL_PROXY_TEXTURE_CUBE_MAP' target to
15873try out a resolution and format. The implementation will update and
15874recompute its best match for the requested storage resolution and
15875format. To then query this state, call `glGetTexLevelParameter'. If the
15876texture cannot be accommodated, texture state is set to 0.
15877
15878A one-component texture image uses only the red component of the RGBA
15879color extracted from DATA. A two-component image uses the R and A
15880values. A three-component image uses the R, G, and B values. A
15881four-component image uses all of the RGBA components.
15882
15883Depth textures can be treated as LUMINANCE, INTENSITY or ALPHA textures
15884during texture filtering and application.\xa0Image-based shadowing\xa0can\xa0be
15885\xa0enabled\xa0by\xa0comparing texture r coordinates to depth texture values to
15886generate a boolean result. See `glTexParameter' for details on texture
15887comparison.
15888
15889`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
15890`GL_PROXY_TEXTURE_2D', `GL_PROXY_TEXTURE_CUBE_MAP',
15891`GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
15892`GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
15893`GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
15894
15895`GL_INVALID_ENUM' is generated if TARGET is one of the six cube map 2D
15896image targets and the width and height parameters are not equal.
15897
15898`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
15899
15900`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
15901`GL_COLOR_INDEX'.
15902
15903`GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0 or
15904greater than 2 + `GL_MAX_TEXTURE_SIZE'.
15905
15906`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
15907
15908`GL_INVALID_VALUE' may be generated if LEVEL is greater than
15909LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
15910
15911`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or
15912one of the accepted resolution and format symbolic constants.
15913
15914`GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0 or
15915greater than 2 + `GL_MAX_TEXTURE_SIZE'.
15916
15917`GL_INVALID_VALUE' is generated if non-power-of-two textures are not
15918supported and the WIDTH or HEIGHT cannot be represented as
159192^K+2\u2061(BORDER,) for some integer value of K.
15920
15921`GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
15922
15923`GL_INVALID_OPERATION' is generated if TYPE is one of
15924`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
15925`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
15926is not `GL_RGB'.
15927
15928`GL_INVALID_OPERATION' is generated if TYPE is one of
15929`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
15930`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
15931`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
15932`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
15933FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8925f36f 15934
3c9b6116
AW
15935`GL_INVALID_OPERATION' is generated if TARGET is not `GL_TEXTURE_2D' or
15936`GL_PROXY_TEXTURE_2D' and INTERNALFORMAT is `GL_DEPTH_COMPONENT',
15937`GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
15938`GL_DEPTH_COMPONENT32'.
15939
15940`GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT'
15941and INTERNALFORMAT is not `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
15942`GL_DEPTH_COMPONENT24', or `GL_DEPTH_COMPONENT32'.
15943
15944`GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
15945`GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
15946`GL_DEPTH_COMPONENT32', and FORMAT is not `GL_DEPTH_COMPONENT'.
15947
15948`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15949bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
15950data store is currently mapped.
15951
15952`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15953bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
15954unpacked from the buffer object such that the memory reads required
15955would exceed the data store size.
15956
15957`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15958bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
15959divisible into the number of bytes needed to store in memory a datum
15960indicated by TYPE.
15961
15962`GL_INVALID_OPERATION' is generated if `glTexImage2D' is executed
15963between the execution of `glBegin' and the corresponding execution of
15964`glEnd'.")
8925f36f 15965
7ec693ed 15966(define-foreign-procedure
bb894c9d
AW
15967 ((glTexImage3D
15968 (target GLenum)
15969 (level GLint)
15970 (internalFormat GLint)
15971 (width GLsizei)
15972 (height GLsizei)
15973 (depth GLsizei)
15974 (border GLint)
15975 (format GLenum)
15976 (type GLenum)
15977 (data *)
15978 ->
15979 void))
3c9b6116 15980 "Specify a three-dimensional texture image.
8925f36f 15981
3c9b6116
AW
15982TARGET
15983 Specifies the target texture. Must be `GL_TEXTURE_3D' or
15984 `GL_PROXY_TEXTURE_3D'.
8925f36f 15985
3c9b6116
AW
15986LEVEL
15987 Specifies the level-of-detail number. Level 0 is the base image
15988 level. Level N is the N^TH mipmap reduction image.
8925f36f 15989
3c9b6116
AW
15990INTERNALFORMAT
15991 Specifies the number of color components in the texture. Must be 1,
15992 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA',
15993 `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
15994 `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE',
15995 `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY',
15996 `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_LUMINANCE',
15997 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
15998 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
15999 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
16000 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
16001 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
16002 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
16003 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
16004 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
16005 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
16006 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
16007 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
16008 `GL_SRGB8_ALPHA8'.
8925f36f 16009
3c9b6116
AW
16010WIDTH
16011 Specifies the width of the texture image including the border if
16012 any. If the GL version does not support non-power-of-two sizes,
16013 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
16014 implementations support 3D texture images that are at least 16
16015 texels wide.
8925f36f 16016
3c9b6116
AW
16017HEIGHT
16018 Specifies the height of the texture image including the border if
16019 any. If the GL version does not support non-power-of-two sizes,
16020 this value must be 2^M+2\u2061(BORDER,) for some integer M . All
16021 implementations support 3D texture images that are at least 16
16022 texels high.
8925f36f 16023
3c9b6116
AW
16024DEPTH
16025 Specifies the depth of the texture image including the border if
16026 any. If the GL version does not support non-power-of-two sizes,
16027 this value must be 2^K+2\u2061(BORDER,) for some integer K . All
16028 implementations support 3D texture images that are at least 16
16029 texels deep.
8925f36f 16030
3c9b6116
AW
16031BORDER
16032 Specifies the width of the border. Must be either 0 or 1.
8925f36f 16033
3c9b6116
AW
16034FORMAT
16035 Specifies the format of the pixel data. The following symbolic
16036 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
16037 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
16038 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
8925f36f 16039
3c9b6116
AW
16040TYPE
16041 Specifies the data type of the pixel data. The following symbolic
16042 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
16043 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
16044 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16045 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
16046 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16047 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16048 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16049 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
8925f36f 16050
3c9b6116
AW
16051DATA
16052 Specifies a pointer to the image data in memory.
16053
16054Texturing maps a portion of a specified texture image onto each
16055graphical primitive for which texturing is enabled. To enable and
16056disable three-dimensional texturing, call `glEnable' and `glDisable'
16057with argument `GL_TEXTURE_3D'.
16058
16059To define texture images, call `glTexImage3D'. The arguments describe
16060the parameters of the texture image, such as height, width, depth, width
16061of the border, level-of-detail number (see `glTexParameter'), and number
16062of color components provided. The last three arguments describe how the
16063image is represented in memory; they are identical to the pixel formats
16064used for `glDrawPixels'.
16065
16066If TARGET is `GL_PROXY_TEXTURE_3D', no data is read from DATA, but all
16067of the texture image state is recalculated, checked for consistency, and
16068checked against the implementation's capabilities. If the implementation
16069cannot handle a texture of the requested texture size, it sets all of
16070the image state to 0, but does not generate an error (see `glGetError').
16071To query for an entire mipmap array, use an image array level greater
16072than or equal to 1.
16073
16074If TARGET is `GL_TEXTURE_3D', data is read from DATA as a sequence of
16075signed or unsigned bytes, shorts, or longs, or single-precision
16076floating-point values, depending on TYPE. These values are grouped into
16077sets of one, two, three, or four values, depending on FORMAT, to form
16078elements. If TYPE is `GL_BITMAP', the data is considered as a string of
16079unsigned bytes (and FORMAT must be `GL_COLOR_INDEX'). Each data byte is
16080treated as eight 1-bit elements, with bit ordering determined by
16081`GL_UNPACK_LSB_FIRST' (see `glPixelStore').
16082
16083If a non-zero named buffer object is bound to the
16084`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
16085image is specified, DATA is treated as a byte offset into the buffer
16086object's data store.
16087
16088The first element corresponds to the lower left corner of the texture
16089image. Subsequent elements progress left-to-right through the remaining
16090texels in the lowest row of the texture image, and then in successively
16091higher rows of the texture image. The final element corresponds to the
16092upper right corner of the texture image.
16093
16094FORMAT determines the composition of each element in DATA. It can assume
16095one of these symbolic values:
16096
16097`GL_COLOR_INDEX'
16098 Each element is a single value, a color index. The GL converts it
16099 to fixed point (with an unspecified number of zero bits to the
16100 right of the binary point), shifted left or right depending on the
16101 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'
16102 (see `glPixelTransfer'). The resulting index is converted to a set
16103 of color components using the `GL_PIXEL_MAP_I_TO_R',
16104 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
16105 `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1].
16106
16107`GL_RED'
16108 Each element is a single red component. The GL converts it to
16109 floating point and assembles it into an RGBA element by attaching 0
16110 for green and blue, and 1 for alpha. Each component is then
16111 multiplied by the signed scale factor `GL_c_SCALE', added to the
16112 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
16113 `glPixelTransfer').
16114
16115`GL_GREEN'
16116 Each element is a single green component. The GL converts it to
16117 floating point and assembles it into an RGBA element by attaching 0
16118 for red and blue, and 1 for alpha. Each component is then
16119 multiplied by the signed scale factor `GL_c_SCALE', added to the
16120 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
16121 `glPixelTransfer').
16122
16123`GL_BLUE'
16124 Each element is a single blue component. The GL converts it to
16125 floating point and assembles it into an RGBA element by attaching 0
16126 for red and green, and 1 for alpha. Each component is then
16127 multiplied by the signed scale factor `GL_c_SCALE', added to the
16128 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
16129 `glPixelTransfer').
16130
16131`GL_ALPHA'
16132 Each element is a single alpha component. The GL converts it to
16133 floating point and assembles it into an RGBA element by attaching 0
16134 for red, green, and blue. Each component is then multiplied by the
16135 signed scale factor `GL_c_SCALE', added to the signed bias
16136 `GL_c_BIAS', and clamped to the range [0,1] (see
16137 `glPixelTransfer').
16138
16139`GL_INTENSITY'
16140 Each element is a single intensity value. The GL converts it to
16141 floating point, then assembles it into an RGBA element by
16142 replicating the intensity value three times for red, green, blue,
16143 and alpha. Each component is then multiplied by the signed scale
16144 factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and
16145 clamped to the range [0,1] (see `glPixelTransfer').
16146
16147`GL_RGB'
16148`GL_BGR'
16149 Each element is an RGB triple. The GL converts it to floating point
16150 and assembles it into an RGBA element by attaching 1 for alpha.
16151 Each component is then multiplied by the signed scale factor
16152 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
16153 the range [0,1] (see `glPixelTransfer').
16154
16155`GL_RGBA'
16156`GL_BGRA'
16157 Each element contains all four components. Each component is
16158 multiplied by the signed scale factor `GL_c_SCALE', added to the
16159 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
16160 `glPixelTransfer').
16161
16162`GL_LUMINANCE'
16163 Each element is a single luminance value. The GL converts it to
16164 floating point, then assembles it into an RGBA element by
16165 replicating the luminance value three times for red, green, and
16166 blue and attaching 1 for alpha. Each component is then multiplied
16167 by the signed scale factor `GL_c_SCALE', added to the signed bias
16168 `GL_c_BIAS', and clamped to the range [0,1] (see
16169 `glPixelTransfer').
16170
16171`GL_LUMINANCE_ALPHA'
16172 Each element is a luminance/alpha pair. The GL converts it to
16173 floating point, then assembles it into an RGBA element by
16174 replicating the luminance value three times for red, green, and
16175 blue. Each component is then multiplied by the signed scale factor
16176 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
16177 the range [0,1] (see `glPixelTransfer').
16178
16179Refer to the `glDrawPixels' reference page for a description of the
16180acceptable values for the TYPE parameter.
16181
16182If an application wants to store the texture at a certain resolution or
16183in a certain format, it can request the resolution and format with
16184INTERNALFORMAT. The GL will choose an internal representation that
16185closely approximates that requested by INTERNALFORMAT, but it may not
16186match exactly. (The representations specified by `GL_LUMINANCE',
16187`GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The
16188numeric values 1, 2, 3, and 4 may also be used to specify the above
16189representations.)
16190
16191If the INTERNALFORMAT parameter is one of the generic compressed
16192formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY',
16193`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
16194`GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the
16195internal format with the symbolic constant for a specific internal
16196format and compress the texture before storage. If no corresponding
16197internal format is available, or the GL can not compress that image for
16198any reason, the internal format is instead replaced with a corresponding
16199base internal format.
16200
16201If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8',
16202`GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8',
16203`GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is
16204treated as if the red, green, blue, or luminance components are encoded
16205in the sRGB color space. Any alpha component is left unchanged. The
16206conversion from the sRGB encoded component C_S to a linear component C_L
16207is:
16208
16209C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if
16210C_S>0.04045)
16211
16212Assume C_S is the sRGB component in the range [0,1].
16213
16214Use the `GL_PROXY_TEXTURE_3D' target to try out a resolution and format.
16215The implementation will update and recompute its best match for the
16216requested storage resolution and format. To then query this state, call
16217`glGetTexLevelParameter'. If the texture cannot be accommodated, texture
16218state is set to 0.
16219
16220A one-component texture image uses only the red component of the RGBA
16221color extracted from DATA. A two-component image uses the R and A
16222values. A three-component image uses the R, G, and B values. A
16223four-component image uses all of the RGBA components.
16224
16225`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_3D' or
16226`GL_PROXY_TEXTURE_3D'.
16227
16228`GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
16229constant. Format constants other than `GL_STENCIL_INDEX' and
16230`GL_DEPTH_COMPONENT' are accepted.
16231
16232`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
16233
16234`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
16235`GL_COLOR_INDEX'.
16236
16237`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
16238
16239`GL_INVALID_VALUE' may be generated if LEVEL is greater than
16240LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
16241
16242`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or
16243one of the accepted resolution and format symbolic constants.
16244
16245`GL_INVALID_VALUE' is generated if WIDTH, HEIGHT, or DEPTH is less than
162460 or greater than 2 + `GL_MAX_TEXTURE_SIZE'.
16247
16248`GL_INVALID_VALUE' is generated if non-power-of-two textures are not
16249supported and the WIDTH, HEIGHT, or DEPTH cannot be represented as
162502^K+2\u2061(BORDER,) for some integer value of K.
16251
16252`GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
16253
16254`GL_INVALID_OPERATION' is generated if TYPE is one of
16255`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16256`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
16257is not `GL_RGB'.
16258
16259`GL_INVALID_OPERATION' is generated if TYPE is one of
16260`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16261`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16262`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16263`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
16264FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
16265
16266`GL_INVALID_OPERATION' is generated if FORMAT or INTERNALFORMAT is
16267`GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
16268`GL_DEPTH_COMPONENT32'.
16269
16270`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16271bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
16272data store is currently mapped.
16273
16274`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16275bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
16276unpacked from the buffer object such that the memory reads required
16277would exceed the data store size.
16278
16279`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16280bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
16281divisible into the number of bytes needed to store in memory a datum
16282indicated by TYPE.
16283
16284`GL_INVALID_OPERATION' is generated if `glTexImage3D' is executed
16285between the execution of `glBegin' and the corresponding execution of
16286`glEnd'.")
8925f36f 16287
7ec693ed 16288(define-foreign-procedure
bb894c9d
AW
16289 ((glTexParameterf
16290 (target GLenum)
16291 (pname GLenum)
16292 (param GLfloat)
16293 ->
16294 void)
16295 (glTexParameteri
16296 (target GLenum)
16297 (pname GLenum)
16298 (param GLint)
16299 ->
16300 void))
3c9b6116 16301 "Set texture parameters.
8925f36f 16302
3c9b6116
AW
16303TARGET
16304 Specifies the target texture, which must be either `GL_TEXTURE_1D',
16305 `GL_TEXTURE_2D', `GL_TEXTURE_3D', or `GL_TEXTURE_CUBE_MAP'.
8925f36f 16306
3c9b6116
AW
16307PNAME
16308 Specifies the symbolic name of a single-valued texture parameter.
16309 PNAME can be one of the following: `GL_TEXTURE_MIN_FILTER',
16310 `GL_TEXTURE_MAG_FILTER', `GL_TEXTURE_MIN_LOD',
16311 `GL_TEXTURE_MAX_LOD', `GL_TEXTURE_BASE_LEVEL',
16312 `GL_TEXTURE_MAX_LEVEL', `GL_TEXTURE_WRAP_S', `GL_TEXTURE_WRAP_T',
16313 `GL_TEXTURE_WRAP_R', `GL_TEXTURE_PRIORITY',
16314 `GL_TEXTURE_COMPARE_MODE', `GL_TEXTURE_COMPARE_FUNC',
16315 `GL_DEPTH_TEXTURE_MODE', or `GL_GENERATE_MIPMAP'.
16316
16317PARAM
16318 Specifies the value of PNAME.
16319
16320Texture mapping is a technique that applies an image onto an object's
16321surface as if the image were a decal or cellophane shrink-wrap. The
16322image is created in texture space, with an (S , T ) coordinate system. A
16323texture is a one- or two-dimensional image and a set of parameters that
16324determine how samples are derived from the image.
16325
16326`glTexParameter' assigns the value or values in PARAMS to the texture
16327parameter specified as PNAME. TARGET defines the target texture, either
16328`GL_TEXTURE_1D', `GL_TEXTURE_2D', or `GL_TEXTURE_3D'. The following
16329symbols are accepted in PNAME:
16330
16331`GL_TEXTURE_MIN_FILTER'
16332 The texture minifying function is used whenever the pixel being
16333 textured maps to an area greater than one texture element. There
16334 are six defined minifying functions. Two of them use the nearest
16335 one or nearest four texture elements to compute the texture value.
16336 The other four use mipmaps.
16337
16338 A mipmap is an ordered set of arrays representing the same image at
16339 progressively lower resolutions. If the texture has dimensions
16340 2^N×2^M , there are MAX\u2061(N,M)+1 mipmaps. The first mipmap is the
16341 original texture, with dimensions 2^N×2^M . Each subsequent mipmap
16342 has dimensions 2^K-1,×2^L-1, , where 2^K×2^L are the dimensions of
16343 the previous mipmap, until either K=0 or L=0 . At that point,
16344 subsequent mipmaps have dimension 1×2^L-1, or 2^K-1,×1 until the
16345 final mipmap, which has dimension 1×1 . To define the mipmaps, call
16346 `glTexImage1D', `glTexImage2D', `glTexImage3D', `glCopyTexImage1D',
16347 or `glCopyTexImage2D' with the LEVEL argument indicating the order
16348 of the mipmaps. Level 0 is the original texture; level MAX\u2061(N,M) is
16349 the final 1×1 mipmap.
16350
16351 PARAMS supplies a function for minifying the texture as one of the
16352 following:
16353
16354 As more texture elements are sampled in the minification process,
16355 fewer aliasing artifacts will be apparent. While the `GL_NEAREST'
16356 and `GL_LINEAR' minification functions can be faster than the other
16357 four, they sample only one or four texture elements to determine
16358 the texture value of the pixel being rendered and can produce moire
16359 patterns or ragged transitions. The initial value of
16360 `GL_TEXTURE_MIN_FILTER' is `GL_NEAREST_MIPMAP_LINEAR'.
16361
16362`GL_TEXTURE_MAG_FILTER'
16363 The texture magnification function is used when the pixel being
16364 textured maps to an area less than or equal to one texture element.
16365 It sets the texture magnification function to either `GL_NEAREST'
16366 or `GL_LINEAR' (see below). `GL_NEAREST' is generally faster than
16367 `GL_LINEAR', but it can produce textured images with sharper edges
16368 because the transition between texture elements is not as smooth.
16369 The initial value of `GL_TEXTURE_MAG_FILTER' is `GL_LINEAR'.
16370
16371`GL_NEAREST'
16372 Returns the value of the texture element that is nearest (in
16373 Manhattan distance) to the center of the pixel being textured.
16374
16375`GL_LINEAR'
16376 Returns the weighted average of the four texture elements that are
16377 closest to the center of the pixel being textured. These can
16378 include border texture elements, depending on the values of
16379 `GL_TEXTURE_WRAP_S' and `GL_TEXTURE_WRAP_T', and on the exact
16380 mapping.
16381
16382`GL_NEAREST_MIPMAP_NEAREST'
16383 Chooses the mipmap that most closely matches the size of the pixel
16384 being textured and uses the `GL_NEAREST' criterion (the texture
16385 element nearest to the center of the pixel) to produce a texture
16386 value.
16387
16388`GL_LINEAR_MIPMAP_NEAREST'
16389 Chooses the mipmap that most closely matches the size of the pixel
16390 being textured and uses the `GL_LINEAR' criterion (a weighted
16391 average of the four texture elements that are closest to the center
16392 of the pixel) to produce a texture value.
16393
16394`GL_NEAREST_MIPMAP_LINEAR'
16395 Chooses the two mipmaps that most closely match the size of the
16396 pixel being textured and uses the `GL_NEAREST' criterion (the
16397 texture element nearest to the center of the pixel) to produce a
16398 texture value from each mipmap. The final texture value is a
16399 weighted average of those two values.
16400
16401`GL_LINEAR_MIPMAP_LINEAR'
16402 Chooses the two mipmaps that most closely match the size of the
16403 pixel being textured and uses the `GL_LINEAR' criterion (a weighted
16404 average of the four texture elements that are closest to the center
16405 of the pixel) to produce a texture value from each mipmap. The
16406 final texture value is a weighted average of those two values.
16407
16408`GL_NEAREST'
16409 Returns the value of the texture element that is nearest (in
16410 Manhattan distance) to the center of the pixel being textured.
16411
16412`GL_LINEAR'
16413 Returns the weighted average of the four texture elements that are
16414 closest to the center of the pixel being textured. These can
16415 include border texture elements, depending on the values of
16416 `GL_TEXTURE_WRAP_S' and `GL_TEXTURE_WRAP_T', and on the exact
16417 mapping.
16418
16419
16420
16421`GL_TEXTURE_MIN_LOD'
16422 Sets the minimum level-of-detail parameter. This floating-point
16423 value limits the selection of highest resolution mipmap (lowest
16424 mipmap level). The initial value is -1000.
16425
16426
16427
16428`GL_TEXTURE_MAX_LOD'
16429 Sets the maximum level-of-detail parameter. This floating-point
16430 value limits the selection of the lowest resolution mipmap (highest
16431 mipmap level). The initial value is 1000.
16432
16433
16434
16435`GL_TEXTURE_BASE_LEVEL'
16436 Specifies the index of the lowest defined mipmap level. This is an
16437 integer value. The initial value is 0.
16438
16439
16440
16441`GL_TEXTURE_MAX_LEVEL'
16442 Sets the index of the highest defined mipmap level. This is an
16443 integer value. The initial value is 1000.
16444
16445
16446
16447`GL_TEXTURE_WRAP_S'
16448 Sets the wrap parameter for texture coordinate S to either
16449 `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE',
16450 `GL_MIRRORED_REPEAT', or `GL_REPEAT'. `GL_CLAMP' causes S
16451 coordinates to be clamped to the range [0,1] and is useful for
16452 preventing wrapping artifacts when mapping a single image onto an
16453 object. `GL_CLAMP_TO_BORDER' causes the S coordinate to be clamped
16454 to the range [-1/2N,,1+1/2N,] , where N is the size of the texture
16455 in the direction of clamping.`GL_CLAMP_TO_EDGE' causes S
16456 coordinates to be clamped to the range [1/2N,,1-1/2N,] , where N is
16457 the size of the texture in the direction of clamping. `GL_REPEAT'
16458 causes the integer part of the S coordinate to be ignored; the GL
16459 uses only the fractional part, thereby creating a repeating
16460 pattern. `GL_MIRRORED_REPEAT' causes the S coordinate to be set to
16461 the fractional part of the texture coordinate if the integer part
16462 of S is even; if the integer part of S is odd, then the S texture
16463 coordinate is set to 1-FRAC\u2061(S,) , where FRAC\u2061(S,) represents the
16464 fractional part of S . Border texture elements are accessed only if
16465 wrapping is set to `GL_CLAMP' or `GL_CLAMP_TO_BORDER'. Initially,
16466 `GL_TEXTURE_WRAP_S' is set to `GL_REPEAT'.
16467
16468
16469
16470`GL_TEXTURE_WRAP_T'
16471 Sets the wrap parameter for texture coordinate T to either
16472 `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE',
16473 `GL_MIRRORED_REPEAT', or `GL_REPEAT'. See the discussion under
16474 `GL_TEXTURE_WRAP_S'. Initially, `GL_TEXTURE_WRAP_T' is set to
16475 `GL_REPEAT'.
16476
16477`GL_TEXTURE_WRAP_R'
16478 Sets the wrap parameter for texture coordinate R to either
16479 `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE',
16480 `GL_MIRRORED_REPEAT', or `GL_REPEAT'. See the discussion under
16481 `GL_TEXTURE_WRAP_S'. Initially, `GL_TEXTURE_WRAP_R' is set to
16482 `GL_REPEAT'.
16483
16484`GL_TEXTURE_BORDER_COLOR'
16485 Sets a border color. PARAMS contains four values that comprise the
16486 RGBA color of the texture border. Integer color components are
16487 interpreted linearly such that the most positive integer maps to
16488 1.0, and the most negative integer maps to -1.0. The values are
16489 clamped to the range [0,1] when they are specified. Initially, the
16490 border color is (0, 0, 0, 0).
16491
16492`GL_TEXTURE_PRIORITY'
16493 Specifies the texture residence priority of the currently bound
16494 texture. Permissible values are in the range [0,1] . See
16495 `glPrioritizeTextures' and `glBindTexture' for more information.
16496
16497`GL_TEXTURE_COMPARE_MODE'
16498 Specifies the texture comparison mode for currently bound depth
16499 textures. That is, a texture whose internal format is
16500 `GL_DEPTH_COMPONENT_*'; see `glTexImage2D') Permissible values are:
16501
16502`GL_TEXTURE_COMPARE_FUNC'
16503 Specifies the comparison operator used when
16504 `GL_TEXTURE_COMPARE_MODE' is set to `GL_COMPARE_R_TO_TEXTURE'.
16505 Permissible values are: where R is the current interpolated texture
16506 coordinate, and D_T is the depth texture value sampled from the
16507 currently bound depth texture. RESULT is assigned to the either the
16508 luminance, intensity, or alpha (as specified by
16509 `GL_DEPTH_TEXTURE_MODE'.)
16510
16511`GL_DEPTH_TEXTURE_MODE'
16512 Specifies a single symbolic constant indicating how depth values
16513 should be treated during filtering and texture application.
16514 Accepted values are `GL_LUMINANCE', `GL_INTENSITY', and `GL_ALPHA'.
16515 The initial value is `GL_LUMINANCE'.
16516
16517`GL_GENERATE_MIPMAP'
16518 Specifies a boolean value that indicates if all levels of a mipmap
16519 array should be automatically updated when any modification to the
16520 base level mipmap is done. The initial value is `GL_FALSE'.
16521
16522`GL_COMPARE_R_TO_TEXTURE'
16523 Specifies that the interpolated and clamped R texture coordinate
16524 should be compared to the value in the currently bound depth
16525 texture. See the discussion of `GL_TEXTURE_COMPARE_FUNC' for
16526 details of how the comparison is evaluated. The result of the
16527 comparison is assigned to luminance, intensity, or alpha (as
16528 specified by `GL_DEPTH_TEXTURE_MODE').
16529
16530`GL_NONE'
16531 Specifies that the luminance, intensity, or alpha (as specified by
16532 `GL_DEPTH_TEXTURE_MODE') should be assigned the appropriate value
16533 from the currently bound depth texture.
16534
16535*Texture Comparison Function*
16536 *Computed result*
16537
16538`GL_LEQUAL'
16539 RESULT={(1.0), (0.0)\u2062\xa0(R<=D_T,), (R>D_T,),
16540
16541`GL_GEQUAL'
16542 RESULT={(1.0), (0.0)\u2062\xa0(R>=D_T,), (R<D_T,),
16543
16544`GL_LESS'
16545 RESULT={(1.0), (0.0)\u2062\xa0(R<D_T,), (R>=D_T,),
16546
16547`GL_GREATER'
16548 RESULT={(1.0), (0.0)\u2062\xa0(R>D_T,), (R<=D_T,),
8925f36f 16549
3c9b6116
AW
16550`GL_EQUAL'
16551 RESULT={(1.0), (0.0)\u2062\xa0(R=D_T,), (R≠D_T,),
8925f36f 16552
3c9b6116
AW
16553`GL_NOTEQUAL'
16554 RESULT={(1.0), (0.0)\u2062\xa0(R≠D_T,), (R=D_T,),
8925f36f 16555
3c9b6116
AW
16556`GL_ALWAYS'
16557 RESULT=`1.0'
16558
16559`GL_NEVER'
16560 RESULT=`0.0'
16561
16562`GL_INVALID_ENUM' is generated if TARGET or PNAME is not one of the
16563accepted defined values.
16564
16565`GL_INVALID_ENUM' is generated if PARAMS should have a defined constant
16566value (based on the value of PNAME) and does not.
16567
16568`GL_INVALID_OPERATION' is generated if `glTexParameter' is executed
16569between the execution of `glBegin' and the corresponding execution of
16570`glEnd'.")
8925f36f 16571
7ec693ed 16572(define-foreign-procedure
bb894c9d
AW
16573 ((glTexSubImage1D
16574 (target GLenum)
16575 (level GLint)
16576 (xoffset GLint)
16577 (width GLsizei)
16578 (format GLenum)
16579 (type GLenum)
16580 (data *)
16581 ->
16582 void))
3c9b6116
AW
16583 "Specify a one-dimensional texture subimage.
16584
16585TARGET
16586 Specifies the target texture. Must be `GL_TEXTURE_1D'.
16587
16588LEVEL
16589 Specifies the level-of-detail number. Level 0 is the base image
16590 level. Level N is the Nth mipmap reduction image.
16591
16592XOFFSET
16593 Specifies a texel offset in the x direction within the texture
16594 array.
16595
16596WIDTH
16597 Specifies the width of the texture subimage.
16598
16599FORMAT
16600 Specifies the format of the pixel data. The following symbolic
16601 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
16602 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
16603 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
16604
16605TYPE
16606 Specifies the data type of the pixel data. The following symbolic
16607 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
16608 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
16609 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16610 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
16611 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16612 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16613 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16614 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
16615
16616DATA
16617 Specifies a pointer to the image data in memory.
16618
16619Texturing maps a portion of a specified texture image onto each
16620graphical primitive for which texturing is enabled. To enable or disable
16621one-dimensional texturing, call `glEnable' and `glDisable' with argument
16622`GL_TEXTURE_1D'.
16623
16624`glTexSubImage1D' redefines a contiguous subregion of an existing
16625one-dimensional texture image. The texels referenced by DATA replace the
16626portion of the existing texture array with x indices XOFFSET and
16627XOFFSET+WIDTH-1 , inclusive. This region may not include any texels
16628outside the range of the texture array as it was originally specified.
16629It is not an error to specify a subtexture with width of 0, but such a
16630specification has no effect.
16631
16632If a non-zero named buffer object is bound to the
16633`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
16634image is specified, DATA is treated as a byte offset into the buffer
16635object's data store.
16636
16637`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
16638values.
16639
16640`GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
16641constant.
16642
16643`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
16644
16645`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
16646`GL_COLOR_INDEX'.
16647
16648`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
16649
16650`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
16651where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
16652
16653`GL_INVALID_VALUE' is generated if XOFFSET<-B , or if
16654(XOFFSET+WIDTH,)>(W-B,) , where W is the `GL_TEXTURE_WIDTH', and B is
16655the width of the `GL_TEXTURE_BORDER' of the texture image being
16656modified. Note that W includes twice the border width.
16657
16658`GL_INVALID_VALUE' is generated if WIDTH is less than 0.
16659
16660`GL_INVALID_OPERATION' is generated if the texture array has not been
16661defined by a previous `glTexImage1D' operation.
16662
16663`GL_INVALID_OPERATION' is generated if TYPE is one of
16664`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16665`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
16666is not `GL_RGB'.
16667
16668`GL_INVALID_OPERATION' is generated if TYPE is one of
16669`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16670`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16671`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16672`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
16673FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
16674
16675`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16676bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
16677data store is currently mapped.
16678
16679`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16680bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
16681unpacked from the buffer object such that the memory reads required
16682would exceed the data store size.
16683
16684`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16685bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
16686divisible into the number of bytes needed to store in memory a datum
16687indicated by TYPE.
16688
16689`GL_INVALID_OPERATION' is generated if `glTexSubImage1D' is executed
16690between the execution of `glBegin' and the corresponding execution of
16691`glEnd'.")
8925f36f 16692
7ec693ed 16693(define-foreign-procedure
bb894c9d
AW
16694 ((glTexSubImage2D
16695 (target GLenum)
16696 (level GLint)
16697 (xoffset GLint)
16698 (yoffset GLint)
16699 (width GLsizei)
16700 (height GLsizei)
16701 (format GLenum)
16702 (type GLenum)
16703 (data *)
16704 ->
16705 void))
3c9b6116
AW
16706 "Specify a two-dimensional texture subimage.
16707
16708TARGET
16709 Specifies the target texture. Must be `GL_TEXTURE_2D',
16710 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
16711 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
16712 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
16713 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
16714
16715LEVEL
16716 Specifies the level-of-detail number. Level 0 is the base image
16717 level. Level N is the Nth mipmap reduction image.
16718
16719XOFFSET
16720 Specifies a texel offset in the x direction within the texture
16721 array.
16722
16723YOFFSET
16724 Specifies a texel offset in the y direction within the texture
16725 array.
16726
16727WIDTH
16728 Specifies the width of the texture subimage.
16729
16730HEIGHT
16731 Specifies the height of the texture subimage.
16732
16733FORMAT
16734 Specifies the format of the pixel data. The following symbolic
16735 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
16736 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
16737 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
16738
16739TYPE
16740 Specifies the data type of the pixel data. The following symbolic
16741 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
16742 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
16743 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16744 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
16745 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16746 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16747 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16748 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
16749
16750DATA
16751 Specifies a pointer to the image data in memory.
16752
16753Texturing maps a portion of a specified texture image onto each
16754graphical primitive for which texturing is enabled. To enable and
16755disable two-dimensional texturing, call `glEnable' and `glDisable' with
16756argument `GL_TEXTURE_2D'.
16757
16758`glTexSubImage2D' redefines a contiguous subregion of an existing
16759two-dimensional texture image. The texels referenced by DATA replace the
16760portion of the existing texture array with x indices XOFFSET and
16761XOFFSET+WIDTH-1 , inclusive, and y indices YOFFSET and YOFFSET+HEIGHT-1
16762, inclusive. This region may not include any texels outside the range of
16763the texture array as it was originally specified. It is not an error to
16764specify a subtexture with zero width or height, but such a specification
16765has no effect.
16766
16767If a non-zero named buffer object is bound to the
16768`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
16769image is specified, DATA is treated as a byte offset into the buffer
16770object's data store.
16771
16772`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
16773`GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
16774`GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
16775`GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
16776
16777`GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
16778constant.
16779
16780`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
16781
16782`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
16783`GL_COLOR_INDEX'.
16784
16785`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
16786
16787`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
16788where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
16789
16790`GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
16791, YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , where W is the
16792`GL_TEXTURE_WIDTH', H is the `GL_TEXTURE_HEIGHT', and B is the border
16793width of the texture image being modified. Note that W and H include
16794twice the border width.
16795
16796`GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0.
16797
16798`GL_INVALID_OPERATION' is generated if the texture array has not been
16799defined by a previous `glTexImage2D' operation.
16800
16801`GL_INVALID_OPERATION' is generated if TYPE is one of
16802`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16803`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
16804is not `GL_RGB'.
16805
16806`GL_INVALID_OPERATION' is generated if TYPE is one of
16807`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16808`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16809`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16810`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
16811FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
16812
16813`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16814bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
16815data store is currently mapped.
16816
16817`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16818bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
16819unpacked from the buffer object such that the memory reads required
16820would exceed the data store size.
16821
16822`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16823bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
16824divisible into the number of bytes needed to store in memory a datum
16825indicated by TYPE.
16826
16827`GL_INVALID_OPERATION' is generated if `glTexSubImage2D' is executed
16828between the execution of `glBegin' and the corresponding execution of
16829`glEnd'.")
8925f36f 16830
7ec693ed 16831(define-foreign-procedure
bb894c9d
AW
16832 ((glTexSubImage3D
16833 (target GLenum)
16834 (level GLint)
16835 (xoffset GLint)
16836 (yoffset GLint)
16837 (zoffset GLint)
16838 (width GLsizei)
16839 (height GLsizei)
16840 (depth GLsizei)
16841 (format GLenum)
16842 (type GLenum)
16843 (data *)
16844 ->
16845 void))
3c9b6116
AW
16846 "Specify a three-dimensional texture subimage.
16847
16848TARGET
16849 Specifies the target texture. Must be `GL_TEXTURE_3D'.
16850
16851LEVEL
16852 Specifies the level-of-detail number. Level 0 is the base image
16853 level. Level N is the Nth mipmap reduction image.
16854
16855XOFFSET
16856 Specifies a texel offset in the x direction within the texture
16857 array.
16858
16859YOFFSET
16860 Specifies a texel offset in the y direction within the texture
16861 array.
16862
16863ZOFFSET
16864 Specifies a texel offset in the z direction within the texture
16865 array.
16866
16867WIDTH
16868 Specifies the width of the texture subimage.
16869
16870HEIGHT
16871 Specifies the height of the texture subimage.
16872
16873DEPTH
16874 Specifies the depth of the texture subimage.
16875
16876FORMAT
16877 Specifies the format of the pixel data. The following symbolic
16878 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
16879 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
16880 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
16881
16882TYPE
16883 Specifies the data type of the pixel data. The following symbolic
16884 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
16885 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
16886 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16887 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
16888 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16889 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16890 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16891 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
16892
16893DATA
16894 Specifies a pointer to the image data in memory.
16895
16896Texturing maps a portion of a specified texture image onto each
16897graphical primitive for which texturing is enabled. To enable and
16898disable three-dimensional texturing, call `glEnable' and `glDisable'
16899with argument `GL_TEXTURE_3D'.
16900
16901`glTexSubImage3D' redefines a contiguous subregion of an existing
16902three-dimensional texture image. The texels referenced by DATA replace
16903the portion of the existing texture array with x indices XOFFSET and
16904XOFFSET+WIDTH-1 , inclusive, y indices YOFFSET and YOFFSET+HEIGHT-1 ,
16905inclusive, and z indices ZOFFSET and ZOFFSET+DEPTH-1 , inclusive. This
16906region may not include any texels outside the range of the texture array
16907as it was originally specified. It is not an error to specify a
16908subtexture with zero width, height, or depth but such a specification
16909has no effect.
16910
16911If a non-zero named buffer object is bound to the
16912`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
16913image is specified, DATA is treated as a byte offset into the buffer
16914object's data store.
16915
16916`GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_3D'.
16917
16918`GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
16919constant.
16920
16921`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
16922
16923`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
16924`GL_COLOR_INDEX'.
16925
16926`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
16927
16928`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
16929where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
16930
16931`GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
16932, YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , or ZOFFSET<-B , or
16933(ZOFFSET+DEPTH,)>(D-B,) , where W is the `GL_TEXTURE_WIDTH', H is the
16934`GL_TEXTURE_HEIGHT', D is the `GL_TEXTURE_DEPTH' and B is the border
16935width of the texture image being modified. Note that W , H , and D
16936include twice the border width.
16937
16938`GL_INVALID_VALUE' is generated if WIDTH, HEIGHT, or DEPTH is less than
169390.
16940
16941`GL_INVALID_OPERATION' is generated if the texture array has not been
16942defined by a previous `glTexImage3D' operation.
16943
16944`GL_INVALID_OPERATION' is generated if TYPE is one of
16945`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16946`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
16947is not `GL_RGB'.
16948
16949`GL_INVALID_OPERATION' is generated if TYPE is one of
16950`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16951`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16952`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16953`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
16954FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
16955
16956`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16957bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
16958data store is currently mapped.
16959
16960`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16961bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
16962unpacked from the buffer object such that the memory reads required
16963would exceed the data store size.
16964
16965`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16966bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
16967divisible into the number of bytes needed to store in memory a datum
16968indicated by TYPE.
16969
16970`GL_INVALID_OPERATION' is generated if `glTexSubImage3D' is executed
16971between the execution of `glBegin' and the corresponding execution of
16972`glEnd'.")
8925f36f 16973
7ec693ed 16974(define-foreign-procedure
bb894c9d
AW
16975 ((glTranslated
16976 (x GLdouble)
16977 (y GLdouble)
16978 (z GLdouble)
16979 ->
16980 void))
3c9b6116
AW
16981 "Multiply the current matrix by a translation matrix.
16982
16983X
16984 Y
16985
16986 Z
16987
16988 Specify the X, Y, and Z coordinates of a translation vector.
16989
16990`glTranslate' produces a translation by (X,YZ) . The current matrix (see
16991`glMatrixMode') is multiplied by this translation matrix, with the
16992product replacing the current matrix, as if `glMultMatrix' were called
16993with the following matrix for its argument:
16994
16995((1 0 0 X), (0 1 0 Y), (0 0 1 Z), (0 0 0 1),)
16996
16997
16998
16999If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all
17000objects drawn after a call to `glTranslate' are translated.
17001
17002Use `glPushMatrix' and `glPopMatrix' to save and restore the
17003untranslated coordinate system.
17004
17005`GL_INVALID_OPERATION' is generated if `glTranslate' is executed between
17006the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 17007
7ec693ed 17008(define-foreign-procedure
bb894c9d
AW
17009 ((glUniform1f
17010 (location GLint)
17011 (v0 GLfloat)
17012 ->
17013 void)
17014 (glUniform2f
17015 (location GLint)
17016 (v0 GLfloat)
17017 (v1 GLfloat)
17018 ->
17019 void)
17020 (glUniform3f
17021 (location GLint)
17022 (v0 GLfloat)
17023 (v1 GLfloat)
17024 (v2 GLfloat)
17025 ->
17026 void)
17027 (glUniform4f
17028 (location GLint)
17029 (v0 GLfloat)
17030 (v1 GLfloat)
17031 (v2 GLfloat)
17032 (v3 GLfloat)
17033 ->
17034 void)
17035 (glUniform1i (location GLint) (v0 GLint) -> void)
17036 (glUniform2i
17037 (location GLint)
17038 (v0 GLint)
17039 (v1 GLint)
17040 ->
17041 void)
17042 (glUniform3i
17043 (location GLint)
17044 (v0 GLint)
17045 (v1 GLint)
17046 (v2 GLint)
17047 ->
17048 void)
17049 (glUniform4i
17050 (location GLint)
17051 (v0 GLint)
17052 (v1 GLint)
17053 (v2 GLint)
17054 (v3 GLint)
17055 ->
17056 void))
3c9b6116
AW
17057 "Specify the value of a uniform variable for the current program object.
17058
17059LOCATION
17060 Specifies the location of the uniform variable to be modified.
17061
17062V0, V1, V2, V3
17063 Specifies the new values to be used for the specified uniform
17064 variable.
17065
17066`glUniform' modifies the value of a uniform variable or a uniform
17067variable array. The location of the uniform variable to be modified is
17068specified by LOCATION, which should be a value returned by
17069`glGetUniformLocation'. `glUniform' operates on the program object that
17070was made part of current state by calling `glUseProgram'.
17071
17072The commands `glUniform{1|2|3|4}{f|i}' are used to change the value of
17073the uniform variable specified by LOCATION using the values passed as
17074arguments. The number specified in the command should match the number
17075of components in the data type of the specified uniform variable (e.g.,
17076`1' for float, int, bool; `2' for vec2, ivec2, bvec2, etc.). The suffix
17077`f' indicates that floating-point values are being passed; the suffix
17078`i' indicates that integer values are being passed, and this type should
17079also match the data type of the specified uniform variable. The `i'
17080variants of this function should be used to provide values for uniform
17081variables defined as int, ivec2, ivec3, ivec4, or arrays of these. The
17082`f' variants should be used to provide values for uniform variables of
17083type float, vec2, vec3, vec4, or arrays of these. Either the `i' or the
17084`f' variants may be used to provide values for uniform variables of type
17085bool, bvec2, bvec3, bvec4, or arrays of these. The uniform variable will
17086be set to false if the input value is 0 or 0.0f, and it will be set to
17087true otherwise.
17088
17089All active uniform variables defined in a program object are initialized
17090to 0 when the program object is linked successfully. They retain the
17091values assigned to them by a call to `glUniform ' until the next
17092successful link operation occurs on the program object, when they are
17093once again initialized to 0.
17094
17095The commands `glUniform{1|2|3|4}{f|i}v' can be used to modify a single
17096uniform variable or a uniform variable array. These commands pass a
17097count and a pointer to the values to be loaded into a uniform variable
17098or a uniform variable array. A count of 1 should be used if modifying
17099the value of a single uniform variable, and a count of 1 or greater can
17100be used to modify an entire array or part of an array. When loading N
17101elements starting at an arbitrary position M in a uniform variable
17102array, elements M + N - 1 in the array will be replaced with the new
17103values. If M + N - 1 is larger than the size of the uniform variable
17104array, values for all array elements beyond the end of the array will be
17105ignored. The number specified in the name of the command indicates the
17106number of components for each element in VALUE, and it should match the
17107number of components in the data type of the specified uniform variable
17108(e.g., `1' for float, int, bool; `2' for vec2, ivec2, bvec2, etc.). The
17109data type specified in the name of the command must match the data type
17110for the specified uniform variable as described previously for
17111`glUniform{1|2|3|4}{f|i}'.
17112
17113For uniform variable arrays, each element of the array is considered to
17114be of the type indicated in the name of the command (e.g., `glUniform3f'
17115or `glUniform3fv' can be used to load a uniform variable array of type
17116vec3). The number of elements of the uniform variable array to be
17117modified is specified by COUNT
17118
17119The commands `glUniformMatrix{2|3|4|2x3|3x2|2x4|4x2|3x4|4x3}fv' are used
17120to modify a matrix or an array of matrices. The numbers in the command
17121name are interpreted as the dimensionality of the matrix. The number `2'
17122indicates a 2 × 2 matrix (i.e., 4 values), the number `3' indicates a 3
17123× 3 matrix (i.e., 9 values), and the number `4' indicates a 4 × 4 matrix
17124(i.e., 16 values). Non-square matrix dimensionality is explicit, with
17125the first number representing the number of columns and the second
17126number representing the number of rows. For example, `2x4' indicates a 2
17127× 4 matrix with 2 columns and 4 rows (i.e., 8 values). If TRANSPOSE is
17128`GL_FALSE', each matrix is assumed to be supplied in column major order.
17129If TRANSPOSE is `GL_TRUE', each matrix is assumed to be supplied in row
17130major order. The COUNT argument indicates the number of matrices to be
17131passed. A count of 1 should be used if modifying the value of a single
17132matrix, and a count greater than 1 can be used to modify an array of
17133matrices.
17134
17135`GL_INVALID_OPERATION' is generated if there is no current program
17136object.
17137
17138`GL_INVALID_OPERATION' is generated if the size of the uniform variable
17139declared in the shader does not match the size indicated by the
17140`glUniform' command.
17141
17142`GL_INVALID_OPERATION' is generated if one of the integer variants of
17143this function is used to load a uniform variable of type float, vec2,
17144vec3, vec4, or an array of these, or if one of the floating-point
17145variants of this function is used to load a uniform variable of type
17146int, ivec2, ivec3, or ivec4, or an array of these.
17147
17148`GL_INVALID_OPERATION' is generated if LOCATION is an invalid uniform
17149location for the current program object and LOCATION is not equal to -1.
17150
17151`GL_INVALID_VALUE' is generated if COUNT is less than 0.
17152
17153`GL_INVALID_OPERATION' is generated if COUNT is greater than 1 and the
17154indicated uniform variable is not an array variable.
17155
17156`GL_INVALID_OPERATION' is generated if a sampler is loaded using a
17157command other than `glUniform1i' and `glUniform1iv'.
17158
17159`GL_INVALID_OPERATION' is generated if `glUniform' is executed between
17160the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 17161
7ec693ed 17162(define-foreign-procedure
bb894c9d 17163 ((glUseProgram (program GLuint) -> void))
3c9b6116
AW
17164 "Installs a program object as part of current rendering state.
17165
17166PROGRAM
17167 Specifies the handle of the program object whose executables are to
17168 be used as part of current rendering state.
17169
17170`glUseProgram' installs the program object specified by PROGRAM as part
17171of current rendering state. One or more executables are created in a
17172program object by successfully attaching shader objects to it with
17173`glAttachShader', successfully compiling the shader objects with
17174`glCompileShader', and successfully linking the program object with
17175`glLinkProgram'.
17176
17177A program object will contain an executable that will run on the vertex
17178processor if it contains one or more shader objects of type
17179`GL_VERTEX_SHADER' that have been successfully compiled and linked.
17180Similarly, a program object will contain an executable that will run on
17181the fragment processor if it contains one or more shader objects of type
17182`GL_FRAGMENT_SHADER' that have been successfully compiled and linked.
17183
17184Successfully installing an executable on a programmable processor will
17185cause the corresponding fixed functionality of OpenGL to be disabled.
17186Specifically, if an executable is installed on the vertex processor, the
17187OpenGL fixed functionality will be disabled as follows.
17188
17189 * The projection matrix is not applied to vertex coordinates.
17190
17191 * The texture matrices are not applied to texture coordinates.
17192
17193 * Normals are not transformed to eye coordinates.
17194
17195 * Normals are not rescaled or normalized.
17196
17197 * Normalization of `GL_AUTO_NORMAL' evaluated normals is not
17198 performed.
17199
17200 * Texture coordinates are not generated automatically.
17201
17202 * Per-vertex lighting is not performed.
17203
17204 * Color material computations are not performed.
17205
17206 * Color index lighting is not performed.
17207
17208 * This list also applies when setting the current raster position.
17209
17210The executable that is installed on the vertex processor is expected to
17211implement any or all of the desired functionality from the preceding
17212list. Similarly, if an executable is installed on the fragment
17213processor, the OpenGL fixed functionality will be disabled as follows.
17214
17215 * Texture application is not applied.
17216
17217 * Color sum is not applied.
17218
17219 * Fog is not applied.
17220
17221Again, the fragment shader that is installed is expected to implement
17222any or all of the desired functionality from the preceding list.
17223
17224While a program object is in use, applications are free to modify
17225attached shader objects, compile attached shader objects, attach
17226additional shader objects, and detach or delete shader objects. None of
17227these operations will affect the executables that are part of the
17228current state. However, relinking the program object that is currently
17229in use will install the program object as part of the current rendering
17230state if the link operation was successful (see `glLinkProgram' ). If
17231the program object currently in use is relinked unsuccessfully, its link
17232status will be set to `GL_FALSE', but the executables and associated
17233state will remain part of the current state until a subsequent call to
17234`glUseProgram' removes it from use. After it is removed from use, it
17235cannot be made part of current state until it has been successfully
17236relinked.
17237
17238If PROGRAM contains shader objects of type `GL_VERTEX_SHADER' but it
17239does not contain shader objects of type `GL_FRAGMENT_SHADER', an
17240executable will be installed on the vertex processor, but fixed
17241functionality will be used for fragment processing. Similarly, if
17242PROGRAM contains shader objects of type `GL_FRAGMENT_SHADER' but it does
17243not contain shader objects of type `GL_VERTEX_SHADER', an executable
17244will be installed on the fragment processor, but fixed functionality
17245will be used for vertex processing. If PROGRAM is 0, the programmable
17246processors will be disabled, and fixed functionality will be used for
17247both vertex and fragment processing.
17248
17249`GL_INVALID_VALUE' is generated if PROGRAM is neither 0 nor a value
17250generated by OpenGL.
17251
17252`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
17253
17254`GL_INVALID_OPERATION' is generated if PROGRAM could not be made part of
17255current state.
17256
17257`GL_INVALID_OPERATION' is generated if `glUseProgram' is executed
17258between the execution of `glBegin' and the corresponding execution of
17259`glEnd'.")
8925f36f 17260
7ec693ed 17261(define-foreign-procedure
bb894c9d 17262 ((glValidateProgram (program GLuint) -> void))
3c9b6116
AW
17263 "Validates a program object.
17264
17265PROGRAM
17266 Specifies the handle of the program object to be validated.
17267
17268`glValidateProgram' checks to see whether the executables contained in
17269PROGRAM can execute given the current OpenGL state. The information
17270generated by the validation process will be stored in PROGRAM's
17271information log. The validation information may consist of an empty
17272string, or it may be a string containing information about how the
17273current program object interacts with the rest of current OpenGL state.
17274This provides a way for OpenGL implementers to convey more information
17275about why the current program is inefficient, suboptimal, failing to
17276execute, and so on.
17277
17278The status of the validation operation will be stored as part of the
17279program object's state. This value will be set to `GL_TRUE' if the
17280validation succeeded, and `GL_FALSE' otherwise. It can be queried by
17281calling `glGetProgram' with arguments PROGRAM and `GL_VALIDATE_STATUS'.
17282If validation is successful, PROGRAM is guaranteed to execute given the
17283current state. Otherwise, PROGRAM is guaranteed to not execute.
17284
17285This function is typically useful only during application development.
17286The informational string stored in the information log is completely
17287implementation dependent; therefore, an application should not expect
17288different OpenGL implementations to produce identical information
17289strings.
17290
17291`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
17292OpenGL.
17293
17294`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
17295
17296`GL_INVALID_OPERATION' is generated if `glValidateProgram' is executed
17297between the execution of `glBegin' and the corresponding execution of
17298`glEnd'.")
8925f36f 17299
7ec693ed 17300(define-foreign-procedure
bb894c9d
AW
17301 ((glVertexAttribPointer
17302 (index GLuint)
17303 (size GLint)
17304 (type GLenum)
17305 (normalized GLboolean)
17306 (stride GLsizei)
17307 (pointer *)
17308 ->
17309 void))
3c9b6116
AW
17310 "Define an array of generic vertex attribute data.
17311
17312INDEX
17313 Specifies the index of the generic vertex attribute to be modified.
17314
17315SIZE
17316 Specifies the number of components per generic vertex attribute.
17317 Must be 1, 2, 3, or 4. The initial value is 4.
17318
17319TYPE
17320 Specifies the data type of each component in the array. Symbolic
17321 constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
17322 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', or
17323 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
17324
17325NORMALIZED
17326 Specifies whether fixed-point data values should be normalized
17327 (`GL_TRUE') or converted directly as fixed-point values
17328 (`GL_FALSE') when they are accessed.
17329
17330STRIDE
17331 Specifies the byte offset between consecutive generic vertex
17332 attributes. If STRIDE is 0, the generic vertex attributes are
17333 understood to be tightly packed in the array. The initial value is
17334 0.
17335
17336POINTER
17337 Specifies a pointer to the first component of the first generic
17338 vertex attribute in the array. The initial value is 0.
17339
17340`glVertexAttribPointer' specifies the location and data format of the
17341array of generic vertex attributes at index INDEX to use when rendering.
17342SIZE specifies the number of components per attribute and must be 1, 2,
173433, or 4. TYPE specifies the data type of each component, and STRIDE
17344specifies the byte stride from one attribute to the next, allowing
17345vertices and attributes to be packed into a single array or stored in
17346separate arrays. If set to `GL_TRUE', NORMALIZED indicates that values
17347stored in an integer format are to be mapped to the range [-1,1] (for
17348signed values) or [0,1] (for unsigned values) when they are accessed and
17349converted to floating point. Otherwise, values will be converted to
17350floats directly without normalization.
17351
17352If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
17353target (see `glBindBuffer') while a generic vertex attribute array is
17354specified, POINTER is treated as a byte offset into the buffer object's
17355data store. Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING')
17356is saved as generic vertex attribute array client-side state
17357(`GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING') for index INDEX.
17358
17359When a generic vertex attribute array is specified, SIZE, TYPE,
17360NORMALIZED, STRIDE, and POINTER are saved as client-side state, in
17361addition to the current vertex array buffer object binding.
17362
17363To enable and disable a generic vertex attribute array, call
17364`glEnableVertexAttribArray' and `glDisableVertexAttribArray' with INDEX.
17365If enabled, the generic vertex attribute array is used when
17366`glArrayElement', `glDrawArrays', `glMultiDrawArrays', `glDrawElements',
17367`glMultiDrawElements', or `glDrawRangeElements' is called.
17368
17369`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
17370`GL_MAX_VERTEX_ATTRIBS'.
17371
17372`GL_INVALID_VALUE' is generated if SIZE is not 1, 2, 3, or 4.
17373
17374`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
17375
17376`GL_INVALID_VALUE' is generated if STRIDE is negative.")
8925f36f 17377
7ec693ed 17378(define-foreign-procedure
bb894c9d
AW
17379 ((glVertexAttrib1s
17380 (index GLuint)
17381 (v0 GLshort)
17382 ->
17383 void)
17384 (glVertexAttrib1d
17385 (index GLuint)
17386 (v0 GLdouble)
17387 ->
17388 void)
17389 (glVertexAttrib2s
17390 (index GLuint)
17391 (v0 GLshort)
17392 (v1 GLshort)
17393 ->
17394 void)
17395 (glVertexAttrib2d
17396 (index GLuint)
17397 (v0 GLdouble)
17398 (v1 GLdouble)
17399 ->
17400 void)
17401 (glVertexAttrib3s
17402 (index GLuint)
17403 (v0 GLshort)
17404 (v1 GLshort)
17405 (v2 GLshort)
17406 ->
17407 void)
17408 (glVertexAttrib3d
17409 (index GLuint)
17410 (v0 GLdouble)
17411 (v1 GLdouble)
17412 (v2 GLdouble)
17413 ->
17414 void)
17415 (glVertexAttrib4s
17416 (index GLuint)
17417 (v0 GLshort)
17418 (v1 GLshort)
17419 (v2 GLshort)
17420 (v3 GLshort)
17421 ->
17422 void)
17423 (glVertexAttrib4d
17424 (index GLuint)
17425 (v0 GLdouble)
17426 (v1 GLdouble)
17427 (v2 GLdouble)
17428 (v3 GLdouble)
17429 ->
17430 void)
17431 (glVertexAttrib4Nub
17432 (index GLuint)
17433 (v0 GLubyte)
17434 (v1 GLubyte)
17435 (v2 GLubyte)
17436 (v3 GLubyte)
17437 ->
17438 void))
3c9b6116
AW
17439 "Specifies the value of a generic vertex attribute.
17440
17441INDEX
17442 Specifies the index of the generic vertex attribute to be modified.
17443
17444V0, V1, V2, V3
17445 Specifies the new values to be used for the specified vertex
17446 attribute.
17447
17448OpenGL defines a number of standard vertex attributes that applications
17449can modify with standard API entry points (color, normal, texture
17450coordinates, etc.). The `glVertexAttrib' family of entry points allows
17451an application to pass generic vertex attributes in numbered locations.
17452
17453Generic attributes are defined as four-component values that are
17454organized into an array. The first entry of this array is numbered 0,
17455and the size of the array is specified by the implementation-dependent
17456constant `GL_MAX_VERTEX_ATTRIBS'. Individual elements of this array can
17457be modified with a `glVertexAttrib' call that specifies the index of the
17458element to be modified and a value for that element.
17459
17460These commands can be used to specify one, two, three, or all four
17461components of the generic vertex attribute specified by INDEX. A `1' in
17462the name of the command indicates that only one value is passed, and it
17463will be used to modify the first component of the generic vertex
17464attribute. The second and third components will be set to 0, and the
17465fourth component will be set to 1. Similarly, a `2' in the name of the
17466command indicates that values are provided for the first two components,
17467the third component will be set to 0, and the fourth component will be
17468set to 1. A `3' in the name of the command indicates that values are
17469provided for the first three components and the fourth component will be
17470set to 1, whereas a `4' in the name indicates that values are provided
17471for all four components.
17472
17473The letters `s', `f', `i', `d', `ub', `us', and `ui' indicate whether
17474the arguments are of type short, float, int, double, unsigned byte,
17475unsigned short, or unsigned int. When `v' is appended to the name, the
17476commands can take a pointer to an array of such values. The commands
17477containing `N' indicate that the arguments will be passed as fixed-point
17478values that are scaled to a normalized range according to the component
17479conversion rules defined by the OpenGL specification. Signed values are
17480understood to represent fixed-point values in the range [-1,1], and
17481unsigned values are understood to represent fixed-point values in the
17482range [0,1].
17483
17484OpenGL Shading Language attribute variables are allowed to be of type
17485mat2, mat3, or mat4. Attributes of these types may be loaded using the
17486`glVertexAttrib' entry points. Matrices must be loaded into successive
17487generic attribute slots in column major order, with one column of the
17488matrix in each generic attribute slot.
17489
17490A user-defined attribute variable declared in a vertex shader can be
17491bound to a generic attribute index by calling `glBindAttribLocation'.
17492This allows an application to use more descriptive variable names in a
17493vertex shader. A subsequent change to the specified generic vertex
17494attribute will be immediately reflected as a change to the corresponding
17495attribute variable in the vertex shader.
17496
17497The binding between a generic vertex attribute index and a user-defined
17498attribute variable in a vertex shader is part of the state of a program
17499object, but the current value of the generic vertex attribute is not.
17500The value of each generic vertex attribute is part of current state,
17501just like standard vertex attributes, and it is maintained even if a
17502different program object is used.
17503
17504An application may freely modify generic vertex attributes that are not
17505bound to a named vertex shader attribute variable. These values are
17506simply maintained as part of current state and will not be accessed by
17507the vertex shader. If a generic vertex attribute bound to an attribute
17508variable in a vertex shader is not updated while the vertex shader is
17509executing, the vertex shader will repeatedly use the current value for
17510the generic vertex attribute.
17511
17512The generic vertex attribute with index 0 is the same as the vertex
17513position attribute previously defined by OpenGL. A `glVertex2',
17514`glVertex3', or `glVertex4' command is completely equivalent to the
17515corresponding `glVertexAttrib' command with an index argument of 0. A
17516vertex shader can access generic vertex attribute 0 by using the
17517built-in attribute variable GL_VERTEX. There are no current values for
17518generic vertex attribute 0. This is the only generic vertex attribute
17519with this property; calls to set other standard vertex attributes can be
17520freely mixed with calls to set any of the other generic vertex
17521attributes.
17522
17523`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
17524`GL_MAX_VERTEX_ATTRIBS'.")
8925f36f 17525
7ec693ed 17526(define-foreign-procedure
bb894c9d
AW
17527 ((glVertexPointer
17528 (size GLint)
17529 (type GLenum)
17530 (stride GLsizei)
17531 (pointer *)
17532 ->
17533 void))
3c9b6116
AW
17534 "Define an array of vertex data.
17535
17536SIZE
17537 Specifies the number of coordinates per vertex. Must be 2, 3, or 4.
17538 The initial value is 4.
17539
17540TYPE
17541 Specifies the data type of each coordinate in the array. Symbolic
17542 constants `GL_SHORT', `GL_INT', `GL_FLOAT', or `GL_DOUBLE' are
17543 accepted. The initial value is `GL_FLOAT'.
17544
17545STRIDE
17546 Specifies the byte offset between consecutive vertices. If STRIDE
17547 is 0, the vertices are understood to be tightly packed in the
17548 array. The initial value is 0.
17549
17550POINTER
17551 Specifies a pointer to the first coordinate of the first vertex in
17552 the array. The initial value is 0.
17553
17554`glVertexPointer' specifies the location and data format of an array of
17555vertex coordinates to use when rendering. SIZE specifies the number of
17556coordinates per vertex, and must be 2, 3, or 4. TYPE specifies the data
17557type of each coordinate, and STRIDE specifies the byte stride from one
17558vertex to the next, allowing vertices and attributes to be packed into a
17559single array or stored in separate arrays. (Single-array storage may be
17560more efficient on some implementations; see `glInterleavedArrays'.)
17561
17562If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
17563target (see `glBindBuffer') while a vertex array is specified, POINTER
17564is treated as a byte offset into the buffer object's data store. Also,
17565the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as vertex
17566array client-side state (`GL_VERTEX_ARRAY_BUFFER_BINDING').
17567
17568When a vertex array is specified, SIZE, TYPE, STRIDE, and POINTER are
17569saved as client-side state, in addition to the current vertex array
17570buffer object binding.
17571
17572To enable and disable the vertex array, call `glEnableClientState' and
17573`glDisableClientState' with the argument `GL_VERTEX_ARRAY'. If enabled,
17574the vertex array is used when `glArrayElement', `glDrawArrays',
17575`glMultiDrawArrays', `glDrawElements', `glMultiDrawElements', or
17576`glDrawRangeElements' is called.
17577
17578`GL_INVALID_VALUE' is generated if SIZE is not 2, 3, or 4.
17579
17580`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
17581
17582`GL_INVALID_VALUE' is generated if STRIDE is negative.")
8925f36f 17583
7ec693ed 17584(define-foreign-procedure
bb894c9d
AW
17585 ((glVertex2i (x GLint) (y GLint) -> void)
17586 (glVertex2d (x GLdouble) (y GLdouble) -> void)
17587 (glVertex3i
17588 (x GLint)
17589 (y GLint)
17590 (z GLint)
17591 ->
17592 void)
17593 (glVertex3d
17594 (x GLdouble)
17595 (y GLdouble)
17596 (z GLdouble)
17597 ->
17598 void)
17599 (glVertex4i
17600 (x GLint)
17601 (y GLint)
17602 (z GLint)
17603 (w GLint)
17604 ->
17605 void)
17606 (glVertex4d
17607 (x GLdouble)
17608 (y GLdouble)
17609 (z GLdouble)
17610 (w GLdouble)
17611 ->
17612 void))
3c9b6116
AW
17613 "Specify a vertex.
17614
17615X
17616 Y
17617
17618 Z
17619
17620 W
17621
17622 Specify X, Y, Z, and W coordinates of a vertex. Not all parameters
17623 are present in all forms of the command.
17624
17625`glVertex' commands are used within `glBegin'/`glEnd' pairs to specify
17626point, line, and polygon vertices. The current color, normal, texture
17627coordinates, and fog coordinate are associated with the vertex when
17628`glVertex' is called.
17629
17630When only X and Y are specified, Z defaults to 0 and W defaults to 1.
17631When X , Y , and Z are specified, W defaults to 1.")
8925f36f 17632
7ec693ed 17633(define-foreign-procedure
bb894c9d
AW
17634 ((glViewport
17635 (x GLint)
17636 (y GLint)
17637 (width GLsizei)
17638 (height GLsizei)
17639 ->
17640 void))
3c9b6116
AW
17641 "Set the viewport.
17642
17643X
17644 Y
17645
17646 Specify the lower left corner of the viewport rectangle, in pixels.
17647 The initial value is (0,0).
17648
17649WIDTH
17650 HEIGHT
17651
17652 Specify the width and height of the viewport. When a GL context is
17653 first attached to a window, WIDTH and HEIGHT are set to the
17654 dimensions of that window.
17655
17656`glViewport' specifies the affine transformation of X and Y from
17657normalized device coordinates to window coordinates. Let (X_ND,Y_ND) be
17658normalized device coordinates. Then the window coordinates (X_W,Y_W) are
17659computed as follows:
17660
17661X_W=(X_ND+1,)\u2062(WIDTH/2,)+X
17662
17663Y_W=(Y_ND+1,)\u2062(HEIGHT/2,)+Y
17664
17665Viewport width and height are silently clamped to a range that depends
17666on the implementation. To query this range, call `glGet' with argument
17667`GL_MAX_VIEWPORT_DIMS'.
17668
17669`GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
17670
17671`GL_INVALID_OPERATION' is generated if `glViewport' is executed between
17672the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 17673
7ec693ed 17674(define-foreign-procedure
bb894c9d
AW
17675 ((glWindowPos2i (x GLint) (y GLint) -> void)
17676 (glWindowPos2d (x GLdouble) (y GLdouble) -> void)
17677 (glWindowPos3i
17678 (x GLint)
17679 (y GLint)
17680 (z GLint)
17681 ->
17682 void)
17683 (glWindowPos3d
17684 (x GLdouble)
17685 (y GLdouble)
17686 (z GLdouble)
17687 ->
17688 void))
3c9b6116
AW
17689 "Specify the raster position in window coordinates for pixel operations.
17690
17691X
17692 Y
17693
17694 Z
17695
17696 Specify the X , Y , Z coordinates for the raster position.
17697
17698The GL maintains a 3D position in window coordinates. This position,
17699called the raster position, is used to position pixel and bitmap write
17700operations. It is maintained with subpixel accuracy. See `glBitmap',
17701`glDrawPixels', and `glCopyPixels'.
17702
17703`glWindowPos2' specifies the X and Y coordinates, while Z is implicitly
17704set to 0. `glWindowPos3' specifies all three coordinates. The W
17705coordinate of the current raster position is always set to 1.0.
17706
17707`glWindowPos' directly updates the X and Y coordinates of the current
17708raster position with the values specified. That is, the values are
17709neither transformed by the current modelview and projection matrices,
17710nor by the viewport-to-window transform. The Z coordinate of the current
17711raster position is updated in the following manner:
17712
17713Z={(N), (F), (N+Z×(F-N,),)\u2062(IF\u2062Z<=0), (IF\u2062Z>=1), (`otherwise',),
17714
17715
17716
17717where N is `GL_DEPTH_RANGE''s near value, and F is `GL_DEPTH_RANGE''s
17718far value. See `glDepthRange'.
17719
17720The specified coordinates are not clip-tested, causing the raster
17721position to always be valid.
17722
8925f36f 17723The current raster position also includes some associated color data and
3c9b6116
AW
17724texture coordinates. If lighting is enabled, then
17725`GL_CURRENT_RASTER_COLOR' (in RGBA mode) or `GL_CURRENT_RASTER_INDEX'
8925f36f 17726(in color index mode) is set to the color produced by the lighting
3c9b6116
AW
17727calculation (see `glLight', `glLightModel', and `glShadeModel'). If
17728lighting is disabled, current color (in RGBA mode, state variable
17729`GL_CURRENT_COLOR') or color index (in color index mode, state variable
17730`GL_CURRENT_INDEX') is used to update the current raster color.
17731`GL_CURRENT_RASTER_SECONDARY_COLOR' (in RGBA mode) is likewise updated.
17732
17733Likewise, `GL_CURRENT_RASTER_TEXTURE_COORDS' is updated as a function of
17734`GL_CURRENT_TEXTURE_COORDS', based on the texture matrix and the texture
17735generation functions (see `glTexGen'). The `GL_CURRENT_RASTER_DISTANCE'
17736is set to the `GL_CURRENT_FOG_COORD'.
17737
17738
17739
17740`GL_INVALID_OPERATION' is generated if `glWindowPos' is executed between
17741the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 17742