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 / SGIX / instruments.py < prev    next >
Encoding:
Python Source  |  2008-12-07  |  3.9 KB  |  109 lines

  1. '''OpenGL extension SGIX.instruments
  2.  
  3. Overview (from the spec)
  4.     
  5.     This extension allows the gathering and return of performance
  6.     measurements from within the graphics pipeline by adding
  7.     instrumentation.
  8.     
  9.     There are two reasons to do this.  The first is as a part of some
  10.     type of fixed-frame-rate load management scheme.  If we know that
  11.     the pipeline is stalled or struggling to process the amount of
  12.     data we have given it so far, we can reduce the level of detail of
  13.     the remaining objects in the current frame or the next frame, or
  14.     adjust the framebuffer resolution for the next frame if we have a
  15.     video-zoom capability available.  We can call this type of
  16.     instrumentation Load Monitoring.
  17.     
  18.     The second is for performance tuning and debugging of an
  19.     application. It might tell us how many triangles were culled or
  20.     clipped before being rasterized.  We can call this simply Tuning.
  21.     
  22.     Load Monitoring requires that the instrumentation and the access
  23.     of the measurements be efficient, otherwise the instrumentation
  24.     itself will reduce performance more than any load-management
  25.     scheme could hope to offset.  Tuning does not have the same
  26.     requirements.
  27.     
  28.     The proposed extension adds a call to setup a measurements return
  29.     buffer, similar to FeedbackBuffer but with an asynchrounous
  30.     behavior to prevent filling the pipeline with NOP's while waiting
  31.     for the data to be returned.
  32.     
  33.     Note that although the extension has been specified without any
  34.     particular instruments, defining either a device dependent or
  35.     device independent instrument should be as simple as introducing
  36.     an extension consisting primarily of a new enumerant to identify
  37.     the instrument.
  38.  
  39. The official definition of this extension is available here:
  40.     http://oss.sgi.com/projects/ogl-sample/registry/SGIX/instruments.txt
  41.  
  42. Automatically generated by the get_gl_extensions script, do not edit!
  43. '''
  44. from OpenGL import platform, constants, constant, arrays
  45. from OpenGL import extensions
  46. from OpenGL.GL import glget
  47. import ctypes
  48. EXTENSION_NAME = 'GL_SGIX_instruments'
  49. GL_INSTRUMENT_BUFFER_POINTER_SGIX = constant.Constant( 'GL_INSTRUMENT_BUFFER_POINTER_SGIX', 0x8180 )
  50. GL_INSTRUMENT_MEASUREMENTS_SGIX = constant.Constant( 'GL_INSTRUMENT_MEASUREMENTS_SGIX', 0x8181 )
  51. glGetInstrumentsSGIX = platform.createExtensionFunction( 
  52.     'glGetInstrumentsSGIX', dll=platform.GL,
  53.     extension=EXTENSION_NAME,
  54.     resultType=constants.GLint, 
  55.     argTypes=(),
  56.     doc = 'glGetInstrumentsSGIX(  ) -> constants.GLint',
  57.     argNames = (),
  58. )
  59.  
  60. glInstrumentsBufferSGIX = platform.createExtensionFunction( 
  61.     'glInstrumentsBufferSGIX', dll=platform.GL,
  62.     extension=EXTENSION_NAME,
  63.     resultType=None, 
  64.     argTypes=(constants.GLsizei, arrays.GLintArray,),
  65.     doc = 'glInstrumentsBufferSGIX( GLsizei(size), GLintArray(buffer) ) -> None',
  66.     argNames = ('size', 'buffer',),
  67. )
  68.  
  69. glPollInstrumentsSGIX = platform.createExtensionFunction( 
  70.     'glPollInstrumentsSGIX', dll=platform.GL,
  71.     extension=EXTENSION_NAME,
  72.     resultType=constants.GLint, 
  73.     argTypes=(arrays.GLintArray,),
  74.     doc = 'glPollInstrumentsSGIX( GLintArray(marker_p) ) -> constants.GLint',
  75.     argNames = ('marker_p',),
  76. )
  77.  
  78. glReadInstrumentsSGIX = platform.createExtensionFunction( 
  79.     'glReadInstrumentsSGIX', dll=platform.GL,
  80.     extension=EXTENSION_NAME,
  81.     resultType=None, 
  82.     argTypes=(constants.GLint,),
  83.     doc = 'glReadInstrumentsSGIX( GLint(marker) ) -> None',
  84.     argNames = ('marker',),
  85. )
  86.  
  87. glStartInstrumentsSGIX = platform.createExtensionFunction( 
  88.     'glStartInstrumentsSGIX', dll=platform.GL,
  89.     extension=EXTENSION_NAME,
  90.     resultType=None, 
  91.     argTypes=(),
  92.     doc = 'glStartInstrumentsSGIX(  ) -> None',
  93.     argNames = (),
  94. )
  95.  
  96. glStopInstrumentsSGIX = platform.createExtensionFunction( 
  97.     'glStopInstrumentsSGIX', dll=platform.GL,
  98.     extension=EXTENSION_NAME,
  99.     resultType=None, 
  100.     argTypes=(constants.GLint,),
  101.     doc = 'glStopInstrumentsSGIX( GLint(marker) ) -> None',
  102.     argNames = ('marker',),
  103. )
  104.  
  105.  
  106. def glInitInstrumentsSGIX():
  107.     '''Return boolean indicating whether this extension is available'''
  108.     return extensions.hasGLExtension( EXTENSION_NAME )
  109.