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 / fence.py < prev    next >
Encoding:
Python Source  |  2008-12-07  |  4.3 KB  |  113 lines

  1. '''OpenGL extension NV.fence
  2.  
  3. Overview (from the spec)
  4.     
  5.     The goal of this extension is provide a finer granularity of
  6.     synchronizing GL command completion than offered by standard OpenGL,
  7.     which offers only two mechanisms for synchronization: Flush and Finish.
  8.     Since Flush merely assures the user that the commands complete in a
  9.     finite (though undetermined) amount of time, it is, thus, of only
  10.     modest utility.  Finish, on the other hand, stalls CPU execution
  11.     until all pending GL commands have completed.  This extension offers
  12.     a middle ground - the ability to "finish" a subset of the command
  13.     stream, and the ability to determine whether a given command has
  14.     completed or not.
  15.     
  16.     This extension introduces the concept of a "fence" to the OpenGL
  17.     command stream.  Once the fence is inserted into the command stream, it
  18.     can be queried for a given condition - typically, its completion.
  19.     Moreover, the application may also request a partial Finish -- that is,
  20.     all commands prior to the fence will be forced to complete until control
  21.     is returned to the calling process.  These new mechanisms allow for
  22.     synchronization between the host CPU and the GPU, which may be accessing
  23.     the same resources (typically memory).
  24.     
  25.     This extension is useful in conjunction with NV_vertex_array_range
  26.     to determine when vertex information has been pulled from the
  27.     vertex array range.  Once a fence has been tested TRUE or finished,
  28.     all vertex indices issued before the fence must have been pulled.
  29.     This ensures that the vertex data memory corresponding to the issued
  30.     vertex indices can be safely modified (assuming no other outstanding
  31.     vertex indices are issued subsequent to the fence).
  32.  
  33. The official definition of this extension is available here:
  34.     http://oss.sgi.com/projects/ogl-sample/registry/NV/fence.txt
  35.  
  36. Automatically generated by the get_gl_extensions script, do not edit!
  37. '''
  38. from OpenGL import platform, constants, constant, arrays
  39. from OpenGL import extensions
  40. from OpenGL.GL import glget
  41. import ctypes
  42. EXTENSION_NAME = 'GL_NV_fence'
  43. GL_ALL_COMPLETED_NV = constant.Constant( 'GL_ALL_COMPLETED_NV', 0x84F2 )
  44. GL_FENCE_STATUS_NV = constant.Constant( 'GL_FENCE_STATUS_NV', 0x84F3 )
  45. GL_FENCE_CONDITION_NV = constant.Constant( 'GL_FENCE_CONDITION_NV', 0x84F4 )
  46. glDeleteFencesNV = platform.createExtensionFunction( 
  47.     'glDeleteFencesNV', dll=platform.GL,
  48.     extension=EXTENSION_NAME,
  49.     resultType=None, 
  50.     argTypes=(constants.GLsizei, arrays.GLuintArray,),
  51.     doc = 'glDeleteFencesNV( GLsizei(n), GLuintArray(fences) ) -> None',
  52.     argNames = ('n', 'fences',),
  53. )
  54.  
  55. glGenFencesNV = platform.createExtensionFunction( 
  56.     'glGenFencesNV', dll=platform.GL,
  57.     extension=EXTENSION_NAME,
  58.     resultType=None, 
  59.     argTypes=(constants.GLsizei, arrays.GLuintArray,),
  60.     doc = 'glGenFencesNV( GLsizei(n), GLuintArray(fences) ) -> None',
  61.     argNames = ('n', 'fences',),
  62. )
  63.  
  64. glIsFenceNV = platform.createExtensionFunction( 
  65.     'glIsFenceNV', dll=platform.GL,
  66.     extension=EXTENSION_NAME,
  67.     resultType=constants.GLboolean, 
  68.     argTypes=(constants.GLuint,),
  69.     doc = 'glIsFenceNV( GLuint(fence) ) -> constants.GLboolean',
  70.     argNames = ('fence',),
  71. )
  72.  
  73. glTestFenceNV = platform.createExtensionFunction( 
  74.     'glTestFenceNV', dll=platform.GL,
  75.     extension=EXTENSION_NAME,
  76.     resultType=constants.GLboolean, 
  77.     argTypes=(constants.GLuint,),
  78.     doc = 'glTestFenceNV( GLuint(fence) ) -> constants.GLboolean',
  79.     argNames = ('fence',),
  80. )
  81.  
  82. glGetFenceivNV = platform.createExtensionFunction( 
  83.     'glGetFenceivNV', dll=platform.GL,
  84.     extension=EXTENSION_NAME,
  85.     resultType=None, 
  86.     argTypes=(constants.GLuint, constants.GLenum, arrays.GLintArray,),
  87.     doc = 'glGetFenceivNV( GLuint(fence), GLenum(pname), GLintArray(params) ) -> None',
  88.     argNames = ('fence', 'pname', 'params',),
  89. )
  90.  
  91. glFinishFenceNV = platform.createExtensionFunction( 
  92.     'glFinishFenceNV', dll=platform.GL,
  93.     extension=EXTENSION_NAME,
  94.     resultType=None, 
  95.     argTypes=(constants.GLuint,),
  96.     doc = 'glFinishFenceNV( GLuint(fence) ) -> None',
  97.     argNames = ('fence',),
  98. )
  99.  
  100. glSetFenceNV = platform.createExtensionFunction( 
  101.     'glSetFenceNV', dll=platform.GL,
  102.     extension=EXTENSION_NAME,
  103.     resultType=None, 
  104.     argTypes=(constants.GLuint, constants.GLenum,),
  105.     doc = 'glSetFenceNV( GLuint(fence), GLenum(condition) ) -> None',
  106.     argNames = ('fence', 'condition',),
  107. )
  108.  
  109.  
  110. def glInitFenceNV():
  111.     '''Return boolean indicating whether this extension is available'''
  112.     return extensions.hasGLExtension( EXTENSION_NAME )
  113.