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 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261
|
from OpenGL import platform as _p, constant, extensions
from ctypes import *
from OpenGL.raw.GL._types import *
from OpenGL._bytes import as_8_bit
c_void = None
void = None
Bool = c_uint
class _GLXQuerier( extensions.ExtensionQuerier ):
prefix = as_8_bit('GLX_')
assumed_version = [1,1]
version_prefix = as_8_bit('GLX_VERSION_GLX_')
def getDisplay( self ):
from OpenGL.raw.GLX import _types
from OpenGL.platform import ctypesloader
import ctypes, os
X11 = ctypesloader.loadLibrary( ctypes.cdll, 'X11' )
XOpenDisplay = X11.XOpenDisplay
XOpenDisplay.restype = ctypes.POINTER(_types.Display)
return XOpenDisplay( os.environ.get( 'DISPLAY' ))
def getScreen( self, display ):
from OpenGL.platform import ctypesloader
from OpenGL.raw.GLX import _types
import ctypes, os
X11 = ctypesloader.loadLibrary( ctypes.cdll, 'X11' )
XDefaultScreen = X11.XDefaultScreen
XDefaultScreen.argtypes = [ctypes.POINTER(_types.Display)]
return XDefaultScreen( display )
def pullVersion( self ):
from OpenGL.GLX import glXQueryVersion
import ctypes
if glXQueryVersion:
display = self.getDisplay()
major,minor = ctypes.c_int(),ctypes.c_int()
glXQueryVersion(display, major, minor)
return [major.value,minor.value]
else:
return [1,1]
def pullExtensions( self ):
if self.getVersion() >= [1,2]:
from OpenGL.GLX import glXQueryExtensionsString
display = self.getDisplay()
screen = self.getScreen( display )
if glXQueryExtensionsString:
return glXQueryExtensionsString( display,screen ).split()
return []
GLXQuerier=_GLXQuerier()
class struct___GLXcontextRec(Structure):
__slots__ = [
]
struct___GLXcontextRec._fields_ = [
('_opaque_struct', c_int)
]
class struct___GLXcontextRec(Structure):
__slots__ = [
]
struct___GLXcontextRec._fields_ = [
('_opaque_struct', c_int)
]
GLXContext = POINTER(struct___GLXcontextRec) # /usr/include/GL/glx.h:178
XID = c_ulong # /usr/include/X11/X.h:66
GLXPixmap = XID # /usr/include/GL/glx.h:179
GLXDrawable = XID # /usr/include/GL/glx.h:180
class struct___GLXFBConfigRec(Structure):
__slots__ = [
]
struct___GLXFBConfigRec._fields_ = [
('_opaque_struct', c_int)
]
class struct___GLXFBConfigRec(Structure):
__slots__ = [
]
struct___GLXFBConfigRec._fields_ = [
('_opaque_struct', c_int)
]
GLXFBConfig = POINTER(struct___GLXFBConfigRec) # /usr/include/GL/glx.h:182
GLXFBConfigID = XID # /usr/include/GL/glx.h:183
GLXContextID = XID # /usr/include/GL/glx.h:184
GLXWindow = XID # /usr/include/GL/glx.h:185
GLXPbuffer = XID # /usr/include/GL/glx.h:186
GLXPbufferSGIX = XID
GLXVideoSourceSGIX = XID
class struct_anon_103(Structure):
__slots__ = [
'visual',
'visualid',
'screen',
'depth',
'class',
'red_mask',
'green_mask',
'blue_mask',
'colormap_size',
'bits_per_rgb',
]
class struct_anon_18(Structure):
__slots__ = [
'ext_data',
'visualid',
'class',
'red_mask',
'green_mask',
'blue_mask',
'bits_per_rgb',
'map_entries',
]
class struct__XExtData(Structure):
__slots__ = [
'number',
'next',
'free_private',
'private_data',
]
XPointer = c_char_p # /usr/include/X11/Xlib.h:84
struct__XExtData._fields_ = [
('number', c_int),
('next', POINTER(struct__XExtData)),
('free_private', POINTER(CFUNCTYPE(c_int, POINTER(struct__XExtData)))),
('private_data', XPointer),
]
XExtData = struct__XExtData # /usr/include/X11/Xlib.h:163
VisualID = c_ulong # /usr/include/X11/X.h:76
struct_anon_18._fields_ = [
('ext_data', POINTER(XExtData)),
('visualid', VisualID),
('class', c_int),
('red_mask', c_ulong),
('green_mask', c_ulong),
('blue_mask', c_ulong),
('bits_per_rgb', c_int),
('map_entries', c_int),
]
Visual = struct_anon_18 # /usr/include/X11/Xlib.h:246
struct_anon_103._fields_ = [
('visual', POINTER(Visual)),
('visualid', VisualID),
('screen', c_int),
('depth', c_int),
('class', c_int),
('red_mask', c_ulong),
('green_mask', c_ulong),
('blue_mask', c_ulong),
('colormap_size', c_int),
('bits_per_rgb', c_int),
]
XVisualInfo = struct_anon_103 # /usr/include/X11/Xutil.h:294
class struct__XDisplay(Structure):
__slots__ = [
]
struct__XDisplay._fields_ = [
('_opaque_struct', c_int)
]
class struct__XDisplay(Structure):
__slots__ = [
]
struct__XDisplay._fields_ = [
('_opaque_struct', c_int)
]
Display = struct__XDisplay # /usr/include/X11/Xlib.h:495
Pixmap = XID # /usr/include/X11/X.h:102
Font = XID # /usr/include/X11/X.h:100
Window = XID # /usr/include/X11/X.h:96
GLX_ARB_get_proc_address = constant.Constant( 'GLX_ARB_get_proc_address', 1 )
__GLXextFuncPtr = CFUNCTYPE(None) # /usr/include/GL/glx.h:330
# EXT_texture_from_pixmap (/usr/include/GL/glx.h:436)
class struct_anon_111(Structure):
__slots__ = [
'event_type',
'draw_type',
'serial',
'send_event',
'display',
'drawable',
'buffer_mask',
'aux_buffer',
'x',
'y',
'width',
'height',
'count',
]
struct_anon_111._fields_ = [
('event_type', c_int),
('draw_type', c_int),
('serial', c_ulong),
('send_event', c_int),
('display', POINTER(Display)),
('drawable', GLXDrawable),
('buffer_mask', c_uint),
('aux_buffer', c_uint),
('x', c_int),
('y', c_int),
('width', c_int),
('height', c_int),
('count', c_int),
]
GLXPbufferClobberEvent = struct_anon_111 # /usr/include/GL/glx.h:502
class struct_anon_112(Structure):
__slots__ = [
'type',
'serial',
'send_event',
'display',
'drawable',
'event_type',
'ust',
'msc',
'sbc',
]
struct_anon_112._fields_ = [
('type', c_int),
('serial', c_ulong),
('send_event', c_int),
('display', POINTER(Display)),
('drawable', GLXDrawable),
('event_type', c_int),
('ust', c_int64),
('msc', c_int64),
('sbc', c_int64),
]
GLXBufferSwapComplete = struct_anon_112 # /usr/include/GL/glx.h:514
class struct___GLXEvent(Union):
__slots__ = [
'glxpbufferclobber',
'glxbufferswapcomplete',
'pad',
]
struct___GLXEvent._fields_ = [
('glxpbufferclobber', GLXPbufferClobberEvent),
('glxbufferswapcomplete', GLXBufferSwapComplete),
('pad', c_long * 24),
]
GLXEvent = struct___GLXEvent # /usr/include/GL/glx.h:520
class GLXHyperpipeConfigSGIX( Structure ):
_fields_ = [
('pipeName', c_char * 80),
('channel',c_int),
('participationType',c_uint),
('timeSlice',c_int),
]
|