summaryrefslogtreecommitdiff
path: root/scripts/opengl-info.py
blob: 2c9f886be20b9a2d5ee0897c477472e4ebe0cda6 (plain)
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
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()