From c06f6beae66f0c4e33cc05e0f385f21951d1ef84 Mon Sep 17 00:00:00 2001 From: Epicalert Date: Fri, 12 Nov 2021 01:15:29 +0800 Subject: [PATCH] Fix flickering on some renderers GLUT apparently doesn't do double buffers by default, (at least sometimes) so we need to explicitly set it in init. --- TODO.md | 1 - src/graphics.cpp | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index 810bb30..f77c993 100644 --- a/TODO.md +++ b/TODO.md @@ -11,7 +11,6 @@ ## Bugs - crash when eye goes outside of roi - incorrect appdata location on Windows -- flickering on some renderers # Whenever diff --git a/src/graphics.cpp b/src/graphics.cpp index d9065e8..5085aa6 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -94,8 +94,9 @@ void initGraphics () { char *argv[1] = {(char*)"fc2d"}; glutInit(&argc, argv); - glutCreateWindow(PROJECT_NAME); + glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB); glutInitWindowSize(512, 512); + glutCreateWindow(PROJECT_NAME); glewExperimental = GL_TRUE; glewInit();