File: check_glut_load.py

package info (click to toggle)
pyopengl 3.1.5%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 14,668 kB
  • sloc: python: 108,024; makefile: 4
file content (17 lines) | stat: -rw-r--r-- 560 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from __future__ import print_function
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)