File: test_loadglut.py

package info (click to toggle)
pyopengl 3.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,140 kB
  • sloc: python: 26,428; makefile: 2
file content (16 lines) | stat: -rw-r--r-- 515 bytes parent folder | download | duplicates (3)
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