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 / EXT / polygon_offset.py < prev    next >
Encoding:
Python Source  |  2008-12-07  |  2.0 KB  |  46 lines

  1. '''OpenGL extension EXT.polygon_offset
  2.  
  3. Overview (from the spec)
  4.     
  5.     The depth values of fragments generated by rendering polygons are
  6.     displaced by an amount that is proportional to the maximum absolute
  7.     value of the depth slope of the polygon, measured and applied in window
  8.     coordinates.  This displacement allows lines (or points) and polygons
  9.     in the same plane to be rendered without interaction -- the lines
  10.     rendered either completely in front of or behind the polygons
  11.     (depending on the sign of the offset factor).  It also allows multiple
  12.     coplanar polygons to be rendered without interaction, if different
  13.     offset factors are used for each polygon.  Applications include
  14.     rendering hidden-line images, rendering solids with highlighted edges,
  15.     and applying `decals' to surfaces.
  16.  
  17. The official definition of this extension is available here:
  18.     http://oss.sgi.com/projects/ogl-sample/registry/EXT/polygon_offset.txt
  19.  
  20. Automatically generated by the get_gl_extensions script, do not edit!
  21. '''
  22. from OpenGL import platform, constants, constant, arrays
  23. from OpenGL import extensions
  24. from OpenGL.GL import glget
  25. import ctypes
  26. EXTENSION_NAME = 'GL_EXT_polygon_offset'
  27. GL_POLYGON_OFFSET_EXT = constant.Constant( 'GL_POLYGON_OFFSET_EXT', 0x8037 )
  28. glget.addGLGetConstant( GL_POLYGON_OFFSET_EXT, (1,) )
  29. GL_POLYGON_OFFSET_FACTOR_EXT = constant.Constant( 'GL_POLYGON_OFFSET_FACTOR_EXT', 0x8038 )
  30. glget.addGLGetConstant( GL_POLYGON_OFFSET_FACTOR_EXT, (1,) )
  31. GL_POLYGON_OFFSET_BIAS_EXT = constant.Constant( 'GL_POLYGON_OFFSET_BIAS_EXT', 0x8039 )
  32. glget.addGLGetConstant( GL_POLYGON_OFFSET_BIAS_EXT, (1,) )
  33. glPolygonOffsetEXT = platform.createExtensionFunction( 
  34.     'glPolygonOffsetEXT', dll=platform.GL,
  35.     extension=EXTENSION_NAME,
  36.     resultType=None, 
  37.     argTypes=(constants.GLfloat, constants.GLfloat,),
  38.     doc = 'glPolygonOffsetEXT( GLfloat(factor), GLfloat(bias) ) -> None',
  39.     argNames = ('factor', 'bias',),
  40. )
  41.  
  42.  
  43. def glInitPolygonOffsetEXT():
  44.     '''Return boolean indicating whether this extension is available'''
  45.     return extensions.hasGLExtension( EXTENSION_NAME )
  46.