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 / SGIS / multisample.py < prev    next >
Encoding:
Python Source  |  2008-12-07  |  4.2 KB  |  88 lines

  1. '''OpenGL extension SGIS.multisample
  2.  
  3. Overview (from the spec)
  4.     
  5.     This extension provides a mechanism to antialias all GL primitives:
  6.     points, lines, polygons, bitmaps, and images.  The technique is to
  7.     sample all primitives multiple times at each pixel.  The color sample
  8.     values are resolved to a single, displayable color each time a pixel
  9.     is updated, so the antialiasing appears to be automatic at the
  10.     application level.  Because each sample includes depth and stencil
  11.     information, the depth and stencil functions perform equivalently
  12.     to the single-sample mode.
  13.     
  14.     An additional buffer, called the multisample buffer, is added to
  15.     the framebuffer.  Pixel sample values, including color, depth, and
  16.     stencil values, are stored in this buffer.  When the framebuffer
  17.     includes a multisample buffer, it does not also include separate
  18.     depth or stencil buffers, even if the multisample buffer does not
  19.     store depth or stencil values.  Color buffers (left/right, front/
  20.     back, and aux) do coexist with the multisample buffer, however.
  21.     
  22.     Multisample antialiasing is most valuable for rendering polygons,
  23.     because it requires no sorting for hidden surface elimination, and
  24.     it correctly handles adjacent polygons, object silhouettes, and
  25.     even intersecting polygons.  If only points or lines are being
  26.     rendered, the "smooth" antialiasing mechanism provided by the base
  27.     GL may result in a higher quality image.  This extension is designed
  28.     to allow multisample and smooth antialiasing techniques to be
  29.     alternated during the rendering of a single scene.
  30.  
  31. The official definition of this extension is available here:
  32.     http://oss.sgi.com/projects/ogl-sample/registry/SGIS/multisample.txt
  33.  
  34. Automatically generated by the get_gl_extensions script, do not edit!
  35. '''
  36. from OpenGL import platform, constants, constant, arrays
  37. from OpenGL import extensions
  38. from OpenGL.GL import glget
  39. import ctypes
  40. EXTENSION_NAME = 'GL_SGIS_multisample'
  41. GL_MULTISAMPLE_SGIS = constant.Constant( 'GL_MULTISAMPLE_SGIS', 0x809D )
  42. glget.addGLGetConstant( GL_MULTISAMPLE_SGIS, (1,) )
  43. GL_SAMPLE_ALPHA_TO_MASK_SGIS = constant.Constant( 'GL_SAMPLE_ALPHA_TO_MASK_SGIS', 0x809E )
  44. glget.addGLGetConstant( GL_SAMPLE_ALPHA_TO_MASK_SGIS, (1,) )
  45. GL_SAMPLE_ALPHA_TO_ONE_SGIS = constant.Constant( 'GL_SAMPLE_ALPHA_TO_ONE_SGIS', 0x809F )
  46. glget.addGLGetConstant( GL_SAMPLE_ALPHA_TO_ONE_SGIS, (1,) )
  47. GL_SAMPLE_MASK_SGIS = constant.Constant( 'GL_SAMPLE_MASK_SGIS', 0x80A0 )
  48. glget.addGLGetConstant( GL_SAMPLE_MASK_SGIS, (1,) )
  49. GL_1PASS_SGIS = constant.Constant( 'GL_1PASS_SGIS', 0x80A1 )
  50. GL_2PASS_0_SGIS = constant.Constant( 'GL_2PASS_0_SGIS', 0x80A2 )
  51. GL_2PASS_1_SGIS = constant.Constant( 'GL_2PASS_1_SGIS', 0x80A3 )
  52. GL_4PASS_0_SGIS = constant.Constant( 'GL_4PASS_0_SGIS', 0x80A4 )
  53. GL_4PASS_1_SGIS = constant.Constant( 'GL_4PASS_1_SGIS', 0x80A5 )
  54. GL_4PASS_2_SGIS = constant.Constant( 'GL_4PASS_2_SGIS', 0x80A6 )
  55. GL_4PASS_3_SGIS = constant.Constant( 'GL_4PASS_3_SGIS', 0x80A7 )
  56. GL_SAMPLE_BUFFERS_SGIS = constant.Constant( 'GL_SAMPLE_BUFFERS_SGIS', 0x80A8 )
  57. glget.addGLGetConstant( GL_SAMPLE_BUFFERS_SGIS, (1,) )
  58. GL_SAMPLES_SGIS = constant.Constant( 'GL_SAMPLES_SGIS', 0x80A9 )
  59. glget.addGLGetConstant( GL_SAMPLES_SGIS, (1,) )
  60. GL_SAMPLE_MASK_VALUE_SGIS = constant.Constant( 'GL_SAMPLE_MASK_VALUE_SGIS', 0x80AA )
  61. glget.addGLGetConstant( GL_SAMPLE_MASK_VALUE_SGIS, (1,) )
  62. GL_SAMPLE_MASK_INVERT_SGIS = constant.Constant( 'GL_SAMPLE_MASK_INVERT_SGIS', 0x80AB )
  63. glget.addGLGetConstant( GL_SAMPLE_MASK_INVERT_SGIS, (1,) )
  64. GL_SAMPLE_PATTERN_SGIS = constant.Constant( 'GL_SAMPLE_PATTERN_SGIS', 0x80AC )
  65. glget.addGLGetConstant( GL_SAMPLE_PATTERN_SGIS, (1,) )
  66. glSampleMaskSGIS = platform.createExtensionFunction( 
  67.     'glSampleMaskSGIS', dll=platform.GL,
  68.     extension=EXTENSION_NAME,
  69.     resultType=None, 
  70.     argTypes=(constants.GLclampf, constants.GLboolean,),
  71.     doc = 'glSampleMaskSGIS( GLclampf(value), GLboolean(invert) ) -> None',
  72.     argNames = ('value', 'invert',),
  73. )
  74.  
  75. glSamplePatternSGIS = platform.createExtensionFunction( 
  76.     'glSamplePatternSGIS', dll=platform.GL,
  77.     extension=EXTENSION_NAME,
  78.     resultType=None, 
  79.     argTypes=(constants.GLenum,),
  80.     doc = 'glSamplePatternSGIS( GLenum(pattern) ) -> None',
  81.     argNames = ('pattern',),
  82. )
  83.  
  84.  
  85. def glInitMultisampleSGIS():
  86.     '''Return boolean indicating whether this extension is available'''
  87.     return extensions.hasGLExtension( EXTENSION_NAME )
  88.