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 / primitive_restart.py < prev    next >
Encoding:
Python Source  |  2008-12-07  |  2.6 KB  |  65 lines

  1. '''OpenGL extension NV.primitive_restart
  2.  
  3. Overview (from the spec)
  4.     
  5.     This extension allows applications to easily and inexpensively
  6.     restart a primitive in its middle.  A "primitive restart" is simply
  7.     the same as an End command, followed by another Begin command with
  8.     the same mode as the original.  The typical expected use of this
  9.     feature is to draw a mesh with many triangle strips, though primitive
  10.     restarts are legal for all primitive types, even for points (where
  11.     they are not useful).
  12.     
  13.     Although the EXT_multi_draw_arrays extension did reduce the overhead
  14.     of such drawing techniques, they still remain more expensive than one
  15.     would like.
  16.     
  17.     This extension provides an extremely lightweight primitive restart,
  18.     which is accomplished by allowing the application to choose a special
  19.     index number that signals that a primitive restart should occur,
  20.     rather than a vertex being provoked.  This index can be an arbitrary
  21.     32-bit integer for maximum application convenience.
  22.     
  23.     In addition, for full orthogonality, a special OpenGL command is
  24.     provided to restart primitives when in immediate mode.  This command
  25.     is not likely to increase performance in any significant fashion, but
  26.     providing it greatly simplifies the specification and implementation
  27.     of display list compilation and indirect rendering.
  28.  
  29. The official definition of this extension is available here:
  30.     http://oss.sgi.com/projects/ogl-sample/registry/NV/primitive_restart.txt
  31.  
  32. Automatically generated by the get_gl_extensions script, do not edit!
  33. '''
  34. from OpenGL import platform, constants, constant, arrays
  35. from OpenGL import extensions
  36. from OpenGL.GL import glget
  37. import ctypes
  38. EXTENSION_NAME = 'GL_NV_primitive_restart'
  39. GL_PRIMITIVE_RESTART_NV = constant.Constant( 'GL_PRIMITIVE_RESTART_NV', 0x8558 )
  40. glget.addGLGetConstant( GL_PRIMITIVE_RESTART_NV, (1,) )
  41. GL_PRIMITIVE_RESTART_INDEX_NV = constant.Constant( 'GL_PRIMITIVE_RESTART_INDEX_NV', 0x8559 )
  42. glget.addGLGetConstant( GL_PRIMITIVE_RESTART_INDEX_NV, (1,) )
  43. glPrimitiveRestartNV = platform.createExtensionFunction( 
  44.     'glPrimitiveRestartNV', dll=platform.GL,
  45.     extension=EXTENSION_NAME,
  46.     resultType=None, 
  47.     argTypes=(),
  48.     doc = 'glPrimitiveRestartNV(  ) -> None',
  49.     argNames = (),
  50. )
  51.  
  52. glPrimitiveRestartIndexNV = platform.createExtensionFunction( 
  53.     'glPrimitiveRestartIndexNV', dll=platform.GL,
  54.     extension=EXTENSION_NAME,
  55.     resultType=None, 
  56.     argTypes=(constants.GLuint,),
  57.     doc = 'glPrimitiveRestartIndexNV( GLuint(index) ) -> None',
  58.     argNames = ('index',),
  59. )
  60.  
  61.  
  62. def glInitPrimitiveRestartNV():
  63.     '''Return boolean indicating whether this extension is available'''
  64.     return extensions.hasGLExtension( EXTENSION_NAME )
  65.