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 / SUN / global_alpha.py < prev    next >
Encoding:
Python Source  |  2008-12-07  |  4.1 KB  |  118 lines

  1. '''OpenGL extension SUN.global_alpha
  2.  
  3. Overview (from the spec)
  4.     
  5.     Transparency is done in OpenGL using alpha blending. An alpha value
  6.     of 0.0 is used for fully transparent objects, while an alpha value
  7.     of 1.0 is used for fully opaque objects.  A value of 0.25 is 75%
  8.     transparent, and so on.
  9.     
  10.     OpenGL defines alpha as a component of the vertex color state.
  11.     Whenever a color is set, the alpha component is set along with the
  12.     red, green, and blue components.  This means that transparency
  13.     can't be changed for primitives with per-vertex colors without
  14.     modifying the color of each vertex, replacing the old alpha
  15.     component with the new alpha component.  This can be very expensive
  16.     for objects that are drawn using vertex arrays; it all but
  17.     precludes the use of display lists.
  18.     
  19.     This extension defines a new global alpha attribute that can be
  20.     used to specify an alpha factor that is independent from the alpha
  21.     component of the color value.  The global alpha factor is
  22.     multiplied by the fragment's alpha value after primitive
  23.     rasterization and prior to texture mapping, replacing the
  24.     fragment's alpha value.  The global alpha extension is only
  25.     specified in RGBA mode and must be applied prior to any texture
  26.     mapping operation.  It is enabled by a new GLOBAL_ALPHA flag.
  27.     
  28.  
  29. The official definition of this extension is available here:
  30.     http://oss.sgi.com/projects/ogl-sample/registry/SUN/global_alpha.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_SUN_global_alpha'
  39. GL_GLOBAL_ALPHA_SUN = constant.Constant( 'GL_GLOBAL_ALPHA_SUN', 0x81D9 )
  40. GL_GLOBAL_ALPHA_FACTOR_SUN = constant.Constant( 'GL_GLOBAL_ALPHA_FACTOR_SUN', 0x81DA )
  41. glget.addGLGetConstant( GL_GLOBAL_ALPHA_FACTOR_SUN, (1,) )
  42. glGlobalAlphaFactorbSUN = platform.createExtensionFunction( 
  43.     'glGlobalAlphaFactorbSUN', dll=platform.GL,
  44.     extension=EXTENSION_NAME,
  45.     resultType=None, 
  46.     argTypes=(constants.GLbyte,),
  47.     doc = 'glGlobalAlphaFactorbSUN( GLbyte(factor) ) -> None',
  48.     argNames = ('factor',),
  49. )
  50.  
  51. glGlobalAlphaFactorsSUN = platform.createExtensionFunction( 
  52.     'glGlobalAlphaFactorsSUN', dll=platform.GL,
  53.     extension=EXTENSION_NAME,
  54.     resultType=None, 
  55.     argTypes=(constants.GLshort,),
  56.     doc = 'glGlobalAlphaFactorsSUN( GLshort(factor) ) -> None',
  57.     argNames = ('factor',),
  58. )
  59.  
  60. glGlobalAlphaFactoriSUN = platform.createExtensionFunction( 
  61.     'glGlobalAlphaFactoriSUN', dll=platform.GL,
  62.     extension=EXTENSION_NAME,
  63.     resultType=None, 
  64.     argTypes=(constants.GLint,),
  65.     doc = 'glGlobalAlphaFactoriSUN( GLint(factor) ) -> None',
  66.     argNames = ('factor',),
  67. )
  68.  
  69. glGlobalAlphaFactorfSUN = platform.createExtensionFunction( 
  70.     'glGlobalAlphaFactorfSUN', dll=platform.GL,
  71.     extension=EXTENSION_NAME,
  72.     resultType=None, 
  73.     argTypes=(constants.GLfloat,),
  74.     doc = 'glGlobalAlphaFactorfSUN( GLfloat(factor) ) -> None',
  75.     argNames = ('factor',),
  76. )
  77.  
  78. glGlobalAlphaFactordSUN = platform.createExtensionFunction( 
  79.     'glGlobalAlphaFactordSUN', dll=platform.GL,
  80.     extension=EXTENSION_NAME,
  81.     resultType=None, 
  82.     argTypes=(constants.GLdouble,),
  83.     doc = 'glGlobalAlphaFactordSUN( GLdouble(factor) ) -> None',
  84.     argNames = ('factor',),
  85. )
  86.  
  87. glGlobalAlphaFactorubSUN = platform.createExtensionFunction( 
  88.     'glGlobalAlphaFactorubSUN', dll=platform.GL,
  89.     extension=EXTENSION_NAME,
  90.     resultType=None, 
  91.     argTypes=(constants.GLubyte,),
  92.     doc = 'glGlobalAlphaFactorubSUN( GLubyte(factor) ) -> None',
  93.     argNames = ('factor',),
  94. )
  95.  
  96. glGlobalAlphaFactorusSUN = platform.createExtensionFunction( 
  97.     'glGlobalAlphaFactorusSUN', dll=platform.GL,
  98.     extension=EXTENSION_NAME,
  99.     resultType=None, 
  100.     argTypes=(constants.GLushort,),
  101.     doc = 'glGlobalAlphaFactorusSUN( GLushort(factor) ) -> None',
  102.     argNames = ('factor',),
  103. )
  104.  
  105. glGlobalAlphaFactoruiSUN = platform.createExtensionFunction( 
  106.     'glGlobalAlphaFactoruiSUN', dll=platform.GL,
  107.     extension=EXTENSION_NAME,
  108.     resultType=None, 
  109.     argTypes=(constants.GLuint,),
  110.     doc = 'glGlobalAlphaFactoruiSUN( GLuint(factor) ) -> None',
  111.     argNames = ('factor',),
  112. )
  113.  
  114.  
  115. def glInitGlobalAlphaSUN():
  116.     '''Return boolean indicating whether this extension is available'''
  117.     return extensions.hasGLExtension( EXTENSION_NAME )
  118.