Commit 53f804aa authored by Ronan Abhamon's avatar Ronan Abhamon

feat(src/main): try to optimize opengl context

parent afba34e0
......@@ -54,6 +54,7 @@ CameraRenderer::~CameraRenderer () {
QOpenGLFramebufferObject *CameraRenderer::createFramebufferObject (const QSize &size) {
QOpenGLFramebufferObjectFormat format;
format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
format.setInternalTextureFormat(GL_RGBA8);
format.setSamples(4);
......
......@@ -30,11 +30,30 @@ using namespace std;
// =============================================================================
int main (int argc, char *argv[]) {
// Disable QML cache. Avoid malformed cache.
qputenv("QML_DISABLE_DISK_CACHE", "true");
// Options to get a nice video render.
QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL, true);
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
{
QSurfaceFormat format;
format.setSwapBehavior(QSurfaceFormat::TripleBuffer);
format.setSwapInterval(1);
format.setRedBufferSize(8);
format.setGreenBufferSize(8);
format.setBlueBufferSize(8);
format.setAlphaBufferSize(8);
format.setDepthBufferSize(24);
format.setStencilBufferSize(8);
QSurfaceFormat::setDefaultFormat(format);
}
App app(argc, argv);
app.parseArgs();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment