File: test_loadglut.py

package info (click to toggle)
pyopengl 3.1.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 11,216 kB
  • sloc: python: 80,468; makefile: 4
file content (16 lines) | stat: -rw-r--r-- 521 bytes parent folder | download | duplicates (2)
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 as 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)