1
# bgl module (OpenGL wrapper)
4
B{New}: some GLU functions: L{gluLookAt}, etc.
6
This module wraps OpenGL constants and functions, making them available from
9
The complete list can be retrieved from the module itself, by listing its
10
contents: dir(bgl). A simple search on the net can point to more
11
than enough material to teach OpenGL programming, from books to many
12
collections of tutorials.
14
The "red book": "I{OpenGL Programming Guide: The Official Guide to Learning
15
OpenGL}" and the online NeHe tutorials are two of the best resources.
17
@note: you can use the L{Image} module and L{Image.Image} BPy object to load
18
and set textures. See L{Image.Image.glLoad} and L{Image.Image.glFree},
20
@see: U{www.opengl.org}
21
@see: U{nehe.gamedev.net}
24
def glAccum(op, value):
26
Operate on the accumulation buffer
27
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/accum.html}
29
@type op: Enumerated constant
30
@param op: The accumulation buffer operation.
32
@param value: a value used in the accumulation buffer operation.
35
def glAlphaFunc(func, ref):
37
Specify the alpha test function
38
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/alphafunc.html}
40
@type func: Enumerated constant
41
@param func: Specifies the alpha comparison function.
43
@param ref: The reference value that incoming alpha values are compared to.
44
Clamped between 0 and 1.
47
def glAreTexturesResident(n, textures, residences):
49
Determine if textures are loaded in texture memory
50
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/aretexturesresident.html}
53
@param n: Specifies the number of textures to be queried.
54
@type textures: Buffer object I{type GL_INT}
55
@param textures: Specifies an array containing the names of the textures to be queried
56
@type residences: Buffer object I{type GL_INT} (boolean)
57
@param residences: An array in which the texture residence status in returned.The residence status of a
58
texture named by an element of textures is returned in the corresponding element of residences.
63
Delimit the vertices of a primitive or a group of like primatives
64
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/begin.html}
66
@type mode: Enumerated constant
67
@param mode: Specifies the primitive that will be create from vertices between glBegin and
71
def glBindTexture(target, texture):
73
Bind a named texture to a texturing target
74
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/bindtexture.html}
76
@type target: Enumerated constant
77
@param target: Specifies the target to which the texture is bound.
78
@type texture: unsigned int
79
@param texture: Specifies the name of a texture.
82
def glBitmap(width, height, xorig, yorig, xmove, ymove, bitmap):
85
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/bitmap.html}
87
@type width, height: int
88
@param width, height: Specify the pixel width and height of the bitmap image.
89
@type xorig, yorig: float
90
@param xorig, yorig: Specify the location of the origin in the bitmap image. The origin is measured
91
from the lower left corner of the bitmap, with right and up being the positive axes.
92
@type xmove, ymove: float
93
@param xmove, ymove: Specify the x and y offsets to be added to the current raster position after
95
@type bitmap: Buffer object I{type GL_BYTE}
96
@param bitmap: Specifies the address of the bitmap image.
99
def glBlendFunc(sfactor, dfactor):
101
Specify pixel arithmetic
102
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/blendfunc.html}
104
@type sfactor: Enumerated constant
105
@param sfactor: Specifies how the red, green, blue, and alpha source blending factors are
107
@type dfactor: Enumerated constant
108
@param dfactor: Specifies how the red, green, blue, and alpha destination blending factors are
112
def glCallList(list):
114
Execute a display list
115
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/calllist.html}
117
@type list: unsigned int
118
@param list: Specifies the integer name of the display list to be executed.
121
def glCallLists(n, type, lists):
123
Execute a list of display lists
124
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/calllists.html}
127
@param n: Specifies the number of display lists to be executed.
128
@type type: Enumerated constant
129
@param type: Specifies the type of values in lists.
130
@type lists: Buffer object
131
@param lists: Specifies the address of an array of name offsets in the display list.
132
The pointer type is void because the offsets can be bytes, shorts, ints, or floats,
133
depending on the value of type.
138
Clear buffers to preset values
139
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clear.html}
141
@type mask: Enumerated constant(s)
142
@param mask: Bitwise OR of masks that indicate the buffers to be cleared.
145
def glClearAccum(red, green, blue, alpha):
147
Specify clear values for the accumulation buffer
148
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearaccum.html}
150
@type red, green, blue, alpha: float
151
@param red, green, blue, alpha: Specify the red, green, blue, and alpha values used when the
152
accumulation buffer is cleared. The initial values are all 0.
155
def glClearColor(red, green, blue, alpha):
157
Specify clear values for the color buffers
158
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearcolor.html}
160
@type red, green, blue, alpha: float
161
@param red, green, blue, alpha: Specify the red, green, blue, and alpha values used when the
162
color buffers are cleared. The initial values are all 0.
165
def glClearDepth(depth):
167
Specify the clear value for the depth buffer
168
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/cleardepth.html}
171
@param depth: Specifies the depth value used when the depth buffer is cleared.
172
The initial value is 1.
177
Specify the clear value for the color index buffers
178
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearindex.html}
181
@param c: Specifies the index used when the color index buffers are cleared.
182
The initial value is 0.
185
def glClearStencil(s):
187
Specify the clear value for the stencil buffer
188
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearstencil.html}
191
@param s: Specifies the index used when the stencil buffer is cleared. The initial value is 0.
194
def glClipPlane (plane, equation):
196
Specify a plane against which all geometry is clipped
197
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clipplane.html}
199
@type plane: Enumerated constant
200
@param plane: Specifies which clipping plane is being positioned.
201
@type equation: Buffer object I{type GL_FLOAT} (double)
202
@param equation: Specifies the address of an array of four double- precision floating-point
203
values. These values are interpreted as a plane equation.
206
def glColor (red, green, blue, alpha):
208
B{glColor3b, glColor3d, glColor3f, glColor3i, glColor3s, glColor3ub, glColor3ui, glColor3us,
209
glColor4b, glColor4d, glColor4f, glColor4i, glColor4s, glColor4ub, glColor4ui, glColor4us,
210
glColor3bv, glColor3dv, glColor3fv, glColor3iv, glColor3sv, glColor3ubv, glColor3uiv,
211
glColor3usv, glColor4bv, glColor4dv, glColor4fv, glColor4iv, glColor4sv, glColor4ubv,
212
glColor4uiv, glColor4usv}
215
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/color.html}
217
@type red, green, blue, alpha: Depends on function prototype.
218
@param red, green, blue: Specify new red, green, and blue values for the current color.
219
@param alpha: Specifies a new alpha value for the current color. Included only in the
220
four-argument glColor4 commands. (With '4' colors only)
223
def glColorMask(red, green, blue, alpha):
225
Enable and disable writing of frame buffer color components
226
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/colormask.html}
228
@type red, green, blue, alpha: int (boolean)
229
@param red, green, blue, alpha: Specify whether red, green, blue, and alpha can or cannot be
230
written into the frame buffer. The initial values are all GL_TRUE, indicating that the
231
color components can be written.
234
def glColorMaterial(face, mode):
236
Cause a material color to track the current color
237
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/colormaterial.html}
239
@type face: Enumerated constant
240
@param face: Specifies whether front, back, or both front and back material parameters should
241
track the current color.
242
@type mode: Enumerated constant
243
@param mode: Specifies which of several material parameters track the current color.
246
def glCopyPixels(x, y, width, height, type):
248
Copy pixels in the frame buffer
249
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/copypixels.html}
252
@param x, y: Specify the window coordinates of the lower left corner of the rectangular
253
region of pixels to be copied.
254
@type width, height: int
255
@param width,height: Specify the dimensions of the rectangular region of pixels to be copied.
256
Both must be non-negative.
257
@type type: Enumerated constant
258
@param type: Specifies whether color values, depth values, or stencil values are to be copied.
261
def glCopyTexImage2D(target, level, internalformat, x, y, width, height, border):
263
Copy pixels into a 2D texture image
264
@see: U{www.opengl.org/sdk/docs/man/xhtml/glCopyTexImage2D.xml}
266
@type target: Enumerated constant
267
@param target: Specifies the target texture.
269
@param level: Specifies the level-of-detail number. Level 0 is the base image level.
270
Level n is the nth mipmap reduction image.
271
@type internalformat: int
272
@param internalformat: Specifies the number of color components in the texture.
275
@param x, y:Specify the window coordinates of the first pixel that is copied
276
from the frame buffer. This location is the lower left corner of a rectangular
278
@param width: Specifies the width of the texture image. Must be 2n+2(border) for
279
some integer n. All implementations support texture images that are at least 64
282
@param height: Specifies the height of the texture image. Must be 2m+2(border) for
283
some integer m. All implementations support texture images that are at least 64
286
@param border: Specifies the width of the border. Must be either 0 or 1.
289
def glCullFace(mode):
291
Specify whether front- or back-facing facets can be culled
292
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/cullface.html}
294
@type mode: Enumerated constant
295
@param mode: Specifies whether front- or back-facing facets are candidates for culling.
298
def glDeleteLists(list, range):
300
Delete a contiguous group of display lists
301
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/deletelists.html}
303
@type list: unsigned int
304
@param list: Specifies the integer name of the first display list to delete
306
@param range: Specifies the number of display lists to delete
309
def glDeleteTextures(n, textures):
311
Delete named textures
312
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/deletetextures.html}
315
@param n: Specifies the number of textures to be deleted
316
@type textures: Buffer I{GL_INT}
317
@param textures: Specifies an array of textures to be deleted
320
def glDepthFunc(func):
322
Specify the value used for depth buffer comparisons
323
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/depthfunc.html}
325
@type func: Enumerated constant
326
@param func: Specifies the depth comparison function.
329
def glDepthMask(flag):
331
Enable or disable writing into the depth buffer
332
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/depthmask.html}
334
@type flag: int (boolean)
335
@param flag: Specifies whether the depth buffer is enabled for writing. If flag is GL_FALSE,
336
depth buffer writing is disabled. Otherwise, it is enabled. Initially, depth buffer
340
def glDepthRange(zNear, zFar):
342
Specify mapping of depth values from normalized device coordinates to window coordinates
343
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/depthrange.html}
346
@param zNear: Specifies the mapping of the near clipping plane to window coordinates.
347
The initial value is 0.
349
@param zFar: Specifies the mapping of the far clipping plane to window coordinates.
350
The initial value is 1.
355
Disable server-side GL capabilities
356
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/enable.html}
358
@type cap: Enumerated constant
359
@param cap: Specifies a symbolic constant indicating a GL capability.
362
def glDrawBuffer(mode):
364
Specify which color buffers are to be drawn into
365
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/drawbuffer.html}
367
@type mode: Enumerated constant
368
@param mode: Specifies up to four color buffers to be drawn into.
371
def glDrawPixels(width, height, format, type, pixels):
373
Write a block of pixels to the frame buffer
374
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/drawpixels.html}
376
@type width, height: int
377
@param width, height: Specify the dimensions of the pixel rectangle to be
378
written into the frame buffer.
379
@type format: Enumerated constant
380
@param format: Specifies the format of the pixel data.
381
@type type: Enumerated constant
382
@param type: Specifies the data type for pixels.
383
@type pixels: Buffer object
384
@param pixels: Specifies a pointer to the pixel data.
387
def glEdgeFlag (flag):
389
B{glEdgeFlag, glEdgeFlagv}
391
Flag edges as either boundary or non-boundary
392
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/edgeflag.html}
394
@type flag: Depends of function prototype
395
@param flag: Specifies the current edge flag value.The initial value is GL_TRUE.
400
Enable server-side GL capabilities
401
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/enable.html}
403
@type cap: Enumerated constant
404
@param cap: Specifies a symbolic constant indicating a GL capability.
409
Delimit the vertices of a primitive or group of like primitives
410
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/begin.html}
415
Create or replace a display list
416
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/newlist.html}
419
def glEvalCoord (u,v):
421
B{glEvalCoord1d, glEvalCoord1f, glEvalCoord2d, glEvalCoord2f, glEvalCoord1dv, glEvalCoord1fv,
422
glEvalCoord2dv, glEvalCoord2fv}
424
Evaluate enabled one- and two-dimensional maps
425
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/evalcoord.html}
427
@type u: Depends on function prototype.
428
@param u: Specifies a value that is the domain coordinate u to the basis function defined
429
in a previous glMap1 or glMap2 command. If the function prototype ends in 'v' then
430
u specifies a pointer to an array containing either one or two domain coordinates. The first
431
coordinate is u. The second coordinate is v, which is present only in glEvalCoord2 versions.
432
@type v: Depends on function prototype. (only with '2' prototypes)
433
@param v: Specifies a value that is the domain coordinate v to the basis function defined
434
in a previous glMap2 command. This argument is not present in a glEvalCoord1 command.
437
def glEvalMesh (mode, i1, i2):
439
B{glEvalMesh1 or glEvalMesh2}
441
Compute a one- or two-dimensional grid of points or lines
442
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/evalmesh.html}
444
@type mode: Enumerated constant
445
@param mode: In glEvalMesh1, specifies whether to compute a one-dimensional
446
mesh of points or lines.
448
@param i1, i2: Specify the first and last integer values for the grid domain variable i.
451
def glEvalPoint (i, j):
453
B{glEvalPoint1 and glEvalPoint2}
455
Generate and evaluate a single point in a mesh
456
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/evalpoint.html}
459
@param i: Specifies the integer value for grid domain variable i.
460
@type j: int (only with '2' prototypes)
461
@param j: Specifies the integer value for grid domain variable j (glEvalPoint2 only).
464
def glFeedbackBuffer (size, type, buffer):
466
Controls feedback mode
467
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/feedbackbuffer.html}
470
@param size:Specifies the maximum number of values that can be written into buffer.
471
@type type: Enumerated constant
472
@param type:Specifies a symbolic constant that describes the information that
473
will be returned for each vertex.
474
@type buffer: Buffer object I{GL_FLOAT}
475
@param buffer: Returns the feedback data.
480
Block until all GL execution is complete
481
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/finish.html}
486
Force Execution of GL commands in finite time
487
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/flush.html}
490
def glFog (pname, param):
492
B{glFogf, glFogi, glFogfv, glFogiv}
494
Specify fog parameters
495
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/fog.html}
497
@type pname: Enumerated constant
498
@param pname: Specifies a single-valued fog parameter. If the function prototype
499
ends in 'v' specifies a fog parameter.
500
@type param: Depends on function prototype.
501
@param param: Specifies the value or values to be assigned to pname. GL_FOG_COLOR
502
requires an array of four values. All other parameters accept an array containing
506
def glFrontFace(mode):
508
Define front- and back-facing polygons
509
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/frontface.html}
511
@type mode: Enumerated constant
512
@param mode: Specifies the orientation of front-facing polygons.
515
def glFrustum(left, right, bottom, top, zNear, zFar):
517
Multiply the current matrix by a perspective matrix
518
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/frustum.html}
520
@type left, right: double (float)
521
@param left, right: Specify the coordinates for the left and right vertical
523
@type top, bottom: double (float)
524
@param top, bottom: Specify the coordinates for the bottom and top horizontal
526
@type zNear, zFar: double (float)
527
@param zNear, zFar: Specify the distances to the near and far depth clipping planes.
528
Both distances must be positive.
531
def glGenLists(range):
533
Generate a contiguous set of empty display lists
534
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/genlists.html}
537
@param range: Specifies the number of contiguous empty display lists to be generated.
540
def glGenTextures(n, textures):
542
Generate texture names
543
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gentextures.html}
546
@param n: Specifies the number of textures name to be generated.
547
@type textures: Buffer object I{type GL_INT}
548
@param textures: Specifies an array in which the generated textures names are stored.
551
def glGet (pname, param):
553
B{glGetBooleanv, glGetfloatv, glGetFloatv, glGetIntegerv}
555
Return the value or values of a selected parameter
556
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/get.html}
558
@type pname: Enumerated constant
559
@param pname: Specifies the parameter value to be returned.
560
@type param: Depends on function prototype.
561
@param param: Returns the value or values of the specified parameter.
564
def glGetClipPlane(plane, equation):
566
Return the coefficients of the specified clipping plane
567
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getclipplane.html}
569
@type plane: Enumerated constant
570
@param plane: Specifies a clipping plane. The number of clipping planes depends on the
571
implementation, but at least six clipping planes are supported. They are identified by
572
symbolic names of the form GL_CLIP_PLANEi where 0 < i < GL_MAX_CLIP_PLANES.
573
@type equation: Buffer object I{type GL_FLOAT}
574
@param equation: Returns four float (double)-precision values that are the coefficients of the
575
plane equation of plane in eye coordinates. The initial value is (0, 0, 0, 0).
580
Return error information
581
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/geterror.html}
584
def glGetLight (light, pname, params):
586
B{glGetLightfv and glGetLightiv}
588
Return light source parameter values
589
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getlight.html}
591
@type light: Enumerated constant
592
@param light: Specifies a light source. The number of possible lights depends on the
593
implementation, but at least eight lights are supported. They are identified by symbolic
594
names of the form GL_LIGHTi where 0 < i < GL_MAX_LIGHTS.
595
@type pname: Enumerated constant
596
@param pname: Specifies a light source parameter for light.
597
@type params: Buffer object. Depends on function prototype.
598
@param params: Returns the requested data.
601
def glGetMap (target, query, v):
603
B{glGetMapdv, glGetMapfv, glGetMapiv}
605
Return evaluator parameters
606
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getmap.html}
608
@type target: Enumerated constant
609
@param target: Specifies the symbolic name of a map.
610
@type query: Enumerated constant
611
@param query: Specifies which parameter to return.
612
@type v: Buffer object. Depends on function prototype.
613
@param v: Returns the requested data.
616
def glGetMaterial (face, pname, params):
618
B{glGetMaterialfv, glGetMaterialiv}
620
Return material parameters
621
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getmaterial.html}
623
@type face: Enumerated constant
624
@param face: Specifies which of the two materials is being queried.
625
representing the front and back materials, respectively.
626
@type pname: Enumerated constant
627
@param pname: Specifies the material parameter to return.
628
@type params: Buffer object. Depends on function prototype.
629
@param params: Returns the requested data.
632
def glGetPixelMap (map, values):
634
B{glGetPixelMapfv, glGetPixelMapuiv, glGetPixelMapusv}
636
Return the specified pixel map
637
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getpixelmap.html}
639
@type map: Enumerated constant
640
@param map: Specifies the name of the pixel map to return.
641
@type values: Buffer object. Depends on function prototype.
642
@param values: Returns the pixel map contents.
645
def glGetPolygonStipple(mask):
647
Return the polygon stipple pattern
648
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getpolygonstipple.html}
650
@type mask: Buffer object I{type GL_BYTE}
651
@param mask: Returns the stipple pattern. The initial value is all 1's.
654
def glGetString(name):
656
Return a string describing the current GL connection
657
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getstring.html}
659
@type name: Enumerated constant
660
@param name: Specifies a symbolic constant.
664
def glGetTexEnv (target, pname, params):
666
B{glGetTexEnvfv, glGetTexEnviv}
668
Return texture environment parameters
669
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gettexenv.html}
671
@type target: Enumerated constant
672
@param target: Specifies a texture environment. Must be GL_TEXTURE_ENV.
673
@type pname: Enumerated constant
674
@param pname: Specifies the symbolic name of a texture environment parameter.
675
@type params: Buffer object. Depends on function prototype.
676
@param params: Returns the requested data.
679
def glGetTexGen (coord, pname, params):
681
B{glGetTexGendv, glGetTexGenfv, glGetTexGeniv}
683
Return texture coordinate generation parameters
684
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gettexgen.html}
686
@type coord: Enumerated constant
687
@param coord: Specifies a texture coordinate.
688
@type pname: Enumerated constant
689
@param pname: Specifies the symbolic name of the value(s) to be returned.
690
@type params: Buffer object. Depends on function prototype.
691
@param params: Returns the requested data.
694
def glGetTexImage(target, level, format, type, pixels):
696
Return a texture image
697
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getteximage.html}
699
@type target: Enumerated constant
700
@param target: Specifies which texture is to be obtained.
702
@param level: Specifies the level-of-detail number of the desired image.
703
Level 0 is the base image level. Level n is the nth mipmap reduction image.
704
@type format: Enumerated constant
705
@param format: Specifies a pixel format for the returned data.
706
@type type: Enumerated constant
707
@param type: Specifies a pixel type for the returned data.
708
@type pixels: Buffer object.
709
@param pixels: Returns the texture image. Should be a pointer to an array of the
710
type specified by type
713
def glGetTexLevelParameter (target, level, pname, params):
715
B{glGetTexLevelParameterfv, glGetTexLevelParameteriv}
717
return texture parameter values for a specific level of detail
718
@see: U{opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/gettexlevelparameter.html}
720
@type target: Enumerated constant
721
@param target: Specifies the symbolic name of the target texture.
723
@param level: Specifies the level-of-detail number of the desired image.
724
Level 0 is the base image level. Level n is the nth mipmap reduction image.
725
@type pname: Enumerated constant
726
@param pname: Specifies the symbolic name of a texture parameter.
727
@type params: Buffer object. Depends on function prototype.
728
@param params: Returns the requested data.
731
def glGetTexParameter (target, pname, params):
733
B{glGetTexParameterfv, glGetTexParameteriv}
735
Return texture parameter values
736
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gettexparameter.html}
738
@type target: Enumerated constant
739
@param target: Specifies the symbolic name of the target texture.
740
@type pname: Enumerated constant
741
@param pname: Specifies the symbolic name the target texture.
742
@type params: Buffer object. Depends on function prototype.
743
@param params: Returns the texture parameters.
746
def glHint(target, mode):
748
Specify implementation-specific hints
749
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/hint.html}
751
@type target: Enumerated constant
752
@param target: Specifies a symbolic constant indicating the behavior to be
754
@type mode: Enumerated constant
755
@param mode: Specifies a symbolic constant indicating the desired behavior.
760
B{glIndexd, glIndexf, glIndexi, glIndexs, glIndexdv, glIndexfv, glIndexiv, glIndexsv}
762
Set the current color index
763
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl}
765
@type c: Buffer object. Depends on function prototype.
766
@param c: Specifies a pointer to a one element array that contains the new value for
767
the current color index.
772
Initialize the name stack
773
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/initnames.html}
776
def glIsEnabled(cap):
778
Test whether a capability is enabled
779
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/isenabled.html}
781
@type cap: Enumerated constant
782
@param cap: Specifies a constant representing a GL capability.
787
Determine if a name corresponds to a display-list
788
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/islist.html}
790
@type list: unsigned int
791
@param list: Specifies a potential display-list name.
794
def glIsTexture(texture):
796
Determine if a name corresponds to a texture
797
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/istexture.html}
799
@type texture: unsigned int
800
@param texture: Specifies a value that may be the name of a texture.
803
def glLight (light, pname, param):
805
B{glLightf,glLighti, glLightfv, glLightiv}
807
Set the light source parameters
808
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/light.html}
810
@type light: Enumerated constant
811
@param light: Specifies a light. The number of lights depends on the implementation,
812
but at least eight lights are supported. They are identified by symbolic names of the
813
form GL_LIGHTi where 0 < i < GL_MAX_LIGHTS.
814
@type pname: Enumerated constant
815
@param pname: Specifies a single-valued light source parameter for light.
816
@type param: Depends on function prototype.
817
@param param: Specifies the value that parameter pname of light source light will be set to.
818
If function prototype ends in 'v' specifies a pointer to the value or values that
819
parameter pname of light source light will be set to.
822
def glLightModel (pname, param):
824
B{glLightModelf, glLightModeli, glLightModelfv, glLightModeliv}
826
Set the lighting model parameters
827
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/lightmodel.html}
829
@type pname: Enumerated constant
830
@param pname: Specifies a single-value light model parameter.
831
@type param: Depends on function prototype.
832
@param param: Specifies the value that param will be set to. If function prototype ends in 'v'
833
specifies a pointer to the value or values that param will be set to.
836
def glLineStipple(factor, pattern):
838
Specify the line stipple pattern
839
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/linestipple.html}
842
@param factor: Specifies a multiplier for each bit in the line stipple pattern.
843
If factor is 3, for example, each bit in the pattern is used three times before
844
the next bit in the pattern is used. factor is clamped to the range [1, 256] and
846
@type pattern: unsigned short int
847
@param pattern: Specifies a 16-bit integer whose bit pattern determines which fragments
848
of a line will be drawn when the line is rasterized. Bit zero is used first; the default
852
def glLineWidth(width):
854
Specify the width of rasterized lines.
855
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/linewidth.html}
858
@param width: Specifies the width of rasterized lines. The initial value is 1.
861
def glListBase(base):
863
Set the display-list base for glCallLists
864
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/listbase.html}
866
@type base: unsigned int
867
@param base: Specifies an integer offset that will be added to glCallLists
868
offsets to generate display-list names. The initial value is 0.
871
def glLoadIdentity():
873
Replace the current matrix with the identity matrix
874
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/loadidentity.html}
877
def glLoadMatrix (m):
879
B{glLoadMatrixd, glLoadMatixf}
881
Replace the current matrix with the specified matrix
882
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/loadmatrix.html}
884
@type m: Buffer object. Depends on function prototype.
885
@param m: Specifies a pointer to 16 consecutive values, which are used as the elements
886
of a 4x4 column-major matrix.
889
def glLoadName(name):
891
Load a name onto the name stack.
892
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/loadname.html}
894
@type name: unsigned int
895
@param name: Specifies a name that will replace the top value on the name stack.
898
def glLogicOp(opcode):
900
Specify a logical pixel operation for color index rendering
901
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/logicop.html}
903
@type opcode: Enumerated constant
904
@param opcode: Specifies a symbolic constant that selects a logical operation.
907
def glMap1 (target, u1, u2, stride, order, points):
911
Define a one-dimensional evaluator
912
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/map1.html}
914
@type target: Enumerated constant
915
@param target: Specifies the kind of values that are generated by the evaluator.
916
@type u1, u2: Depends on function prototype.
917
@param u1,u2: Specify a linear mapping of u, as presented to glEvalCoord1, to ^, t
918
he variable that is evaluated by the equations specified by this command.
920
@param stride: Specifies the number of floats or float (double)s between the beginning
921
of one control point and the beginning of the next one in the data structure
922
referenced in points. This allows control points to be embedded in arbitrary data
923
structures. The only constraint is that the values for a particular control point must
924
occupy contiguous memory locations.
926
@param order: Specifies the number of control points. Must be positive.
927
@type points: Buffer object. Depends on function prototype.
928
@param points: Specifies a pointer to the array of control points.
931
def glMap2 (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points):
935
Define a two-dimensional evaluator
936
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/map2.html}
938
@type target: Enumerated constant
939
@param target: Specifies the kind of values that are generated by the evaluator.
940
@type u1, u2: Depends on function prototype.
941
@param u1,u2: Specify a linear mapping of u, as presented to glEvalCoord2, to ^, t
942
he variable that is evaluated by the equations specified by this command. Initially
945
@param ustride: Specifies the number of floats or float (double)s between the beginning
946
of control point R and the beginning of control point R ij, where i and j are the u
947
and v control point indices, respectively. This allows control points to be embedded
948
in arbitrary data structures. The only constraint is that the values for a particular
949
control point must occupy contiguous memory locations. The initial value of ustride is 0.
951
@param uorder: Specifies the dimension of the control point array in the u axis.
952
Must be positive. The initial value is 1.
953
@type v1, v2: Depends on function prototype.
954
@param v1, v2: Specify a linear mapping of v, as presented to glEvalCoord2, to ^,
955
one of the two variables that are evaluated by the equations specified by this command.
956
Initially, v1 is 0 and v2 is 1.
958
@param vstride: Specifies the number of floats or float (double)s between the beginning of control
959
point R and the beginning of control point R ij, where i and j are the u and v control
960
point(indices, respectively. This allows control points to be embedded in arbitrary data
961
structures. The only constraint is that the values for a particular control point must
962
occupy contiguous memory locations. The initial value of vstride is 0.
964
@param vorder: Specifies the dimension of the control point array in the v axis.
965
Must be positive. The initial value is 1.
966
@type points: Buffer object. Depends on function prototype.
967
@param points: Specifies a pointer to the array of control points.
970
def glMapGrid (un, u1,u2 ,vn, v1, v2):
972
B{glMapGrid1d, glMapGrid1f, glMapGrid2d, glMapGrid2f}
974
Define a one- or two-dimensional mesh
975
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/mapgrid.html}
978
@param un: Specifies the number of partitions in the grid range interval
979
[u1, u2]. Must be positive.
980
@type u1, u2: Depends on function prototype.
981
@param u1, u2: Specify the mappings for integer grid domain values i=0 and i=un.
983
@param vn: Specifies the number of partitions in the grid range interval [v1, v2]
985
@type v1, v2: Depends on function prototype.
986
@param v1, v2: Specify the mappings for integer grid domain values j=0 and j=vn
990
def glMaterial (face, pname, params):
992
Specify material parameters for the lighting model.
993
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/material.html}
995
@type face: Enumerated constant
996
@param face: Specifies which face or faces are being updated. Must be one of:
997
@type pname: Enumerated constant
998
@param pname: Specifies the single-valued material parameter of the face
999
or faces that is being updated. Must be GL_SHININESS.
1001
@param params: Specifies the value that parameter GL_SHININESS will be set to.
1002
If function prototype ends in 'v' specifies a pointer to the value or values that
1003
pname will be set to.
1006
def glMatrixMode(mode):
1008
Specify which matrix is the current matrix.
1009
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/matrixmode.html}
1011
@type mode: Enumerated constant
1012
@param mode: Specifies which matrix stack is the target for subsequent matrix operations.
1015
def glMultMatrix (m):
1017
B{glMultMatrixd, glMultMatrixf}
1019
Multiply the current matrix with the specified matrix
1020
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/multmatrix.html}
1022
@type m: Buffer object. Depends on function prototype.
1023
@param m: Points to 16 consecutive values that are used as the elements of a 4x4 column
1027
def glNewList(list, mode):
1029
Create or replace a display list
1030
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/newlist.html}
1032
@type list: unsigned int
1033
@param list: Specifies the display list name
1034
@type mode: Enumerated constant
1035
@param mode: Specifies the compilation mode.
1038
def glNormal3 (nx, ny, nz, v):
1040
B{Normal3b, Normal3bv, Normal3d, Normal3dv, Normal3f, Normal3fv, Normal3i, Normal3iv,
1041
Normal3s, Normal3sv}
1043
Set the current normal vector
1044
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/normal.html}
1046
@type nx, ny, nz: Depends on function prototype. (non - 'v' prototypes only)
1047
@param nx, ny, nz: Specify the x, y, and z coordinates of the new current normal.
1048
The initial value of the current normal is the unit vector, (0, 0, 1).
1049
@type v: Buffer object. Depends on function prototype. ('v' prototypes)
1050
@param v: Specifies a pointer to an array of three elements: the x, y, and z coordinates
1051
of the new current normal.
1054
def glOrtho(left, right, bottom, top, zNear, zFar):
1056
Multiply the current matrix with an orthographic matrix
1057
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/ortho.html}
1059
@type left, right: double (float)
1060
@param left, right: Specify the coordinates for the left and
1061
right vertical clipping planes.
1062
@type bottom, top: double (float)
1063
@param bottom, top: Specify the coordinates for the bottom and top
1064
horizontal clipping planes.
1065
@type zNear, zFar: double (float)
1066
@param zNear, zFar: Specify the distances to the nearer and farther
1067
depth clipping planes. These values are negative if the plane is to be behind the viewer.
1070
def glPassThrough(token):
1072
Place a marker in the feedback buffer
1073
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/passthrough.html}
1076
@param token: Specifies a marker value to be placed in the feedback
1077
buffer following a GL_PASS_THROUGH_TOKEN.
1080
def glPixelMap (map, mapsize, values):
1082
B{glPixelMapfv, glPixelMapuiv, glPixelMapusv}
1084
Set up pixel transfer maps
1085
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixelmap.html}
1087
@type map: Enumerated constant
1088
@param map: Specifies a symbolic map name.
1090
@param mapsize: Specifies the size of the map being defined.
1091
@type values: Buffer object. Depends on function prototype.
1092
@param values: Specifies an array of mapsize values.
1095
def glPixelStore (pname, param):
1097
B{glPixelStoref, glPixelStorei}
1099
Set pixel storage modes
1100
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixelstore.html}
1102
@type pname: Enumerated constant
1103
@param pname: Specifies the symbolic name of the parameter to be set.
1104
Six values affect the packing of pixel data into memory.
1105
Six more affect the unpacking of pixel data from memory.
1106
@type param: Depends on function prototype.
1107
@param param: Specifies the value that pname is set to.
1110
def glPixelTransfer (pname, param):
1112
B{glPixelTransferf, glPixelTransferi}
1114
Set pixel transfer modes
1115
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixeltransfer.html}
1117
@type pname: Enumerated constant
1118
@param pname: Specifies the symbolic name of the pixel transfer parameter to be set.
1119
@type param: Depends on function prototype.
1120
@param param: Specifies the value that pname is set to.
1123
def glPixelZoom(xfactor, yfactor):
1125
Specify the pixel zoom factors
1126
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixelzoom.html}
1128
@type xfactor, yfactor: float
1129
@param xfactor, yfactor: Specify the x and y zoom factors for pixel write operations.
1132
def glPointSize(size):
1134
Specify the diameter of rasterized points
1135
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pointsize.html}
1138
@param size: Specifies the diameter of rasterized points. The initial value is 1.
1141
def glPolygonMode(face, mode):
1143
Select a polygon rasterization mode
1144
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/polygonmode.html}
1146
@type face: Enumerated constant
1147
@param face: Specifies the polygons that mode applies to.
1148
Must be GL_FRONT for front-facing polygons, GL_BACK for back- facing polygons,
1149
or GL_FRONT_AND_BACK for front- and back-facing polygons.
1150
@type mode: Enumerated constant
1151
@param mode: Specifies how polygons will be rasterized.
1152
The initial value is GL_FILL for both front- and back- facing polygons.
1155
def glPolygonOffset(factor, units):
1157
Set the scale and units used to calculate depth values
1158
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/polygonoffset.html}
1161
@param factor: Specifies a scale factor that is used to create a variable depth
1162
offset for each polygon. The initial value is 0.
1164
@param units: Is multiplied by an implementation-specific value to create a constant
1165
depth offset. The initial value is 0.
1168
def glPolygonStipple(mask):
1170
Set the polygon stippling pattern
1171
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/polygonstipple.html}
1173
@type mask: Buffer object I{type GL_BYTE}
1174
@param mask: Specifies a pointer to a 32x32 stipple pattern that will be unpacked
1175
from memory in the same way that glDrawPixels unpacks pixels.
1180
Pop the server attribute stack
1181
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushattrib.html}
1184
def glPopClientAttrib():
1186
Pop the client attribute stack
1187
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushclientattrib.html}
1192
Pop the current matrix stack
1193
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushmatrix.html}
1199
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushname.html}
1202
def glPrioritizeTextures(n, textures, priorities):
1204
Set texture residence priority
1205
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/prioritizetextures.html}
1208
@param n:Specifies the number of textures to be prioritized.
1209
@type textures: Buffer I{type GL_INT}
1210
@param textures: Specifies an array containing the names of the textures to be prioritized.
1211
@type priorities: Buffer I{type GL_FLOAT}
1212
@param priorities: Specifies an array containing the texture priorities. A priority given
1213
in an element of priorities applies to the texture named by the corresponding element of textures.
1216
def glPushAttrib(mask):
1218
Push the server attribute stack
1219
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushattrib.html}
1221
@type mask: Enumerated constant(s)
1222
@param mask: Specifies a mask that indicates which attributes to save.
1225
def glPushClientAttrib(mask):
1227
Push the client attribute stack
1228
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushclientattrib.html}
1230
@type mask: Enumerated constant(s)
1231
@param mask: Specifies a mask that indicates which attributes to save.
1236
Push the current matrix stack
1237
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushmatrix.html}
1240
def glPushName(name):
1243
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushname.html}
1245
@type name: unsigned int
1246
@param name: Specifies a name that will be pushed onto the name stack.
1249
def glRasterPos (x,y,z,w):
1251
B{glRasterPos2d, glRasterPos2f, glRasterPos2i, glRasterPos2s, glRasterPos3d,
1252
glRasterPos3f, glRasterPos3i, glRasterPos3s, glRasterPos4d, glRasterPos4f,
1253
glRasterPos4i, glRasterPos4s, glRasterPos2dv, glRasterPos2fv, glRasterPos2iv,
1254
glRasterPos2sv, glRasterPos3dv, glRasterPos3fv, glRasterPos3iv, glRasterPos3sv,
1255
glRasterPos4dv, glRasterPos4fv, glRasterPos4iv, glRasterPos4sv}
1257
Specify the raster position for pixel operations
1258
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rasterpos.html}
1260
@type x, y, z, w: Depends on function prototype. (z and w for '3' and '4' prototypes only)
1261
@param x, y, z, w: Specify the x,y,z, and w object coordinates (if present) for the
1262
raster position. If function prototype ends in 'v' specifies a pointer to an array of two,
1263
three, or four elements, specifying x, y, z, and w coordinates, respectively.
1265
If you are drawing to the 3d view with a Scriptlink of a space handler
1266
the zoom level of the panels will scale the glRasterPos by the view matrix.
1267
so a X of 10 will not always offset 10 pixels as you would expect.
1269
To work around this get the scale value of the view matrix and use it to scale your pixel values.
1272
def glReadBuffer(mode):
1274
Select a color buffer source for pixels.
1275
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/readbuffer.html}
1277
@type mode: Enumerated constant
1278
@param mode: Specifies a color buffer.
1281
def glReadPixels(x, y, width, height, format, type, pixels):
1283
Read a block of pixels from the frame buffer
1284
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/readpixels.html}
1287
@param x, y:Specify the window coordinates of the first pixel that is read
1288
from the frame buffer. This location is the lower left corner of a rectangular
1290
@type width, height: int
1291
@param width, height: Specify the dimensions of the pixel rectangle. width and
1292
height of one correspond to a single pixel.
1293
@type format: Enumerated constant
1294
@param format: Specifies the format of the pixel data.
1295
@type type: Enumerated constant
1296
@param type: Specifies the data type of the pixel data.
1297
@type pixels: Buffer object
1298
@param pixels: Returns the pixel data.
1301
def glRect (x1,y1,x2,y2,v1,v2):
1303
B{glRectd, glRectf, glRecti, glRects, glRectdv, glRectfv, glRectiv, glRectsv}
1306
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rect.html}
1308
@type x1, y1: Depends on function prototype. (for non 'v' prototypes only)
1309
@param x1, y1: Specify one vertex of a rectangle
1310
@type x2, y2: Depends on function prototype. (for non 'v' prototypes only)
1311
@param x2, y2: Specify the opposite vertex of the rectangle
1312
@type v1, v2: Depends on function prototype. (for 'v' prototypes only)
1313
@param v1, v2: Specifies a pointer to one vertex of a rectangle and the pointer
1314
to the opposite vertex of the rectangle
1317
def glRenderMode(mode):
1319
Set rasterization mode
1320
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rendermode.html}
1322
@type mode: Enumerated constant
1323
@param mode: Specifies the rasterization mode.
1326
def glRotate (angle, x, y, z):
1328
B{glRotated, glRotatef}
1330
Multiply the current matrix by a rotation matrix
1331
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rotate.html}
1333
@type angle: Depends on function prototype.
1334
@param angle: Specifies the angle of rotation in degrees.
1335
@type x, y, z: Depends on function prototype.
1336
@param x, y, z: Specify the x, y, and z coordinates of a vector respectively.
1339
def glScale (x,y,z):
1341
B{glScaled, glScalef}
1343
Multiply the current matrix by a general scaling matrix
1344
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/scale.html}
1346
@type x, y, z: Depends on function prototype.
1347
@param x, y, z: Specify scale factors along the x, y, and z axes, respectively.
1350
def glScissor(x,y,width,height):
1352
Define the scissor box
1353
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/scissor.html}
1356
@param x, y: Specify the lower left corner of the scissor box. Initially (0, 0).
1357
@type width, height: int
1358
@param width, height: Specify the width and height of the scissor box. When a
1359
GL context is first attached to a window, width and height are set to the
1360
dimensions of that window.
1363
def glSelectBuffer(size, buffer):
1365
Establish a buffer for selection mode values
1366
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/selectbuffer.html}
1369
@param size: Specifies the size of buffer
1370
@type buffer: Buffer I{type GL_INT}
1371
@param buffer: Returns the selection data
1374
def glShadeModel(mode):
1376
Select flat or smooth shading
1377
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/shademodel.html}
1379
@type mode: Enumerated constant
1380
@param mode: Specifies a symbolic value representing a shading technique.
1383
def glStencilFuc(func, ref, mask):
1385
Set function and reference value for stencil testing
1386
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/stencilfunc.html}
1388
@type func: Enumerated constant
1389
@param func:Specifies the test function.
1391
@param ref:Specifies the reference value for the stencil test. ref is clamped to
1392
the range [0,2n-1], where n is the number of bitplanes in the stencil buffer.
1393
The initial value is 0.
1394
@type mask: unsigned int
1395
@param mask:Specifies a mask that is ANDed with both the reference value and
1396
the stored stencil value when the test is done. The initial value is all 1's.
1399
def glStencilMask(mask):
1401
Control the writing of individual bits in the stencil planes
1402
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/stencilmask.html}
1404
@type mask: unsigned int
1405
@param mask: Specifies a bit mask to enable and disable writing of individual bits
1406
in the stencil planes. Initially, the mask is all 1's.
1409
def glStencilOp(fail, zfail, zpass):
1411
Set stencil test actions
1412
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/stencilop.html}
1414
@type fail: Enumerated constant
1415
@param fail: Specifies the action to take when the stencil test fails.
1416
The initial value is GL_KEEP.
1417
@type zfail: Enumerated constant
1418
@param zfail: Specifies the stencil action when the stencil test passes, but the
1419
depth test fails. zfail accepts the same symbolic constants as fail.
1420
The initial value is GL_KEEP.
1421
@type zpass: Enumerated constant
1422
@param zpass: Specifies the stencil action when both the stencil test and the
1423
depth test pass, or when the stencil test passes and either there is no depth
1424
buffer or depth testing is not enabled. zpass accepts the same symbolic constants
1425
as fail. The initial value is GL_KEEP.
1428
def glTexCoord (s,t,r,q,v):
1430
B{glTexCoord1d, glTexCoord1f, glTexCoord1i, glTexCoord1s, glTexCoord2d, glTexCoord2f,
1431
glTexCoord2i, glTexCoord2s, glTexCoord3d, glTexCoord3f, glTexCoord3i, glTexCoord3s,
1432
glTexCoord4d, glTexCoord4f, glTexCoord4i, glTexCoord4s, glTexCoord1dv, glTexCoord1fv,
1433
glTexCoord1iv, glTexCoord1sv, glTexCoord2dv, glTexCoord2fv, glTexCoord2iv,
1434
glTexCoord2sv, glTexCoord3dv, glTexCoord3fv, glTexCoord3iv, glTexCoord3sv,
1435
glTexCoord4dv, glTexCoord4fv, glTexCoord4iv, glTexCoord4sv}
1437
Set the current texture coordinates
1438
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texcoord.html}
1440
@type s, t, r, q: Depends on function prototype. (r and q for '3' and '4' prototypes only)
1441
@param s, t, r, q: Specify s, t, r, and q texture coordinates. Not all parameters are
1442
present in all forms of the command.
1443
@type v: Buffer object. Depends on function prototype. (for 'v' prototypes only)
1444
@param v: Specifies a pointer to an array of one, two, three, or four elements,
1445
which in turn specify the s, t, r, and q texture coordinates.
1448
def glTexEnv (target, pname, param):
1450
B{glTextEnvf, glTextEnvi, glTextEnvfv, glTextEnviv}
1452
Set texture environment parameters
1453
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texenv.html}
1455
@type target: Enumerated constant
1456
@param target: Specifies a texture environment. Must be GL_TEXTURE_ENV.
1457
@type pname: Enumerated constant
1458
@param pname: Specifies the symbolic name of a single-valued texture environment
1459
parameter. Must be GL_TEXTURE_ENV_MODE.
1460
@type param: Depends on function prototype.
1461
@param param: Specifies a single symbolic constant. If function prototype ends in 'v'
1462
specifies a pointer to a parameter array that contains either a single symbolic
1463
constant or an RGBA color
1466
def glTexGen (coord, pname, param):
1468
B{glTexGend, glTexGenf, glTexGeni, glTexGendv, glTexGenfv, glTexGeniv}
1470
Control the generation of texture coordinates
1471
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texgen.html}
1473
@type coord: Enumerated constant
1474
@param coord: Specifies a texture coordinate.
1475
@type pname: Enumerated constant
1476
@param pname: Specifies the symbolic name of the texture- coordinate generation function.
1477
@type param: Depends on function prototype.
1478
@param param: Specifies a single-valued texture generation parameter.
1479
If function prototype ends in 'v' specifies a pointer to an array of texture
1480
generation parameters. If pname is GL_TEXTURE_GEN_MODE, then the array must
1481
contain a single symbolic constant. Otherwise, params holds the coefficients
1482
for the texture-coordinate generation function specified by pname.
1485
def glTexImage1D(target, level, internalformat, width, border, format, type, pixels):
1487
Specify a one-dimensional texture image
1488
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/teximage1d.html}
1490
@type target: Enumerated constant
1491
@param target: Specifies the target texture.
1493
@param level: Specifies the level-of-detail number. Level 0 is the base image level.
1494
Level n is the nth mipmap reduction image.
1495
@type internalformat: int
1496
@param internalformat: Specifies the number of color components in the texture.
1498
@param width: Specifies the width of the texture image. Must be 2n+2(border) for
1499
some integer n. All implementations support texture images that are at least 64
1500
texels wide. The height of the 1D texture image is 1.
1502
@param border: Specifies the width of the border. Must be either 0 or 1.
1503
@type format: Enumerated constant
1504
@param format: Specifies the format of the pixel data.
1505
@type type: Enumerated constant
1506
@param type: Specifies the data type of the pixel data.
1507
@type pixels: Buffer object.
1508
@param pixels: Specifies a pointer to the image data in memory.
1511
def glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels):
1513
Specify a two-dimensional texture image
1514
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/teximage2d.html}
1516
@type target: Enumerated constant
1517
@param target: Specifies the target texture.
1519
@param level: Specifies the level-of-detail number. Level 0 is the base image level.
1520
Level n is the nth mipmap reduction image.
1521
@type internalformat: int
1522
@param internalformat: Specifies the number of color components in the texture.
1524
@param width: Specifies the width of the texture image. Must be 2n+2(border) for
1525
some integer n. All implementations support texture images that are at least 64
1528
@param height: Specifies the height of the texture image. Must be 2m+2(border) for
1529
some integer m. All implementations support texture images that are at least 64
1532
@param border: Specifies the width of the border. Must be either 0 or 1.
1533
@type format: Enumerated constant
1534
@param format: Specifies the format of the pixel data.
1535
@type type: Enumerated constant
1536
@param type: Specifies the data type of the pixel data.
1537
@type pixels: Buffer object.
1538
@param pixels: Specifies a pointer to the image data in memory.
1541
def glTexParameter (target, pname, param):
1543
B{glTexParameterf, glTexParameteri, glTexParameterfv, glTexParameteriv}
1545
Set texture parameters
1546
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texparameter.html}
1548
@type target: Enumerated constant
1549
@param target: Specifies the target texture.
1550
@type pname: Enumerated constant
1551
@param pname: Specifies the symbolic name of a single-valued texture parameter.
1552
@type param: Depends on function prototype.
1553
@param param: Specifies the value of pname. If function prototype ends in 'v' specifies
1554
a pointer to an array where the value or values of pname are stored.
1557
def glTranslate (x, y, z):
1559
B{glTranslatef, glTranslated}
1561
Multiply the current matrix by a translation matrix
1562
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/translate.html}
1564
@type x, y, z: Depends on function prototype.
1565
@param x, y, z: Specify the x, y, and z coordinates of a translation vector.
1568
def glVertex (x,y,z,w,v):
1570
B{glVertex2d, glVertex2f, glVertex2i, glVertex2s, glVertex3d, glVertex3f, glVertex3i,
1571
glVertex3s, glVertex4d, glVertex4f, glVertex4i, glVertex4s, glVertex2dv, glVertex2fv,
1572
glVertex2iv, glVertex2sv, glVertex3dv, glVertex3fv, glVertex3iv, glVertex3sv, glVertex4dv,
1573
glVertex4fv, glVertex4iv, glVertex4sv}
1576
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/vertex.html}
1578
@type x, y, z, w: Depends on function prototype (z and w for '3' and '4' prototypes only)
1579
@param x, y, z, w: Specify x, y, z, and w coordinates of a vertex. Not all parameters
1580
are present in all forms of the command.
1581
@type v: Buffer object. Depends of function prototype (for 'v' prototypes only)
1582
@param v: Specifies a pointer to an array of two, three, or four elements. The
1583
elements of a two-element array are x and y; of a three-element array, x, y, and z;
1584
and of a four-element array, x, y, z, and w.
1587
def glViewport(x,y,width,height):
1590
@see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/viewport.html}
1593
@param x, y: Specify the lower left corner of the viewport rectangle,
1594
in pixels. The initial value is (0,0).
1595
@type width, height: int
1596
@param width, height: Specify the width and height of the viewport. When a GL context
1597
is first attached to a window, width and height are set to the dimensions of that window.
1600
def gluPerspective(fovY, aspect, zNear, zFar):
1602
Set up a perspective projection matrix.
1603
@see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5577288}
1606
@param fovY: Specifies the field of view angle, in degrees, in the y direction.
1607
@type aspect: double
1608
@param aspect: Specifies the aspect ratio that determines the field of view in the x direction.
1609
The aspect ratio is the ratio of x (width) to y (height).
1611
@param zNear: Specifies the distance from the viewer to the near clipping plane (always positive).
1613
@param zFar: Specifies the distance from the viewer to the far clipping plane (always positive).
1616
def gluLookAt(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz):
1618
Define a viewing transformation
1619
@see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5573042}
1621
@type eyex, eyey, eyez: double
1622
@param eyex, eyey, eyez: Specifies the position of the eye point.
1623
@type centerx, centery, centerz: double
1624
@param centerx, centery, centerz: Specifies the position of the reference point.
1625
@type upx, upy, upz: double
1626
@param upx, upy, upz: Specifies the direction of the up vector.
1629
def gluOrtho2D(left, right, bottom, top):
1631
Define a 2-D orthographic projection matrix
1632
@see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5578074}
1634
@type left, right: double
1635
@param left, right: Specify the coordinates for the left and right vertical clipping planes.
1636
@type bottom, top: double
1637
@param bottom, top: Specify the coordinates for the bottom and top horizontal clipping planes.
1640
def gluPickMatrix(x, y, width, height, viewport):
1642
Define a picking region
1643
@see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5578074}
1646
@param x, y: Specify the center of a picking region in window coordinates.
1647
@type width, height: double
1648
@param width, height: Specify the width and height, respectively, of the picking region in window coordinates.
1649
@type viewport: Buffer object. [int]
1650
@param viewport: Specifies the current viewport.
1653
def gluProject(objx, objy, objz, modelMatrix, projMatrix, viewport, winx, winy, winz):
1655
Map object coordinates to window coordinates.
1656
@see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5578074}
1658
@type objx, objy, objz: double
1659
@param objx, objy, objz: Specify the object coordinates.
1660
@type modelMatrix: Buffer object. [double]
1661
@param modelMatrix: Specifies the current modelview matrix (as from a glGetDoublev call).
1662
@type projMatrix: Buffer object. [double]
1663
@param projMatrix: Specifies the current projection matrix (as from a glGetDoublev call).
1664
@type viewport: Buffer object. [int]
1665
@param viewport: Specifies the current viewport (as from a glGetIntegerv call).
1666
@type winx, winy, winz: Buffer object. [double]
1667
@param winx, winy, winz: Return the computed window coordinates.
1670
def gluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, objx, objy, objz):
1672
Map object coordinates to window
1674
@see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5582204}
1676
@type winx, winy, winz: double
1677
@param winx, winy, winz: Specify the window coordinates to be mapped.
1678
@type modelMatrix: Buffer object. [double]
1679
@param modelMatrix: Specifies the current modelview matrix (as from a glGetDoublev call).
1680
@type projMatrix: Buffer object. [double]
1681
@param projMatrix: Specifies the current projection matrix (as from a glGetDoublev call).
1682
@type viewport: Buffer object. [int]
1683
@param viewport: Specifies the current viewport (as from a glGetIntegerv call).
1684
@type objx, objy, objz: Buffer object. [double]
1685
@param objx, objy, objz: Return the computed object coordinates.
1690
The Buffer object is simply a block of memory that is delineated and initialized by the
1691
user. Many OpenGL functions return data to a C-style pointer, however, because this
1692
is not possible in python the Buffer object can be used to this end. Wherever pointer
1693
notation is used in the OpenGL functions the Buffer object can be used in it's BGL
1694
wrapper. In some instances the Buffer object will need to be initialized with the template
1695
parameter, while in other instances the user will want to create just a blank buffer
1696
which will be zeroed by default.
1698
@ivar list: The contents of the Buffer.
1699
@ivar dimensions: The size of the Buffer.
1702
def __init__(type, dimensions, template = None):
1704
This will create a new Buffer object for use with other BGL OpenGL commands.
1705
Only the type of argument to store in the buffer and the dimensions of the buffer
1706
are necessary. Buffers are zeroed by default unless a template is supplied, in
1707
which case the buffer is initialized to the template.
1710
@param type: The format to store data in. The type should be one of
1711
GL_BYTE, GL_SHORT, GL_INT, or GL_FLOAT.
1712
@type dimensions: An int or sequence object specifying the dimensions of the buffer.
1713
@param dimensions: If the dimensions are specified as an int a linear array will
1714
be created for the buffer. If a sequence is passed for the dimensions, the buffer
1715
becomes n-Dimensional, where n is equal to the number of parameters passed in the
1716
sequence. Example: [256,2] is a two- dimensional buffer while [256,256,4] creates
1717
a three- dimensional buffer. You can think of each additional dimension as a sub-item
1718
of the dimension to the left. i.e. [10,2] is a 10 element array each with 2 sub-items.
1719
[(0,0), (0,1), (1,0), (1,1), (2,0), ...] etc.
1720
@type template: A python sequence object (optional)
1721
@param template: A sequence of matching dimensions which will be used to initialize
1722
the Buffer. If a template is not passed in all fields will be initialized to 0.
1723
@rtype: Buffer object
1724
@return: The newly created buffer as a PyObject.