summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-08-01 13:40:13 +0200
committerFlorian Bruhin <me@the-compiler.org>2021-08-01 13:40:13 +0200
commit9d22923ce98addc7492952338a16cdb558ccc5d0 (patch)
treef76ffb5ab916cc30482b97164876f4667481656f /scripts
parent26de32045be69889840cb07b7d13b78d5246938c (diff)
downloadqutebrowser-9d22923ce98addc7492952338a16cdb558ccc5d0.tar.gz
qutebrowser-9d22923ce98addc7492952338a16cdb558ccc5d0.zip
Add opengl-info.py
I've been needing this for various issues now, see #5730, #5313, #1476
Diffstat (limited to 'scripts')
-rw-r--r--scripts/opengl-info.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/opengl-info.py b/scripts/opengl-info.py
new file mode 100644
index 000000000..2c9f886be
--- /dev/null
+++ b/scripts/opengl-info.py
@@ -0,0 +1,26 @@
+from PyQt5.QtGui import QOpenGLContext, QOpenGLVersionProfile, QOffscreenSurface, QGuiApplication
+
+app = QGuiApplication([])
+
+surface = QOffscreenSurface()
+surface.create()
+
+ctx = QOpenGLContext()
+ok = ctx.create()
+assert ok
+
+ok = ctx.makeCurrent(surface)
+assert ok
+
+print("GLES: {}".format(ctx.isOpenGLES()))
+
+vp = QOpenGLVersionProfile()
+vp.setVersion(2, 0)
+
+vf = ctx.versionFunctions(vp)
+print("Vendor: {}".format(vf.glGetString(vf.GL_VENDOR)))
+print("Renderer: {}".format(vf.glGetString(vf.GL_RENDERER)))
+print("Version: {}".format(vf.glGetString(vf.GL_VERSION)))
+print("Shading language version: {}".format(vf.glGetString(vf.GL_SHADING_LANGUAGE_VERSION)))
+
+ctx.doneCurrent()