X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=main.cpp;h=e2d2cec4ee42c46f12527c9f29be3972302cb0ea;hb=aa96a4a558b36b1b2aaeaf34ddce33dc09622b28;hp=75ae9a7f7cbfa6354d7c7553dfa28070d89cfab7;hpb=688a3fb0b123f495ae356bbc3c3fb549f04c076f;p=nageru diff --git a/main.cpp b/main.cpp index 75ae9a7..e2d2cec 100644 --- a/main.cpp +++ b/main.cpp @@ -5,13 +5,13 @@ extern "C" { #include #include #include -#include - +#include // IWYU pragma: keep #include #include #include #include #include +#include #include "context.h" #include "flags.h" @@ -41,6 +41,11 @@ int main(int argc, char *argv[]) fmt.setProfile(QSurfaceFormat::CoreProfile); fmt.setMajorVersion(3); fmt.setMinorVersion(1); + + // Turn off vsync, since Qt generally gives us at most frame rate + // (display frequency) / (number of QGLWidgets active). + fmt.setSwapInterval(0); + QSurfaceFormat::setDefaultFormat(fmt); QGLFormat::setDefaultFormat(QGLFormat::fromSurfaceFormat(fmt)); @@ -48,7 +53,7 @@ int main(int argc, char *argv[]) global_share_widget = new QGLWidget(); MainWindow mainWindow; - mainWindow.resize(QSize(1500, 810)); + mainWindow.resize(QSize(1500, 850)); mainWindow.show(); app.installEventFilter(&mainWindow); // For white balance color picking. @@ -62,6 +67,9 @@ int main(int argc, char *argv[]) fprintf(stderr, "Failed to lock Nageru into RAM. You probably want to\n"); fprintf(stderr, "increase \"memlock\" for your user in limits.conf\n"); fprintf(stderr, "for better realtime behavior.\n"); + uses_mlock = false; + } else { + uses_mlock = true; } int rc = app.exec();