File: check_glut_load.py

package info (click to toggle)
pyopengl 3.1.10%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,024 kB
  • sloc: python: 108,056; sh: 13; makefile: 8
file content (22 lines) | stat: -rw-r--r-- 601 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from __future__ import print_function
import ctypes, sys

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)
sys.stdout.write('OK\n')
sys.stdout.flush()