1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
from os_egl import egl_context
from OpenGL import EGL
from OpenGL.EGL.EXT import device_query, device_enumeration
from OpenGL.GL import GLint
def main():
with egl_context(output=None, pbuffer=True) as context:
display, context, surface = context
print("Vendor: %s" % (EGL.eglQueryString(display, EGL.EGL_VENDOR)))
print("Version: %s" % (EGL.eglQueryString(display, EGL.EGL_VERSION)))
print("Extensions: %s" % (EGL.eglQueryString(display, EGL.EGL_EXTENSIONS),))
print(
"Client Extensions: %s"
% (EGL.eglQueryString(display, EGL.EGL_CLIENT_APIS),)
)
if device_enumeration.eglQueryDevicesEXT:
devices = (device_query.EGLDeviceEXT * 5)()
count = GLint()
device_enumeration.eglQueryDevicesEXT(
5,
devices,
count,
)
for device in devices[: count.value]:
print(device)
else:
print('No device_query extension available')
print('OK')
if __name__ == "__main__":
import logging
logging.basicConfig(level=logging.DEBUG)
main()
|