It is possible to reconfigure SIMTOI to operate without any on-screen GUI with some changes to the way the QGLWidget is created. Consider the following example:
void renderOffScreen ()
{
std::cout << glGetString(GL_VENDOR) << std::endl;
std::cout << glGetString(GL_RENDERER) << std::endl;
std::cout << glGetString(GL_VERSION) << std::endl;
// do whatever you want here, e.g. setup a FBO,
// render stuff, read the results back until you're done
// pseudocode:
//
// setupFBO();
//
// while(!done)
// {
// renderFrame();
// readBackPixels();
// processImage();
// }
}
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
QGLWidget gl;
// after construction, you should have a valid context
// however, it is NOT made current unless show() or
// similar functions are called
if(!gl.isValid ())
{
std::cout << "ERROR: No GL context!" << std::endl;
return -1;
}
// do some off-screen rendering, the widget has never been made visible
gl.makeCurrent (); // ABSOLUTELY CRUCIAL!
renderOffScreen ();
return 0;
}
It is possible to reconfigure SIMTOI to operate without any on-screen GUI with some changes to the way the QGLWidget is created. Consider the following example:
'''
include
'''