From 41180a7352463f65c2a868764188c144f929dc62 Mon Sep 17 00:00:00 2001 From: Benjamin Kraft Date: Tue, 19 Sep 2023 21:36:00 +0200 Subject: [PATCH] setting depth buffer back to 24 so that vertical sync works --- src/GLWidget.cpp | 4 +++- src/main.cpp | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/GLWidget.cpp b/src/GLWidget.cpp index e5adb9d..d54161e 100644 --- a/src/GLWidget.cpp +++ b/src/GLWidget.cpp @@ -11,7 +11,7 @@ #include "FPS.h" GLWidget::GLWidget(Simulation * simulation) : simulation(simulation) { - startTimer(1000 / 60); + startTimer(1000 / 144); overlay = new Overlay(simulation); connect(simulation, &Simulation::layoutChanged, this, &GLWidget::uploadStaticDataToGPU); connect(simulation, &Simulation::layoutChanged, overlay, &Overlay::fetchEnergyLimit); @@ -44,6 +44,8 @@ void GLWidget::initializeGL() { uploadStaticDataToGPU(); overlay->init(); + + std::cout << format().swapInterval() << std::endl; } void GLWidget::paintGL() { diff --git a/src/main.cpp b/src/main.cpp index b2a5eda..2f7af61 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,9 +8,8 @@ using namespace std::chrono; int main(int argc, char* argv[]) { - QSurfaceFormat fmt; - fmt.setSamples(4); - fmt.setDepthBufferSize(32); + QSurfaceFormat fmt = QSurfaceFormat::defaultFormat(); + fmt.setDepthBufferSize(24); fmt.setSwapInterval(1); fmt.setVersion(3, 3); fmt.setProfile(QSurfaceFormat::CoreProfile);