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 / ARB / multisample.py < prev    next >
Encoding:
Python Source  |  2008-12-07  |  3.5 KB  |  71 lines

  1. '''OpenGL extension ARB.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
  8.     sample values are resolved to a single, displayable color each time
  9.     a pixel is updated, so the antialiasing appears to be automatic at
  10.     the application level.  Because each sample includes depth and
  11.     stencil information, the depth and stencil functions perform
  12.     equivalently 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
  28.     designed to allow multisample and smooth antialiasing techniques
  29.     to be 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/ARB/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_ARB_multisample'
  41. GL_MULTISAMPLE_ARB = constant.Constant( 'GL_MULTISAMPLE_ARB', 0x809D )
  42. glget.addGLGetConstant( GL_MULTISAMPLE_ARB, (1,) )
  43. GL_SAMPLE_ALPHA_TO_COVERAGE_ARB = constant.Constant( 'GL_SAMPLE_ALPHA_TO_COVERAGE_ARB', 0x809E )
  44. glget.addGLGetConstant( GL_SAMPLE_ALPHA_TO_COVERAGE_ARB, (1,) )
  45. GL_SAMPLE_ALPHA_TO_ONE_ARB = constant.Constant( 'GL_SAMPLE_ALPHA_TO_ONE_ARB', 0x809F )
  46. glget.addGLGetConstant( GL_SAMPLE_ALPHA_TO_ONE_ARB, (1,) )
  47. GL_SAMPLE_COVERAGE_ARB = constant.Constant( 'GL_SAMPLE_COVERAGE_ARB', 0x80A0 )
  48. glget.addGLGetConstant( GL_SAMPLE_COVERAGE_ARB, (1,) )
  49. GL_SAMPLE_BUFFERS_ARB = constant.Constant( 'GL_SAMPLE_BUFFERS_ARB', 0x80A8 )
  50. glget.addGLGetConstant( GL_SAMPLE_BUFFERS_ARB, (1,) )
  51. GL_SAMPLES_ARB = constant.Constant( 'GL_SAMPLES_ARB', 0x80A9 )
  52. glget.addGLGetConstant( GL_SAMPLES_ARB, (1,) )
  53. GL_SAMPLE_COVERAGE_VALUE_ARB = constant.Constant( 'GL_SAMPLE_COVERAGE_VALUE_ARB', 0x80AA )
  54. glget.addGLGetConstant( GL_SAMPLE_COVERAGE_VALUE_ARB, (1,) )
  55. GL_SAMPLE_COVERAGE_INVERT_ARB = constant.Constant( 'GL_SAMPLE_COVERAGE_INVERT_ARB', 0x80AB )
  56. glget.addGLGetConstant( GL_SAMPLE_COVERAGE_INVERT_ARB, (1,) )
  57. GL_MULTISAMPLE_BIT_ARB = constant.Constant( 'GL_MULTISAMPLE_BIT_ARB', 0x20000000 )
  58. glSampleCoverageARB = platform.createExtensionFunction( 
  59.     'glSampleCoverageARB', dll=platform.GL,
  60.     extension=EXTENSION_NAME,
  61.     resultType=None, 
  62.     argTypes=(constants.GLclampf, constants.GLboolean,),
  63.     doc = 'glSampleCoverageARB( GLclampf(value), GLboolean(invert) ) -> None',
  64.     argNames = ('value', 'invert',),
  65. )
  66.  
  67.  
  68. def glInitMultisampleARB():
  69.     '''Return boolean indicating whether this extension is available'''
  70.     return extensions.hasGLExtension( EXTENSION_NAME )
  71.