I'm trying to figure out how to use renderdoc to debug some of my python opengl apps. At this moment some of my python opengl tests are using either pyopengl(glut) or pyqt. Here's a couple of minimal tests showing up how to initalize either glut or pyqt:
GLUT
from ctypes import *
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
if __name__ == "__main__":
def display():
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glLoadIdentity()
glutSwapBuffers()
glutInit(sys.argv)
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH)
glutInitWindowSize(800, 600)
glutInitWindowPosition(800, 100)
glutCreateWindow(b'TestGLUT')
glutDisplayFunc(display)
glClearColor(1.0, 0.0, 0.0, 0.0)
glutMainLoop()
If I launch renderdoc with the above snippet using Executable Path (python path) and Command-Line arguments (-u path_to_the_glut_example.py) i'll get this output:
PYQT
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
from PyQt5 import QtWidgets
from PyQt5.QtOpenGL import QGLWidget
class Foo(QGLWidget):
def __init__(self, *args, **kwargs):
super(Foo, self).__init__(*args, **kwargs)
def initializeGL(self):
glClearColor(1.0, 0.0, 0.0, 0.0)
def paintGL(self):
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()
if __name__ == "__main__":
global app
app = QtWidgets.QApplication(sys.argv)
ex = Foo()
ex.move(800,100)
ex.resize(800, 600)
ex.show()
sys.exit(app.exec_())
If I launch renderdoc with the above snippet using Executable Path (python path) and Command-Line arguments (-u path_to_the_pyqt_example.py) i'll get this output:
So, thing is I don't know how neither glutCreateWindow (glut) nor initializeGL (pyqt) are initializing the opengl context behind the curtains but it seems renderdoc doesn't like the way they are creating the opengl context. I'd like to know how I could make working renderdoc with both glut&pyqt tests.
As an aside note:
glGetIntegerv(GL_MAJOR_VERSION) ---> 4
glGetIntegerv(GL_MINOR_VERSION) ---> 5
So, this issue is not about the context opengl version (which is good enough) but the way it's been created.