File: fbconfig.py

package info (click to toggle)
pyopengl 3.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 11,184 kB
  • ctags: 21,473
  • sloc: python: 80,468; makefile: 4
file content (69 lines) | stat: -rw-r--r-- 3,171 bytes parent folder | download | duplicates (12)
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
'''OpenGL extension SGIX.fbconfig

This module customises the behaviour of the 
OpenGL.raw.GLX.SGIX.fbconfig to provide a more 
Python-friendly API

Overview (from the spec)
	
	This extension introduces a new way to describe the capabilities of a 
	GLX drawable (i.e., to describe the depth of color buffer components 
	and the type and size of ancillary buffers), removes the "similarity"
	requirement when making a context current to a drawable, and supports 
	RGBA rendering to one- and two-component Windows and GLX Pixmaps.
	
	Currently GLX overloads X Visuals with information on GLX drawable
	capabilities. This extension defines a new construct, a GLXFBConfigSGIX,
	that encapsulates GLX drawable capabilities and has the following 
	properties:
	
	   - It may or may not have an associated X visual. If it does have 
	   an associated X visual then it is possible to create Windows that  
	   have the capabilities described by the GLXFBConfig.
	
	   - A particular GLXFBConfig does not need to work with all GLX 
	   drawables. For example, it is possible for implementations to export 
	   GLXFBConfigs that only work with GLX pixmaps.
	
	This extension also removes the "similarity" restriction when making
	a context and drawable current. Instead a less restrictive requirement 
	of "compatibility" (see definition below) is imposed. Note that when 
	a context is created it has an associated rendering type which
	is either RGBA or color index. In the future we may want to remove all
	"similarity" and "compatibility" restrictions and allow a context to be
	bound to any drawable that supports its rendering type.
	
	Finally the current GLX specification requires that the GLX_RGBA visual
	attribute be associated only with X visual types TrueColor and DirectColor. 
	This extension defines the semantics for doing RGBA rendering to Windows
	created with visuals of type PseudoColor, StaticColor, GrayScale, and 
	StaticGray.  In each of these cases, the red component is used to
	generate the display, and the green and blue components, if present,
	are ignored for display purposes.  
	
	The OpenGL RGBA rendering semantics are more powerful than the OpenGL
	index rendering semantics.  By extending the number of X visual types
	that can be associated with an RGBA color buffer, this extension allows
	RGBA rendering semantics to be used with pseudo color and gray scale
	displays.  An especially useful application of this extension is
	support of one- and two-component RGBA drawables; drawables whose green,
	blue, and sometimes alpha components have no bitplanes.
	

The official definition of this extension is available here:
http://www.opengl.org/registry/specs/SGIX/fbconfig.txt
'''
from OpenGL import platform, constant, arrays
from OpenGL import extensions, wrapper
import ctypes
from OpenGL.raw.GLX import _types, _glgets
from OpenGL.raw.GLX.SGIX.fbconfig import *
from OpenGL.raw.GLX.SGIX.fbconfig import _EXTENSION_NAME

def glInitFbconfigSGIX():
    '''Return boolean indicating whether this extension is available'''
    from OpenGL import extensions
    return extensions.hasGLExtension( _EXTENSION_NAME )


### END AUTOGENERATED SECTION