File: test.py

package info (click to toggle)
python-moderngl-glcontext 3.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 188 kB
  • sloc: cpp: 1,373; python: 212; makefile: 7
file content (15 lines) | stat: -rw-r--r-- 485 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import ctypes

from glcontext import headless

devices = headless.devices()

headless.init(device=next(x['device'] for x in devices if 'EGL_MESA_device_software' in x['extensions']))

glGetStringPtr = headless.load_opengl_function('glGetString')
glGetString = ctypes.cast(glGetStringPtr, ctypes.CFUNCTYPE(ctypes.c_char_p, ctypes.c_uint32))

print(glGetString(0x1F00).decode())
print(glGetString(0x1F01).decode())
print(glGetString(0x1F02).decode())
print(glGetString(0x1F03).decode())