File: test_loadglut.py

package info (click to toggle)
pyopengl 3.0.0~b6-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 5,696 kB
  • ctags: 26,182
  • sloc: python: 34,233; ansic: 70; sh: 26; makefile: 15
file content (16 lines) | stat: -rw-r--r-- 501 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import ctypes
try:
	from ctypes.util import find_library
except ImportError, err:
	from ctypes.util import findLib 
	def find_library( string ):
		return findLib( string )[0]

GL = OpenGL = ctypes.CDLL( find_library('GL'), mode=ctypes.RTLD_GLOBAL )
GLU = ctypes.CDLL( find_library('GLU'), mode=ctypes.RTLD_GLOBAL )
# glut shouldn't need to be global IIUC
GLUT = ctypes.CDLL( find_library('glut'), mode=ctypes.RTLD_GLOBAL )
print 'GL', GL
print 'GLU', GLU
print 'GLUT', GLUT
print GLUT.glutSolidTeapot