-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to create script to query the egl device enumerations
- Loading branch information
Showing
2 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
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) 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[:int(count)]: | ||
print(device) | ||
else: | ||
print('No device_query extension available') | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters