~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/python/api2_2x/doc/BGL.py

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
"""
4
4
The Blender.BGL submodule (the OpenGL wrapper).
5
5
 
 
6
B{New}: some GLU functions: L{gluLookAt}, etc.
 
7
 
6
8
The Blender.BGL submodule
7
9
=========================
8
10
 
23
25
  from Blender import Draw
24
26
  R = G = B = 0
25
27
  A = 1
26
 
  instructions = "Hold mouse buttons to change the background color."
 
28
  title = "Testing BGL  + Draw"
 
29
  instructions = "Use mouse buttons or wheel to change the background color."
27
30
  quitting = " Press ESC or q to quit."
 
31
  len1 = Draw.GetStringWidth(title)
 
32
  len2 = Draw.GetStringWidth(instructions + quitting)
28
33
  #
29
34
  def show_win():
30
35
    glClearColor(R,G,B,A)                # define color used to clear buffers 
31
36
    glClear(GL_COLOR_BUFFER_BIT)         # use it to clear the color buffer
32
 
    glColor3f(1,1,1)                     # change default color
 
37
    glColor3f(0.35,0.18,0.92)            # define default color
 
38
    glBegin(GL_POLYGON)                  # begin a vertex data list
 
39
    glVertex2i(165, 158)
 
40
    glVertex2i(252, 55)
 
41
    glVertex2i(104, 128)
 
42
    glEnd()
 
43
    glColor3f(0.4,0.4,0.4)               # change default color
 
44
    glRecti(40, 96, 60+len1, 113)
 
45
    glColor3f(1,1,1)
33
46
    glRasterPos2i(50,100)                # move cursor to x = 50, y = 100
34
 
    Draw.Text("Testing BGL  + Draw")     # draw this text there
35
 
    glRasterPos2i(350,20)                # move cursor again
 
47
    Draw.Text(title)                     # draw this text there
 
48
    glRasterPos2i(350,40)                # move cursor again
36
49
    Draw.Text(instructions + quitting)   # draw another msg
37
50
    glBegin(GL_LINE_LOOP)                # begin a vertex-data list
38
51
    glVertex2i(46,92)
40
53
    glVertex2i(120,115)
41
54
    glVertex2i(46,115)
42
55
    glEnd()                              # close this list
43
 
    glColor3f(0.35,0.18,0.92)            # change default color again
44
 
    glBegin(GL_POLYGON)                  # another list, for a polygon
45
 
    glVertex2i(315, 292)
46
 
    glVertex2i(412, 200)
47
 
    glVertex2i(264, 256)
48
 
    glEnd()
49
 
    Draw.Redraw(1)                       # make changes visible.
50
56
  #
51
 
  def ev(evt, val):                     # this is a callback for Draw.Register()
 
57
  def ev(evt, val):                      # event callback for Draw.Register()
52
58
    global R,G,B,A                       # ... it handles input events
53
59
    if evt == Draw.ESCKEY or evt == Draw.QKEY:
54
60
      Draw.Exit()                        # this quits the script
 
61
    elif not val: return
55
62
    elif evt == Draw.LEFTMOUSE: R = 1 - R
56
63
    elif evt == Draw.MIDDLEMOUSE: G = 1 - G
57
64
    elif evt == Draw.RIGHTMOUSE: B = 1 - B
 
65
    elif evt == Draw.WHEELUPMOUSE:
 
66
      R += 0.1
 
67
      if R > 1: R = 1
 
68
    elif evt == Draw.WHEELDOWNMOUSE:
 
69
      R -= 0.1
 
70
      if R < 0: R = 0
58
71
    else:
59
 
      Draw.Register(show_win, ev, None)
 
72
      return                             # don't redraw if nothing changed
 
73
    Draw.Redraw(1)                       # make changes visible.
60
74
  #
61
 
    Draw.Register(show_win, ev, None)     # start the main loop
 
75
  Draw.Register(show_win, ev, None)      # start the main loop
62
76
 
 
77
@note: you can use the L{Image} module and L{Image.Image} bpy object to load
 
78
    and set textures.  See L{Image.Image.glLoad} and L{Image.Image.glFree},
 
79
    for example.
63
80
@see: U{www.opengl.org}
64
81
@see: U{nehe.gamedev.net}
65
 
 
66
82
"""
67
83
 
68
84
def glAccum(op, value):
69
85
  """
70
86
  Operate on the accumulation buffer
71
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/accum.html}
 
87
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/accum.html}
72
88
 
73
89
  @type op: Enumerated constant
74
90
  @param op: The accumulation buffer operation. 
79
95
def glAlphaFunc(func, ref):
80
96
  """
81
97
  Specify the alpha test function
82
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/alphafunc.html}
 
98
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/alphafunc.html}
83
99
  
84
100
  @type func: Enumerated constant
85
101
  @param func: Specifies the alpha comparison function. 
91
107
def glAreTexturesResident(n, textures, residences):
92
108
  """
93
109
  Determine if textures are loaded in texture memory
94
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/aretexturesresident.html}
 
110
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/aretexturesresident.html}
95
111
 
96
112
  @type n: int
97
113
  @param n: Specifies the number of textures to be queried.
105
121
def glBegin(mode):
106
122
  """
107
123
  Delimit the vertices of a primitive or a group of like primatives
108
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/begin.html}
 
124
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/begin.html}
109
125
 
110
126
  @type mode: Enumerated constant
111
127
  @param mode: Specifies the primitive that will be create from vertices between glBegin and
115
131
def glBindTexture(target, texture):
116
132
  """
117
133
  Bind a named texture to a textureing target
118
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/bindtexture.html}
 
134
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/bindtexture.html}
119
135
 
120
136
  @type target: Enumerated constant
121
137
  @param target: Specifies the target to which the texture is bound. 
126
142
def glBitmap(width, height, xorig, yorig, xmove, ymove, bitmap):
127
143
  """
128
144
  Draw a bitmap
129
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/bitmap.html}
 
145
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/bitmap.html}
130
146
 
131
147
  @type width, height: int
132
148
  @param width, height: Specify the pixel width and height of the bitmap image.
133
149
  @type xorig,yorig: float
134
150
  @param xorig,yorig: Specify the location of the origin in the bitmap image. The origin is measured
135
 
  from the lower left cornere of the bitmap, with right and up beigng the positive axes.
 
151
  from the lower left corner of the bitmap, with right and up beigng the positive axes.
136
152
  @type xmove,ymove: float
137
153
  @param xmove,ymove: Specify the x and y offsets to be added to the current raster position after 
138
154
  the bitmap is drawn. 
143
159
def glBlendFunc(sfactor, dfactor):
144
160
  """
145
161
  Specify pixel arithmetic
146
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/blendfunc.html}
 
162
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/blendfunc.html}
147
163
 
148
164
  @type sfactor: Enumerated constant
149
165
  @param sfactor: Specifies how the red, green, blue, and alpha source blending factors are 
156
172
def glCallList(list):
157
173
  """
158
174
  Execute a display list
159
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/calllist.html}
 
175
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/calllist.html}
160
176
 
161
177
  @type list: unsigned int
162
178
  @param list: Specifies the integer name of the display list to be executed.
165
181
def glCallLists(n, type, lists):
166
182
  """
167
183
  Execute a list of display lists
168
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/calllists.html}
 
184
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/calllists.html}
169
185
 
170
186
  @type n: int
171
187
  @param n: Specifies the number of display lists to be executed. 
180
196
def glClear(mask):
181
197
  """
182
198
  Clear buffers to preset values
183
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/clear.html}
 
199
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clear.html}
184
200
 
185
201
  @type mask: Enumerated constant(s)
186
202
  @param mask: Bitwise OR of masks that indicate the buffers to be cleared. 
189
205
def glClearAccum(red, green, blue, alpha):
190
206
  """
191
207
  Specify clear values for the accumulation buffer
192
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/clearaccum.html}
 
208
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearaccum.html}
193
209
 
194
210
  @type red,green,blue,alpha: float
195
211
  @param red,green,blue,alpha: Specify the red, green, blue, and alpha values used when the 
199
215
def glClearColor(red, green, blue, alpha):
200
216
  """
201
217
  Specify clear values for the color buffers
202
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/clearcolor.html}
 
218
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearcolor.html}
203
219
 
204
220
  @type red,green,blue,alpha: float
205
221
  @param red,green,blue,alpha: Specify the red, green, blue, and alpha values used when the 
209
225
def glClearDepth(depth):
210
226
  """
211
227
  Specify the clear value for the depth buffer
212
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/cleardepth.html}
 
228
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/cleardepth.html}
213
229
 
214
230
  @type depth: int
215
231
  @param depth: Specifies the depth value used when the depth buffer is cleared. 
219
235
def glClearIndex(c):
220
236
  """
221
237
  Specify the clear value for the color index buffers
222
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/clearindex.html}
 
238
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearindex.html}
223
239
 
224
240
  @type c: float
225
241
  @param c: Specifies the index used when the color index buffers are cleared. 
229
245
def glClearStencil(s):
230
246
  """
231
247
  Specify the clear value for the stencil buffer
232
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/clearstencil.html}
 
248
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearstencil.html}
233
249
 
234
250
  @type s: int
235
251
  @param s: Specifies the index used when the stencil buffer is cleared. The initial value is 0. 
238
254
def glClipPlane (plane, equation):
239
255
  """
240
256
  Specify a plane against which all geometery is clipped
241
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/clipplane.html}
 
257
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clipplane.html}
242
258
 
243
259
  @type plane: Enumerated constant
244
260
  @param plane: Specifies which clipping plane is being positioned. 
256
272
  glColor4uiv, glColor4usv}
257
273
 
258
274
  Set a new color.
259
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/color.html}
 
275
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/color.html}
260
276
 
261
277
  @type red,green,blue,alpha: Depends on function prototype. 
262
278
  @param red,green,blue: Specify new red, green, and blue values for the current color. 
267
283
def glColorMask(red, green, blue, alpha):
268
284
  """
269
285
  Enable and disable writing of frame buffer color components
270
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/colormask.html}
 
286
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/colormask.html}
271
287
 
272
288
  @type red,green,blue,alpha: int (boolean)
273
289
  @param red,green,blue,alpha: Specify whether red, green, blue, and alpha can or cannot be 
278
294
def glColorMaterial(face, mode):
279
295
  """
280
296
  Cause a material color to track the current color 
281
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/colormaterial.html}
 
297
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/colormaterial.html}
282
298
 
283
299
  @type face: Enumerated constant
284
300
  @param face: Specifies whether front, back, or both front and back material parameters should 
290
306
def glCopyPixels(x, y, width, height, type):
291
307
  """
292
308
  Copy pixels in the frame buffer
293
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/copypixels.html}
 
309
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/copypixels.html}
294
310
 
295
311
  @type x,y: int
296
312
  @param x,y: Specify the window coordinates of the lower left corner of the rectangular 
305
321
def glCullFace(mode):
306
322
  """
307
323
  Specify whether front- or back-facing facets can be culled 
308
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/cullface.html}
 
324
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/cullface.html}
309
325
 
310
326
  @type mode: Enumerated constant
311
327
  @param mode: Specifies whether front- or back-facing facets are candidates for culling. 
314
330
def glDeleteLists(list, range):
315
331
  """
316
332
  Delete a contiguous group of display lists
317
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/deletelists.html}
 
333
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/deletelists.html}
318
334
 
319
335
  @type list: unsigned int
320
336
  @param list: Specifiex the integer name of the first display list to delete
325
341
def glDeleteTextures(n, textures):
326
342
  """
327
343
  Delete named textures
328
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/deletetextures.html}
 
344
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/deletetextures.html}
329
345
 
330
346
  @type n: int
331
347
  @param n: Specifes the number of textures to be deleted
336
352
def glDepthFunc(func):
337
353
  """
338
354
  Specify the value used for depth buffer comparisons 
339
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/depthfunc.html}
 
355
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/depthfunc.html}
340
356
 
341
357
  @type func: Enumerated constant
342
358
  @param func: Specifies the depth comparison function. 
345
361
def glDepthMask(flag):
346
362
  """
347
363
  Enable or disable writing into the depth buffer
348
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/depthmask.html}
 
364
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/depthmask.html}
349
365
 
350
366
  @type flag: int (boolean)
351
367
  @param flag: Specifies whether the depth buffer is enabled for writing. If flag is GL_FALSE,
356
372
def glDepthRange(zNear, zFar):
357
373
  """
358
374
  Specify mapping of depth values from normalized device coordinates to window coordinates 
359
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/depthrange.html}
 
375
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/depthrange.html}
360
376
 
361
377
  @type zNear: int
362
378
  @param zNear: Specifies the mapping of the near clipping plane to window coordinates. 
369
385
def glDisable(cap):
370
386
  """
371
387
  Disable server-side GL capabilities
372
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/enable.html}
 
388
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/enable.html}
373
389
 
374
390
  @type cap: Enumerated constant
375
391
  @param cap: Specifies a symbolic constant indicating a GL capability.
378
394
def glDrawBuffer(mode):
379
395
  """
380
396
  Specify which color buffers are to be drawn into
381
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/drawbuffer.html}
 
397
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/drawbuffer.html}
382
398
 
383
399
  @type mode: Enumerated constant
384
400
  @param mode: Specifies up to four color buffers to be drawn into. 
387
403
def glDrawPixels(width, height, format, type, pixels):
388
404
  """
389
405
  Write a block of pixels to the frame buffer
390
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/drawpixels.html}
 
406
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/drawpixels.html}
391
407
 
392
408
  @type width, height: int
393
409
  @param width, height: Specify the dimensions of the pixel rectangle to be 
405
421
  B{glEdgeFlag, glEdgeFlagv}
406
422
 
407
423
  Flag edges as either boundary or nonboundary
408
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/edgeflag.html}
 
424
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/edgeflag.html}
409
425
 
410
426
  @type flag: Depends of function prototype
411
427
  @param flag: Specifies the current edge flag value.The initial value is GL_TRUE. 
414
430
def glEnable(cap):
415
431
  """
416
432
  Enable server-side GL capabilities
417
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/enable.html}
 
433
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/enable.html}
418
434
 
419
435
  @type cap: Enumerated constant
420
436
  @param cap: Specifies a symbolic constant indicating a GL capability.
423
439
def glEnd():
424
440
  """
425
441
  Delimit the vertices of a primitive or group of like primitives
426
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/begin.html}
 
442
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/begin.html}
427
443
  """
428
444
 
429
445
def glEndList():
430
446
  """
431
447
  Create or replace a display list
432
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/newlist.html}
 
448
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/newlist.html}
433
449
  """
434
450
 
435
451
def glEvalCoord (u,v):
438
454
  glEvalCoord2dv, glEvalCoord2fv}
439
455
 
440
456
  Evaluate enabled one- and two-dimensional maps
441
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/evalcoord.html}
 
457
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/evalcoord.html}
442
458
 
443
459
  @type u: Depends on function prototype.
444
460
  @param u: Specifies a value that is the domain coordinate u to the basis function defined 
455
471
  B{glEvalMesh1 or glEvalMesh2}
456
472
 
457
473
  Compute a one- or two-dimensional grid of points or lines
458
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/evalmesh.html}
 
474
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/evalmesh.html}
459
475
 
460
476
  @type mode: Enumerated constant
461
477
  @param mode: In glEvalMesh1, specifies whether to compute a one-dimensional 
469
485
  B{glEvalPoint1 and glEvalPoint2}
470
486
 
471
487
  Generate and evaluate a single point in a mesh
472
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/evalpoint.html}
 
488
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/evalpoint.html}
473
489
 
474
490
  @type i: int
475
491
  @param i: Specifies the integer value for grid domain variable i.
480
496
def glFeedbackBuffer (size, type, buffer):
481
497
  """
482
498
  Controls feedback mode
483
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/feedbackbuffer.html}
 
499
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/feedbackbuffer.html}
484
500
 
485
501
  @type size: int
486
502
  @param size:Specifies the maximum number of values that can be written into buffer. 
494
510
def glFinish():
495
511
  """
496
512
  Block until all GL execution is complete
497
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/finish.html}
 
513
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/finish.html}
498
514
  """
499
515
 
500
516
def glFlush():
501
517
  """
502
518
  Force Execution of GL commands in finite time
503
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/flush.html}
 
519
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/flush.html}
504
520
  """
505
521
 
506
522
def glFog (pname, param):
508
524
  B{glFogf, glFogi, glFogfv, glFogiv}
509
525
 
510
526
  Specify fog parameters
511
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/fog.html}
 
527
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/fog.html}
512
528
 
513
529
  @type pname: Enumerated constant
514
530
  @param pname: Specifies a single-valued fog parameter. If the function prototype
522
538
def glFrontFace(mode):
523
539
  """
524
540
  Define front- and back-facing polygons
525
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/frontface.html}
 
541
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/frontface.html}
526
542
 
527
543
  @type mode: Enumerated constant
528
544
  @param mode: Specifies the orientation of front-facing polygons.
531
547
def glFrustum(left, right, bottom, top, zNear, zFar):
532
548
  """
533
549
  Multiply the current matrix by a perspective matrix
534
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/frustum.html}
 
550
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/frustum.html}
535
551
 
536
552
  @type left, right: double (float)
537
553
  @param left, right: Specify the coordinates for the left and right vertical 
547
563
def glGenLists(range):
548
564
  """
549
565
  Generate a contiguous set of empty display lists
550
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/genlists.html}
 
566
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/genlists.html}
551
567
 
552
568
  @type range: int
553
569
  @param range: Specifies the number of contiguous empty display lists to be generated. 
556
572
def glGenTextures(n, textures):
557
573
  """
558
574
  Generate texture names
559
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/gentextures.html}
 
575
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gentextures.html}
560
576
 
561
577
  @type n: int
562
578
  @param n: Specifies the number of textures name to be generated.
569
585
  B{glGetBooleanv, glGetfloatv, glGetFloatv, glGetIntegerv}
570
586
 
571
587
  Return the value or values of a selected parameter
572
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/get.html}
 
588
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/get.html}
573
589
 
574
590
  @type pname: Enumerated constant
575
591
  @param pname: Specifies the parameter value to be returned. 
580
596
def glGetClipPlane(plane, equation):
581
597
  """
582
598
  Return the coefficients of the specified clipping plane 
583
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/getclipplane.html}
 
599
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getclipplane.html}
584
600
 
585
601
  @type plane: Enumerated constant
586
602
  @param plane: Specifies a clipping plane. The number of clipping planes depends on the 
594
610
def glGetError():
595
611
  """
596
612
  Return error information
597
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/geterror.html}
 
613
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/geterror.html}
598
614
  """
599
615
 
600
616
def glGetLight (light, pname, params):
602
618
  B{glGetLightfv and glGetLightiv}
603
619
 
604
620
  Return light source parameter values
605
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/getlight.html}
 
621
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getlight.html}
606
622
 
607
623
  @type light: Enumerated constant
608
624
  @param light: Specifies a light source. The number of possible lights depends on the 
619
635
  B{glGetMapdv, glGetMapfv, glGetMapiv}
620
636
 
621
637
  Return evaluator parameters
622
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/getmap.html}
 
638
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getmap.html}
623
639
 
624
640
  @type target: Enumerated constant
625
641
  @param target: Specifies the symbolic name of a map. 
634
650
  B{glGetMaterialfv, glGetMaterialiv}
635
651
 
636
652
  Return material parameters
637
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/getmaterial.html}
 
653
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getmaterial.html}
638
654
 
639
655
  @type face: Enumerated constant
640
656
  @param face: Specifies which of the two materials is being queried.  
650
666
  B{glGetPixelMapfv, glGetPixelMapuiv, glGetPixelMapusv}
651
667
 
652
668
  Return the specified pixel map
653
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/getpixelmap.html}
 
669
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getpixelmap.html}
654
670
 
655
671
  @type map:  Enumerated constant
656
672
  @param map: Specifies the name of the pixel map to return. 
661
677
def glGetPolygonStipple(mask):
662
678
  """
663
679
  Return the polygon stipple pattern
664
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/getpolygonstipple.html}
 
680
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getpolygonstipple.html}
665
681
 
666
682
  @type mask: Buffer object I{type GL_BYTE}
667
683
  @param mask: Returns the stipple pattern. The initial value is all 1's.
670
686
def glGetString(name):
671
687
  """
672
688
  Return a strin describing the current GL connection
673
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/getstring.html}
 
689
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getstring.html}
674
690
 
675
691
  @type name: Enumerated constant
676
692
  @param name: Specifies a symbolic constant. 
682
698
  B{glGetTexEnvfv, glGetTexEnviv}
683
699
 
684
700
  Return texture environment parameters
685
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/gettexenv.html}
 
701
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gettexenv.html}
686
702
 
687
703
  @type target: Enumerated constant
688
704
  @param target: Specifies a texture environment. Must be GL_TEXTURE_ENV. 
697
713
  B{glGetTexGendv, glGetTexGenfv, glGetTexGeniv}
698
714
 
699
715
  Return texture coordinate generation parameters
700
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/gettexgen.html}
 
716
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gettexgen.html}
701
717
 
702
718
  @type coord: Enumerated constant
703
719
  @param coord: Specifies a texture coordinate. 
710
726
def glGetTexImage(target, level, format, type, pixels):
711
727
  """
712
728
  Return a texture image
713
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/getteximage.html}
 
729
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getteximage.html}
714
730
 
715
731
  @type target: Enumerated constant
716
732
  @param target: Specifies which texture is to be obtained. 
731
747
  B{glGetTexLevelParameterfv, glGetTexLevelParameteriv}
732
748
 
733
749
  return texture parameter values for a specific level of detail 
734
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/gettexlevelparameter.html}
 
750
  @see: U{opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/gettexlevelparameter.html}
735
751
 
736
752
  @type target: Enumerated constant
737
753
  @param target: Specifies the symbolic name of the target texture. 
749
765
  B{glGetTexParameterfv, glGetTexParameteriv}
750
766
 
751
767
  Return texture parameter values 
752
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/gettexparameter.html}
 
768
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gettexparameter.html}
753
769
 
754
770
  @type target: Enumerated constant
755
771
  @param target: Specifies the symbolic name of the target texture. 
762
778
def glHint(target, mode):
763
779
  """
764
780
  Specify implementation-specific hints
765
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/hint.html}
 
781
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/hint.html}
766
782
 
767
783
  @type target: Enumerated constant
768
784
  @param target: Specifies a symbolic constant indicating the behavior to be 
776
792
  B{glIndexd, glIndexf, glIndexi, glIndexs,  glIndexdv, glIndexfv, glIndexiv, glIndexsv}
777
793
 
778
794
  Set the current color index
779
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/index_.html}
 
795
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/index_.html}
780
796
 
781
797
  @type c: Buffer object. Depends on function prototype.
782
798
  @param c: Specifies a pointer to a one element array that contains the new value for
786
802
def glInitNames():
787
803
  """
788
804
  Initialize the name stack
789
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/initnames.html}
 
805
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/initnames.html}
790
806
  """
791
807
 
792
808
def glIsEnabled(cap):
793
809
  """
794
810
  Test whether a capability is enabled
795
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/isenabled.html}
 
811
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/isenabled.html}
796
812
 
797
813
  @type cap: Enumerated constant
798
814
  @param cap: Specifies a constant representing a GL capability.
801
817
def glIsList(list):
802
818
  """
803
819
  Determine if a name corresponds to a display-list
804
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/islist.html}
 
820
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/islist.html}
805
821
 
806
822
  @type list: unsigned int
807
823
  @param list: Specifies a potential display-list name.
810
826
def glIsTexture(texture):
811
827
  """
812
828
  Determine if a name corresponds to a texture
813
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/istexture.html}
 
829
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/istexture.html}
814
830
 
815
831
  @type texture: unsigned int
816
832
  @param texture: Specifies a value that may be the name of a texture.
821
837
  B{glLightf,glLighti, glLightfv, glLightiv}
822
838
 
823
839
  Set the light source parameters
824
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/light.html}
 
840
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/light.html}
825
841
 
826
842
  @type light: Enumerated constant
827
843
  @param light: Specifies a light. The number of lights depends on the implementation, 
840
856
  B{glLightModelf, glLightModeli, glLightModelfv, glLightModeliv}
841
857
 
842
858
  Set the lighting model parameters
843
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/lightmodel.html}
 
859
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/lightmodel.html}
844
860
 
845
861
  @type pname:  Enumerated constant
846
862
  @param pname: Specifies a single-value light model parameter. 
852
868
def glLineStipple(factor, pattern):
853
869
  """
854
870
  Specify the line stipple pattern
855
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/linestipple.html}
 
871
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/linestipple.html}
856
872
 
857
873
  @type factor: int
858
874
  @param factor: Specifies a multiplier for each bit in the line stipple pattern. 
868
884
def glLineWidth(width):
869
885
  """
870
886
  Specify the width of rasterized lines.
871
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/linewidth.html}
 
887
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/linewidth.html}
872
888
 
873
889
  @type width: float
874
890
  @param width: Specifies the width of rasterized lines. The initial value is 1. 
877
893
def glListBase(base):
878
894
  """
879
895
  Set the display-list base for glCallLists 
880
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/listbase.html}
 
896
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/listbase.html}
881
897
 
882
898
  @type base: unsigned int
883
899
  @param base: Specifies an integer offset that will be added to glCallLists 
887
903
def glLoadIdentity():
888
904
  """
889
905
  Replace the current matrix with the identity matrix 
890
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/loadidentity.html}
 
906
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/loadidentity.html}
891
907
  """
892
908
 
893
909
def glLoadMatrix (m):
895
911
  B{glLoadMatrixd, glLoadMatixf}
896
912
 
897
913
  Replace the current matrix with the specified matrix 
898
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/loadmatrix.html}
 
914
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/loadmatrix.html}
899
915
 
900
916
  @type m: Buffer object. Depends on function prototype.
901
917
  @param m: Specifies a pointer to 16 consecutive values, which are used as the elements 
905
921
def glLoadName(name):
906
922
  """
907
923
  Load a name onto the name stack.
908
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/loadname.html}
 
924
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/loadname.html}
909
925
 
910
926
  @type name: unsigned int
911
927
  @param name: Specifies a name that will replace the top value on the name stack. 
914
930
def glLogicOp(opcode):
915
931
  """
916
932
  Specify a logical pixel operation for color index rendering 
917
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/logicop.html}
 
933
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/logicop.html}
918
934
 
919
935
  @type opcode: Enumerated constant
920
936
  @param opcode: Specifies a symbolic constant that selects a logical operation. 
925
941
  B{glMap1d, glMap1f}
926
942
 
927
943
  Define a one-dimensional evaluator
928
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/map1.html}
 
944
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/map1.html}
929
945
 
930
946
  @type target: Enumerated constant
931
947
  @param target: Specifies the kind of values that are generated by the evaluator. 
949
965
  B{glMap2d, glMap2f}
950
966
 
951
967
  Define a two-dimensional evaluator
952
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/map2.html}
 
968
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/map2.html}
953
969
 
954
970
  @type target: Enumerated constant
955
971
  @param target: Specifies the kind of values that are generated by the evaluator. 
988
1004
  B{glMapGrid1d, glMapGrid1f, glMapGrid2d, glMapGrid2f}
989
1005
 
990
1006
  Define a one- or two-dimensional mesh
991
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/mapgrid.html}
 
1007
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/mapgrid.html}
992
1008
 
993
1009
  @type un: int
994
1010
  @param un: Specifies the number of partitions in the grid range interval 
1006
1022
def glMaterial (face, pname, params):
1007
1023
  """
1008
1024
  Specify material parameters for the lighting model.
1009
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/material.html}
 
1025
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/material.html}
1010
1026
  
1011
1027
  @type face: Enumerated constant
1012
1028
  @param face: Specifies which face or faces are being updated. Must be one of:
1022
1038
def glMatrixMode(mode):
1023
1039
  """
1024
1040
  Specify which matrix is the current matrix.
1025
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/matrixmode.html}
 
1041
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/matrixmode.html}
1026
1042
 
1027
1043
  @type mode: Enumerated constant
1028
1044
  @param mode: Specifies which matrix stack is the target for subsequent matrix operations. 
1033
1049
  B{glMultMatrixd, glMultMatrixf}
1034
1050
 
1035
1051
  Multiply the current matrix with the specified matrix
1036
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/multmatrix.html}
 
1052
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/multmatrix.html}
1037
1053
 
1038
1054
  @type m: Buffer object. Depends on function prototype.
1039
1055
  @param m: Points to 16 consecutive values that are used as the elements of a 4x4 column
1043
1059
def glNewList(list, mode):
1044
1060
  """
1045
1061
  Create or replace a display list
1046
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/newlist.html}
 
1062
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/newlist.html}
1047
1063
  
1048
1064
  @type list: unsigned int
1049
1065
  @param list: Specifies the display list name
1057
1073
  Normal3s, Normal3sv}
1058
1074
 
1059
1075
  Set the current normal vector
1060
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/normal.html}
 
1076
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/normal.html}
1061
1077
  
1062
1078
  @type nx, ny, nz: Depends on function prototype. (non - 'v' prototypes only)
1063
1079
  @param nx, ny, nz: Specify the x, y, and z coordinates of the new current normal. 
1070
1086
def glOrtho(left, right, bottom, top, zNear, zFar):
1071
1087
  """
1072
1088
  Multiply the current matrix with an orthographic matrix
1073
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/ortho.html}
 
1089
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/ortho.html}
1074
1090
  
1075
1091
  @type left, right: double (float)
1076
1092
  @param left, right: Specify the coordinates for the left and 
1086
1102
def glPassThrough(token):
1087
1103
  """
1088
1104
  Place a marker in the feedback buffer
1089
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/passthrough.html}
 
1105
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/passthrough.html}
1090
1106
 
1091
1107
  @type token: float
1092
1108
  @param token: Specifies a marker value to be placed in the feedback 
1098
1114
  B{glPixelMapfv, glPixelMapuiv, glPixelMapusv}
1099
1115
 
1100
1116
  Set up pixel transfer maps
1101
 
  @see:  U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/pixelmap.html}
 
1117
  @see:  U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixelmap.html}
1102
1118
 
1103
1119
  @type map: Enumerated constant
1104
1120
  @param map: Specifies a symbolic map name.
1113
1129
  B{glPixelStoref, glPixelStorei}
1114
1130
 
1115
1131
  Set pixel storage modes
1116
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/pixelstore.html}
 
1132
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixelstore.html}
1117
1133
  
1118
1134
  @type pname: Enumerated constant
1119
1135
  @param pname: Specifies the symbolic name of the parameter to be set. 
1128
1144
  B{glPixelTransferf, glPixelTransferi}
1129
1145
 
1130
1146
  Set pixel transfer modes
1131
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/pixeltransfer.html}
 
1147
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixeltransfer.html}
1132
1148
 
1133
1149
  @type pname: Enumerated constant
1134
1150
  @param pname: Specifies the symbolic name of the pixel transfer parameter to be set. 
1139
1155
def glPixelZoom(xfactor, yfactor):
1140
1156
  """
1141
1157
  Specify the pixel zoom factors
1142
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/pixelzoom.html}
 
1158
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixelzoom.html}
1143
1159
  
1144
1160
  @type xfactor, yfactor: float
1145
1161
  @param xfactor, yfactor: Specify the x and y zoom factors for pixel write operations.
1148
1164
def glPointSize(size):
1149
1165
  """
1150
1166
  Specify the diameter of rasterized points
1151
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/pointsize.html}
 
1167
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pointsize.html}
1152
1168
  
1153
1169
  @type size: float
1154
1170
  @param size: Specifies the diameter of rasterized points. The initial value is 1.
1157
1173
def glPolygonMode(face, mode):
1158
1174
  """
1159
1175
  Select a polygon rasterization mode
1160
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/polygonmode.html}
 
1176
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/polygonmode.html}
1161
1177
 
1162
1178
  @type face: Enumerated constant
1163
1179
  @param face: Specifies the polygons that mode applies to. 
1171
1187
def glPolygonOffset(factor, units):
1172
1188
  """
1173
1189
  Set the scale and units used to calculate depth values
1174
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/polygonoffset.html}
 
1190
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/polygonoffset.html}
1175
1191
  
1176
1192
  @type factor: float
1177
1193
  @param factor: Specifies a scale factor that is used to create a variable depth 
1184
1200
def glPolygonStipple(mask):
1185
1201
  """
1186
1202
  Set the polygon stippling pattern
1187
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/polygonstipple.html}
 
1203
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/polygonstipple.html}
1188
1204
  
1189
1205
  @type mask: Buffer object I{type GL_BYTE}
1190
1206
  @param mask: Specifies a pointer to a 32x32 stipple pattern that will be unpacked 
1194
1210
def glPopAttrib():
1195
1211
  """
1196
1212
  Pop the server attribute stack
1197
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/pushattrib.html}
 
1213
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushattrib.html}
1198
1214
  """
1199
1215
 
1200
1216
def glPopMatrix():
1201
1217
  """
1202
1218
  Pop the current matrix stack
1203
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/pushmatrix.html}
 
1219
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushmatrix.html}
1204
1220
  """
1205
1221
 
1206
1222
def glPopName():
1207
1223
  """
1208
1224
  Pop the name stack
1209
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/pushname.html}
 
1225
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushname.html}
1210
1226
  """
1211
1227
 
1212
1228
def glPrioritizeTextures(n, textures, priorities):
1213
1229
  """
1214
1230
  Set texture residence priority
1215
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/prioritizetextures.html}
 
1231
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/prioritizetextures.html}
1216
1232
  
1217
1233
  @type n: int
1218
1234
  @param n:Specifies the number of textures to be prioritized. 
1226
1242
def glPushAttrib(mask):
1227
1243
  """
1228
1244
  Push the server attribute stack
1229
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/pushattrib.html}
 
1245
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushattrib.html}
1230
1246
 
1231
1247
  @type mask: Enumerated constant(s)
1232
1248
  @param mask: Specifies a mask that indicates which attributes to save.
1235
1251
def glPushMatrix():
1236
1252
  """
1237
1253
  Push the current matrix stack
1238
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/pushmatrix.html}
 
1254
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushmatrix.html}
1239
1255
  """
1240
1256
 
1241
1257
def glPushName(name):
1242
1258
  """
1243
1259
  Push the name stack
1244
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/pushname.html}
 
1260
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushname.html}
1245
1261
 
1246
1262
  @type name: unsigned int
1247
1263
  @param name: Specifies a name that will be pushed onto the name stack.
1256
1272
  glRasterPos4dv, glRasterPos4fv, glRasterPos4iv, glRasterPos4sv}
1257
1273
 
1258
1274
  Specify the raster position for pixel operations
1259
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/rasterpos.html}
 
1275
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rasterpos.html}
1260
1276
 
1261
1277
  @type x, y, z, w: Depends on function prototype. (z and w for '3' and '4' prototypes only)
1262
1278
  @param x,y,z,w: Specify the x,y,z, and w object coordinates (if present) for the 
1267
1283
def glReadBuffer(mode):
1268
1284
  """
1269
1285
  Select a color buffer source for pixels.
1270
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/readbuffer.html}
 
1286
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/readbuffer.html}
1271
1287
  
1272
1288
  @type mode: Enumerated constant
1273
1289
  @param mode: Specifies a color buffer. 
1276
1292
def glReadPixels(x, y, width, height, format, type, pixels):
1277
1293
  """
1278
1294
  Read a block of pixels from the frame buffer
1279
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/readpixels.html}
 
1295
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/readpixels.html}
1280
1296
  
1281
1297
  @type x,y: int
1282
1298
  @param x,y:Specify the window coordinates of the first pixel that is read 
1298
1314
  B{glRectd, glRectf, glRecti, glRects, glRectdv, glRectfv, glRectiv, glRectsv}
1299
1315
 
1300
1316
  Draw a rectangle
1301
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/rect.html}
 
1317
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rect.html}
1302
1318
 
1303
1319
  @type x1, y1: Depends on function prototype. (for non 'v' prototypes only)
1304
1320
  @param x1, y1: Specify one vertex of a rectangle
1312
1328
def glRenderMode(mode):
1313
1329
  """
1314
1330
  Set rasterization mode
1315
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/rendermode.html}
 
1331
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rendermode.html}
1316
1332
  
1317
1333
  @type mode: Enumerated constant
1318
1334
  @param mode: Specifies the rasterization mode. 
1323
1339
  B{glRotated, glRotatef}
1324
1340
 
1325
1341
  Multiply the current matrix by a rotation matrix
1326
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/rotate.html}
 
1342
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rotate.html}
1327
1343
 
1328
1344
  @type angle:  Depends on function prototype.
1329
1345
  @param angle:  Specifies the angle of rotation in degrees.
1336
1352
  B{glScaled, glScalef}
1337
1353
 
1338
1354
  Multiply the current matrix by a general scaling matrix
1339
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/scale.html}
 
1355
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/scale.html}
1340
1356
 
1341
1357
  @type x,y,z: Depends on function prototype.
1342
1358
  @param x,y,z: Specify scale factors along the x,y, and z axes, respectively.
1345
1361
def glScissor(x,y,width,height):
1346
1362
  """
1347
1363
  Define the scissor box
1348
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/scissor.html}
 
1364
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/scissor.html}
1349
1365
 
1350
1366
  @type x,y: int
1351
1367
  @param x,y: Specify the lower left corner of the scissor box. Initially (0, 0). 
1358
1374
def glSelectBuffer(size, buffer):
1359
1375
  """
1360
1376
  Establish a buffer for selection mode values
1361
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/selectbuffer.html}
 
1377
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/selectbuffer.html}
1362
1378
 
1363
1379
  @type size: int
1364
1380
  @param size: Specifies the size of buffer
1369
1385
def glShadeModel(mode):
1370
1386
  """
1371
1387
  Select flat or smooth shading
1372
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/shademodel.html}
 
1388
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/shademodel.html}
1373
1389
  
1374
1390
  @type mode: Enumerated constant
1375
1391
  @param mode: Specifies a symbolic value representing a shading technique.  
1378
1394
def glStencilFuc(func, ref, mask):
1379
1395
  """
1380
1396
  Set function and reference value for stencil testing
1381
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/stencilfunc.html}
 
1397
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/stencilfunc.html}
1382
1398
 
1383
1399
  @type func: Enumerated constant
1384
1400
  @param func:Specifies the test function. 
1394
1410
def glStencilMask(mask):
1395
1411
  """
1396
1412
  Control the writing of individual bits in the stencil planes
1397
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/stencilmask.html}
 
1413
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/stencilmask.html}
1398
1414
  
1399
1415
  @type mask: unsigned int
1400
1416
  @param mask: Specifies a bit mask to enable and disable writing of individual bits 
1404
1420
def glStencilOp(fail, zfail, zpass):
1405
1421
  """
1406
1422
  Set stencil test actions
1407
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/stencilop.html}
 
1423
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/stencilop.html}
1408
1424
  
1409
1425
  @type fail: Enumerated constant
1410
1426
  @param fail: Specifies the action to take when the stencil test fails. 
1430
1446
  glTexCoord4dv, glTexCoord4fv, glTexCoord4iv, glTexCoord4sv}
1431
1447
 
1432
1448
  Set the current texture coordinates
1433
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/texcoord.html}
 
1449
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texcoord.html}
1434
1450
  
1435
1451
  @type s,t,r,q: Depends on function prototype. (r and q for '3' and '4' prototypes only)
1436
1452
  @param s,t,r,q: Specify s, t, r, and q texture coordinates. Not all parameters are 
1445
1461
  B{glTextEnvf, glTextEnvi, glTextEnvfv, glTextEnviv}
1446
1462
 
1447
1463
  Set texture environment parameters
1448
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/texenv.html} 
 
1464
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texenv.html} 
1449
1465
 
1450
1466
  @type target: Enumerated constant
1451
1467
  @param target: Specifies a texture environment. Must be GL_TEXTURE_ENV.
1463
1479
  B{glTexGend, glTexGenf, glTexGeni, glTexGendv, glTexGenfv, glTexGeniv}
1464
1480
 
1465
1481
  Control the generation of texture coordinates
1466
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/texgen.html}
 
1482
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texgen.html}
1467
1483
  
1468
1484
  @type coord: Enumerated constant
1469
1485
  @param coord: Specifies a texture coordinate. 
1480
1496
def glTexImage1D(target, level, internalformat, width, border, format, type, pixels):
1481
1497
  """
1482
1498
  Specify a one-dimensional texture image
1483
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/teximage1d.html}
 
1499
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/teximage1d.html}
1484
1500
 
1485
1501
  @type target: Enumerated constant
1486
1502
  @param target: Specifies the target texture. 
1506
1522
def glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels):
1507
1523
  """
1508
1524
  Specify a two-dimensional texture image
1509
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/teximage2d.html}
 
1525
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/teximage2d.html}
1510
1526
 
1511
1527
  @type target: Enumerated constant
1512
1528
  @param target: Specifies the target texture. 
1538
1554
  B{glTexParameterf, glTexParameteri, glTexParameterfv, glTexParameteriv}
1539
1555
 
1540
1556
  Set texture parameters
1541
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/texparameter.html}
 
1557
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texparameter.html}
1542
1558
 
1543
1559
  @type target: Enumerated constant
1544
1560
  @param target: Specifies the target texture.
1554
1570
  B{glTranslatef, glTranslated}
1555
1571
 
1556
1572
  Multiply the current matrix by a translation matrix
1557
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/translate.html}
 
1573
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/translate.html}
1558
1574
 
1559
1575
  @type x,y,z: Depends on function prototype.
1560
1576
  @param x,y,z: Specify the x, y, and z coordinates of a translation vector. 
1568
1584
  glVertex4fv, glVertex4iv, glVertex4sv}
1569
1585
 
1570
1586
  Specify a vertex
1571
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/vertex.html}
 
1587
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/vertex.html}
1572
1588
  
1573
1589
  @type x,y,z,w: Depends on function prototype (z and w for '3' and '4' prototypes only)
1574
1590
  @param x,y,z,w: Specify x, y, z, and w coordinates of a vertex. Not all parameters 
1582
1598
def glViewport(x,y,width,height):
1583
1599
  """
1584
1600
  Set the viewport
1585
 
  @see: U{http://www.opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/viewport.html}
 
1601
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/viewport.html}
1586
1602
 
1587
1603
  @type x,y: int
1588
1604
  @param x,y: Specify the lower left corner of the viewport rectangle, 
1592
1608
  is first attached to a window, width and height are set to the dimensions of that window. 
1593
1609
  """
1594
1610
 
 
1611
def gluPerspective(fovY, aspect, zNear, zFar):
 
1612
  """
 
1613
  Set up a perspective projection matrix.
 
1614
  @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}
 
1615
 
 
1616
  @type fovY: double
 
1617
  @param fovY: Specifies the field of view angle, in degrees, in the y direction.
 
1618
  @type aspect: double
 
1619
  @param aspect: Specifies the aspect ratio that determines the field of view in the x direction. 
 
1620
   The aspect ratio is the ratio of x (width) to y (height).
 
1621
  @type zNear: double
 
1622
  @param zNear: Specifies the distance from the viewer to the near clipping plane (always positive).
 
1623
  @type zFar: double
 
1624
  @param zFar: Specifies the distance from the viewer to the far clipping plane (always positive).
 
1625
  """
 
1626
 
 
1627
def gluLookAt(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz):
 
1628
  """
 
1629
  Define a viewing transformation
 
1630
  @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}
 
1631
 
 
1632
  @type eyex, eyey, eyez: double
 
1633
  @param eyex, eyey, eyez: Specifies the position of the eye point.  
 
1634
  @type centerx, centery, centerz: double
 
1635
  @param centerx, centery, centerz: Specifies the position of the reference point.
 
1636
  @type upx, upy, upz: double
 
1637
  @param upx, upy, upz: Specifies the direction of the up vector.
 
1638
  """
 
1639
 
 
1640
def gluOrtho2D(left, right, bottom, top):
 
1641
  """
 
1642
  Define a 2-D orthographic projection matrix
 
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}
 
1644
 
 
1645
  @type left, right: double
 
1646
  @param left, right: Specify the coordinates for the left and right vertical clipping planes.
 
1647
  @type bottom, top: double
 
1648
  @param bottom, top: Specify the coordinates for the bottom and top horizontal clipping planes.
 
1649
  """
 
1650
 
 
1651
def gluPickMatrix(x, y, width, height, viewport):
 
1652
  """
 
1653
  Define a picking region
 
1654
  @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}
 
1655
 
 
1656
  @type x, y: double
 
1657
  @param x, y: Specify the center of a picking region in window coordinates.
 
1658
  @type width, height: double
 
1659
  @param width, height: Specify the width and height, respectively, of the picking region in window coordinates.
 
1660
  @type viewport: Buffer object. [int]
 
1661
  @param viewport: Specifies the current viewport.
 
1662
  """
 
1663
 
 
1664
def gluProject(objx, objy, objz, modelMatrix, projMatrix, viewport, winx, winy, winz):
 
1665
  """
 
1666
  Map object coordinates to window coordinates.
 
1667
  @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}
 
1668
  
 
1669
  @type objx, objy, objz: double
 
1670
  @param objx, objy, objz: Specify the object coordinates.
 
1671
  @type modelMatrix: Buffer object. [double]
 
1672
  @param modelMatrix: Specifies the current modelview matrix (as from a glGetDoublev call).
 
1673
  @type projMatrix: Buffer object. [double]
 
1674
  @param projMatrix: Specifies the current projection matrix (as from a glGetDoublev call).
 
1675
  @type viewport: Buffer object. [int]
 
1676
  @param viewport: Specifies the current viewport (as from a glGetIntegerv call).
 
1677
  @type winx, winy, winz: Buffer object. [double]
 
1678
  @param winx, winy, winz: Return the computed window coordinates. 
 
1679
  """
 
1680
 
 
1681
def gluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, objx, objy, objz):
 
1682
  """
 
1683
  Map object coordinates to window
 
1684
  coordinates.
 
1685
  @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}
 
1686
 
 
1687
  @type winx, winy, winz: double
 
1688
  @param winx, winy, winz: Specify the window coordinates to be mapped.
 
1689
  @type modelMatrix: Buffer object. [double]
 
1690
  @param modelMatrix: Specifies the current modelview matrix (as from a glGetDoublev call).
 
1691
  @type projMatrix: Buffer object. [double]
 
1692
  @param projMatrix: Specifies the current projection matrix (as from a glGetDoublev call).
 
1693
  @type viewport: Buffer object. [int]
 
1694
  @param viewport: Specifies the current viewport (as from a glGetIntegerv call).
 
1695
  @type objx, objy, objz: Buffer object. [double]
 
1696
  @param objx, objy, objz: Return the computed object coordinates.
 
1697
  """
 
1698
 
1595
1699
class Buffer:
1596
1700
  """
1597
 
  The Buffer object is simply a block of memory that is delineated and initalized by the
 
1701
  The Buffer object is simply a block of memory that is delineated and initialized by the
1598
1702
  user. Many OpenGL funtions return data to a C-style pointer, however, because this
1599
1703
  is not possible in python the Buffer object can be used to this end. Wherever pointer
1600
1704
  notation is used in the OpenGL functions the Buffer object can be used in it's BGL 
1612
1716
    sliceBuffer = myByteBuffer[0:16]
1613
1717
    print sliceBuffer 
1614
1718
 
1615
 
  @cvar list: The contents of the Buffer.
1616
 
  @cvar dimensions: The size of the Buffer.
 
1719
  @ivar list: The contents of the Buffer.
 
1720
  @ivar dimensions: The size of the Buffer.
1617
1721
  """
1618
1722
 
1619
1723
  def __init__(type, dimensions, template = None):
1640
1744
    @rtype: Buffer object
1641
1745
    @return: The newly created buffer as a PyObject.
1642
1746
    """
1643
 
 
1644
 
 
1645
 
 
1646
 
 
1647
 
 
1648
 
 
1649
 
 
1650
 
 
1651
 
 
1652
 
 
1653
 
 
1654
 
 
1655