christophe3d
4th January 2013, 14:48
I am curious why QGLContext::currentContext() returns a const QGLcontext *, but QGLContext::makeCurrent() is not const. This makes it impossible to save a context to make it current later without casting. Are there non-obvious restrictions that would make the following illegal:
QGLContext *saveContext = QGLContext::currentContext();
// [... Something that possibly changes the context ]
saveContext->makeCurrent();
QGLContext *saveContext = QGLContext::currentContext();
// [... Something that possibly changes the context ]
saveContext->makeCurrent();