Created
February 4, 2022 14:45
-
-
Save GuillaumeFavelier/06dcae8677bb66181714d1285fbe8e61 to your computer and use it in GitHub Desktop.
Check OpenGL_ES3 support with PyOpenGL
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
from OpenGL.GL import (glGetIntegerv, glGetStringi, GL_NUM_EXTENSIONS, | |
GL_EXTENSIONS) | |
from OpenGL.GLUT import glutInit, glutCreateWindow | |
glutInit() | |
wind = glutCreateWindow("Check OpenGL ES3") | |
num_extensions = glGetIntegerv(GL_NUM_EXTENSIONS, 0) | |
extensions = list() | |
for i in range(num_extensions.value): | |
current_ext = glGetStringi(GL_EXTENSIONS, i) | |
extensions.append(current_ext.decode("utf-8")) | |
extensions = [ext for ext in extensions if '_ES3' in ext] | |
print(extensions) # return the list of supported OPENGL_ES3 extensions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment