home *** CD-ROM | disk | FTP | other *** search
/ Hackers Magazine 57 / CdHackersMagazineNr57.iso / Software / Multimedia / k3d-setup-0.7.11.0.exe / lib / site-packages / OpenGL / raw / GL / NV / point_sprite.py < prev    next >
Encoding:
Python Source  |  2008-12-07  |  2.7 KB  |  65 lines

  1. '''OpenGL extension NV.point_sprite
  2.  
  3. Overview (from the spec)
  4.     
  5.     Applications such as particle systems usually must use OpenGL quads
  6.     rather than points to render their geometry, since they would like to
  7.     use a custom-drawn texture for each particle, rather than the
  8.     traditional OpenGL round antialiased points, and each fragment in
  9.     a point has the same texture coordinates as every other fragment.
  10.     
  11.     Unfortunately, specifying the geometry for these quads can be quite
  12.     expensive, since it quadruples the amount of geometry required, and
  13.     it may also require the application to do extra processing to compute
  14.     the location of each vertex.
  15.     
  16.     The goal of this extension is to allow such apps to use points rather
  17.     than quads.  When GL_POINT_SPRITE_NV is enabled, the state of point
  18.     antialiasing is ignored.  For each texture unit, the app can then
  19.     specify whether to replace the existing texture coordinates with
  20.     point sprite texture coordinates, which are interpolated across the
  21.     point.  Finally, the app can set a global parameter for the way to
  22.     generate the R coordinate for point sprites; the R coordinate can
  23.     either be zero, the input S coordinate, or the input R coordinate.
  24.     This allows applications to use a 3D texture to represent a point
  25.     sprite that goes through an animation, with filtering between frames,
  26.     for example.
  27.  
  28. The official definition of this extension is available here:
  29.     http://oss.sgi.com/projects/ogl-sample/registry/NV/point_sprite.txt
  30.  
  31. Automatically generated by the get_gl_extensions script, do not edit!
  32. '''
  33. from OpenGL import platform, constants, constant, arrays
  34. from OpenGL import extensions
  35. from OpenGL.GL import glget
  36. import ctypes
  37. EXTENSION_NAME = 'GL_NV_point_sprite'
  38. GL_POINT_SPRITE_NV = constant.Constant( 'GL_POINT_SPRITE_NV', 0x8861 )
  39. glget.addGLGetConstant( GL_POINT_SPRITE_NV, (1,) )
  40. GL_COORD_REPLACE_NV = constant.Constant( 'GL_COORD_REPLACE_NV', 0x8862 )
  41. GL_POINT_SPRITE_R_MODE_NV = constant.Constant( 'GL_POINT_SPRITE_R_MODE_NV', 0x8863 )
  42. glget.addGLGetConstant( GL_POINT_SPRITE_R_MODE_NV, (1,) )
  43. glPointParameteriNV = platform.createExtensionFunction( 
  44.     'glPointParameteriNV', dll=platform.GL,
  45.     extension=EXTENSION_NAME,
  46.     resultType=None, 
  47.     argTypes=(constants.GLenum, constants.GLint,),
  48.     doc = 'glPointParameteriNV( GLenum(pname), GLint(param) ) -> None',
  49.     argNames = ('pname', 'param',),
  50. )
  51.  
  52. glPointParameterivNV = platform.createExtensionFunction( 
  53.     'glPointParameterivNV', dll=platform.GL,
  54.     extension=EXTENSION_NAME,
  55.     resultType=None, 
  56.     argTypes=(constants.GLenum, arrays.GLintArray,),
  57.     doc = 'glPointParameterivNV( GLenum(pname), GLintArray(params) ) -> None',
  58.     argNames = ('pname', 'params',),
  59. )
  60.  
  61.  
  62. def glInitPointSpriteNV():
  63.     '''Return boolean indicating whether this extension is available'''
  64.     return extensions.hasGLExtension( EXTENSION_NAME )
  65.