update glinfo.py to use QOpenGLWidget

This commit is contained in:
KIU Shueng Chuan 2021-01-14 19:50:49 +08:00
parent 9145d7f24d
commit 4f619bbb4c
1 changed files with 5 additions and 9 deletions

View File

@ -1,16 +1,12 @@
from ..Qt import QtCore, QtGui, QtOpenGL
from ..Qt import QtWidgets
from OpenGL.GL import *
app = QtGui.QApplication([])
class GLTest(QtOpenGL.QGLWidget):
def __init__(self):
QtOpenGL.QGLWidget.__init__(self)
self.makeCurrent()
class GLTest(QtWidgets.QOpenGLWidget):
def initializeGL(self):
print("GL version:" + glGetString(GL_VERSION).decode("utf-8"))
print("MAX_TEXTURE_SIZE: %d" % glGetIntegerv(GL_MAX_TEXTURE_SIZE))
print("MAX_3D_TEXTURE_SIZE: %d" % glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE))
print("Extensions: " + glGetString(GL_EXTENSIONS).decode("utf-8").replace(" ", "\n"))
GLTest()
app = QtWidgets.QApplication([])
GLTest().show()