~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): Lukas Fittl
  • Date: 2006-09-20 01:57:27 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060920015727-gmoqlxwstx9wwqs3
Tags: 2.42a-1ubuntu1
* Merge from Debian unstable (Closes: Malone #55903). Remaining changes:
  - debian/genpot: Add python scripts from Lee June <blender@eyou.com> to
    generate a reasonable PO template from the sources. Since gettext is used
    in a highly nonstandard way, xgettext does not work for this job.
  - debian/rules: Call the scripts, generate po/blender.pot, and clean it up
    in the clean target.
  - Add a proper header to the generated PO template.
* debian/control: Build depend on libavformat-dev >= 3:0.cvs20060823-3.1,
  otherwise this package will FTBFS

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
  #
75
75
  Draw.Register(show_win, ev, None)      # start the main loop
76
76
 
77
 
@note: you can use the L{Image} module and L{Image.Image} bpy object to load
 
77
@note: you can use the L{Image} module and L{Image.Image} BPy object to load
78
78
    and set textures.  See L{Image.Image.glLoad} and L{Image.Image.glFree},
79
79
    for example.
80
80
@see: U{www.opengl.org}
130
130
 
131
131
def glBindTexture(target, texture):
132
132
  """
133
 
  Bind a named texture to a textureing target
 
133
  Bind a named texture to a texturing target
134
134
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/bindtexture.html}
135
135
 
136
136
  @type target: Enumerated constant
148
148
  @param width, height: Specify the pixel width and height of the bitmap image.
149
149
  @type xorig,yorig: float
150
150
  @param xorig,yorig: Specify the location of the origin in the bitmap image. The origin is measured
151
 
  from the lower left corner of the bitmap, with right and up beigng the positive axes.
 
151
  from the lower left corner of the bitmap, with right and up being the positive axes.
152
152
  @type xmove,ymove: float
153
153
  @param xmove,ymove: Specify the x and y offsets to be added to the current raster position after 
154
154
  the bitmap is drawn. 
253
253
 
254
254
def glClipPlane (plane, equation):
255
255
  """
256
 
  Specify a plane against which all geometery is clipped
 
256
  Specify a plane against which all geometry is clipped
257
257
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clipplane.html}
258
258
 
259
259
  @type plane: Enumerated constant
333
333
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/deletelists.html}
334
334
 
335
335
  @type list: unsigned int
336
 
  @param list: Specifiex the integer name of the first display list to delete
 
336
  @param list: Specifies the integer name of the first display list to delete
337
337
  @type range: int
338
338
  @param range: Specifies the number of display lists to delete
339
339
  """
344
344
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/deletetextures.html}
345
345
 
346
346
  @type n: int
347
 
  @param n: Specifes the number of textures to be deleted
 
347
  @param n: Specifies the number of textures to be deleted
348
348
  @type textures: Buffer I{GL_INT}
349
349
  @param textures: Specifies an array of textures to be deleted
350
350
  """
420
420
  """
421
421
  B{glEdgeFlag, glEdgeFlagv}
422
422
 
423
 
  Flag edges as either boundary or nonboundary
 
423
  Flag edges as either boundary or non-boundary
424
424
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/edgeflag.html}
425
425
 
426
426
  @type flag: Depends of function prototype
685
685
 
686
686
def glGetString(name):
687
687
  """
688
 
  Return a strin describing the current GL connection
 
688
  Return a string describing the current GL connection
689
689
  @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getstring.html}
690
690
 
691
691
  @type name: Enumerated constant
971
971
  @param target: Specifies the kind of values that are generated by the evaluator. 
972
972
  @type u1, u2: Depends on function prototype.
973
973
  @param u1,u2: Specify a linear mapping of u, as presented to glEvalCoord2, to ^, t
974
 
  he variable that is evaluated by the equations specified by this command. Initally
 
974
  he variable that is evaluated by the equations specified by this command. Initially
975
975
  u1 is 0 and u2 is 1.
976
976
  @type ustride: int
977
977
  @param ustride: Specifies the number of floats or float (double)s between the beginning 
978
978
  of control point R and the beginning of control point R ij, where i and j are the u 
979
 
  and v control pointiindices, respectively. This allows control points to be embedded 
 
979
  and v control point indices, respectively. This allows control points to be embedded 
980
980
  in arbitrary data structures. The only constraint is that the values for a particular 
981
981
  control point must occupy contiguous memory locations. The initial value of ustride is 0. 
982
982
  @type uorder: int
1278
1278
  @param x,y,z,w: Specify the x,y,z, and w object coordinates (if present) for the 
1279
1279
  raster position.  If function prototype ends in 'v' specifies a pointer to an array of two, 
1280
1280
  three, or four elements, specifying x, y, z, and w coordinates, respectively.
 
1281
  @note:
 
1282
    If you are drawing to the 3d view with a Scriptlink of a space handler
 
1283
    the zoom level of the panels will scale the glRasterPos by the view matrix.
 
1284
    so a X of 10 will not always offset 10 pixels as you would expect.
 
1285
 
 
1286
    To work around this get the scale value of the view matrix and use it to scale your pixel values.
 
1287
 
 
1288
    Workaround::
 
1289
 
 
1290
      import Blender
 
1291
      from Blender.BGL import *
 
1292
      xval, yval= 100, 40
 
1293
      # Get the scale of the view matrix
 
1294
      viewMatrix = Buffer(GL_FLOAT, 16)
 
1295
      glGetFloatv(GL_MODELVIEW_MATRIX, viewMatrix)
 
1296
      f = 1/viewMatrix[0]
 
1297
      glRasterPos2f(xval*f, yval*f) # Instead of the usual glRasterPos2i(xval, yval)
1281
1298
  """
1282
1299
 
1283
1300
def glReadBuffer(mode):
1536
1553
  some integer n. All implementations support texture images that are at least 64 
1537
1554
  texels wide. 
1538
1555
  @type height: int
1539
 
  @param height: Specifies the hieght of the texture image. Must be 2m+2(border) for 
 
1556
  @param height: Specifies the height of the texture image. Must be 2m+2(border) for 
1540
1557
  some integer m. All implementations support texture images that are at least 64 
1541
1558
  texels high. 
1542
1559
  @type border: int
1699
1716
class Buffer:
1700
1717
  """
1701
1718
  The Buffer object is simply a block of memory that is delineated and initialized by the
1702
 
  user. Many OpenGL funtions return data to a C-style pointer, however, because this
 
1719
  user. Many OpenGL functions return data to a C-style pointer, however, because this
1703
1720
  is not possible in python the Buffer object can be used to this end. Wherever pointer
1704
1721
  notation is used in the OpenGL functions the Buffer object can be used in it's BGL 
1705
1722
  wrapper. In some instances the Buffer object will need to be initialized with the template 
1735
1752
    be created for the buffer. If a sequence is passed for the dimensions, the buffer 
1736
1753
    becomes n-Dimensional, where n is equal to the number of parameters passed in the 
1737
1754
    sequence. Example: [256,2] is a two- dimensional buffer while [256,256,4] creates 
1738
 
    a three- dimensional buffer. You can think of each additional dimension as a subitem 
1739
 
    of the dimension to the left. i.e. [10,2] is a 10 element array each with 2 subitems.  
 
1755
    a three- dimensional buffer. You can think of each additional dimension as a sub-item 
 
1756
    of the dimension to the left. i.e. [10,2] is a 10 element array each with 2 sub-items.  
1740
1757
    [(0,0), (0,1), (1,0), (1,1), (2,0), ...] etc.
1741
1758
    @type template: A python sequence object (optional)
1742
1759
    @param template: A sequence of matching dimensions which will be used to initialize