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