[PyQt] How to get access to QOpenGLFunctions.glGetString from PyQt?
russ at perspexis.com
Thu Jan 19 03:19:23 GMT 2017
I'm trying to get a set of OpenGL strings using PyQt. To make it clear
what I'm trying to achieve, this is how I would do it via PyOpenGL (which
is not available):
>>> from OpenGL.GL import glGetString, GL_VERSION, GL_RENDERER, GL_VENDOR
>>> for s in (GL_VENDOR, GL_RENDERER, GL_VERSION):
b'Quadro FX 3700M/PCIe/SSE2'
b'3.3.0 NVIDIA 340.96'
This *should* be achievable through Qt/PyQt with the use of `glGetString()`
in the `QOpenGLFunctions` class , but I'm having several PyQt problems
following the Qt docs for using this.
The first issue is that I can't locate `QOpenGLFunctions` anywhere in
PyQt... where is it?
The second issue is that `QOpenGLContext` instances are supposed to have a
`functions()` method that provides an easily accessible instance of
`QOpenGLFunctions` (for ad-hoc usage, per Qt docs), but it does not exist
on contexts created in PyQt.
How do I get a hold of `QOpenGLFunctions` via PyQt? Alternatively, is
there some other PyQt way to get the OpenGL strings that I want?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt