From c5c833571997b8b461b427b0c1ef086caad216e5 Mon Sep 17 00:00:00 2001 From: KAHR-Alpha <113597714+KAHR-Alpha@users.noreply.github.com> Date: Fri, 4 Aug 2023 15:31:44 +0200 Subject: [PATCH] Changed the Linux framerate to fix the "event collision" issue --- CHANGELOG | 1 + src/GUI/gui_gl_fd.cpp | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 3e509f7..b2534a3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,7 @@ Todo: 0.10.2 - Fixed how Materials are displayed in Selene +- Reduced the OpenGL Framerate on Linux temporarily 0.10.1 - Fixed the messed-up Mie Tool GUI due to the material rework of 0.10 diff --git a/src/GUI/gui_gl_fd.cpp b/src/GUI/gui_gl_fd.cpp index f2fb925..d94953b 100644 --- a/src/GUI/gui_gl_fd.cpp +++ b/src/GUI/gui_gl_fd.cpp @@ -16,6 +16,15 @@ limitations under the License.*/ #include + +#if defined(unix) || defined(__unix__) || defined(__unix) +#define UNIX_PLATFORM +#include +#include +#include +#endif + + extern const double Pi; //################### @@ -32,7 +41,11 @@ GL_2D_display::GL_2D_display(wxWindow *parent) timer=new wxTimer(this); Bind(wxEVT_TIMER,&GL_2D_display::evt_timed_refresh,this); Bind(wxEVT_SIZE,&GL_2D_display::evt_resize,this); + #ifdef UNIX_PLATFORM + timer->Start(1000/15); + #else timer->Start(1000/60); + #endif } GL_2D_display::~GL_2D_display() @@ -349,7 +362,11 @@ GL_3D_Base::GL_3D_Base(wxWindow *parent) // Bind(wxEVT_MOTION,&GL_3D_Base::evt_mouse_motion,this); // Bind(wxEVT_MOUSEWHEEL,&GL_3D_Base::evt_mouse_wheel,this); Bind(wxEVT_TIMER,&GL_3D_Base::timed_refresh,this); + #ifdef UNIX_PLATFORM + timer->Start(1000/15); + #else timer->Start(1000/60); + #endif // Bind(wxEVT_CREATE,&GL_3D_Base::evt_shown,this);