diff options
| author | Matthias Melcher <github@matthiasm.com> | 2024-01-29 14:01:41 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2024-01-29 14:01:41 +0100 |
| commit | faff63130c90461d7e077be68a40a716257be12d (patch) | |
| tree | 15ae77eb7279af23704b7db671a30ac18657b8ae /src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx | |
| parent | c40b1653532aa08412aa8232fb8a11289512283e (diff) | |
Fix cached GL context on all platforms (#737)
Diffstat (limited to 'src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx')
| -rw-r--r-- | src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx index 0c94f8af5..d6f1a9632 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Gl_Window_Driver.cxx @@ -163,16 +163,16 @@ GLContext Fl_WinAPI_Gl_Window_Driver::create_gl_context(Fl_Window* window, const } void Fl_WinAPI_Gl_Window_Driver::set_gl_context(Fl_Window* w, GLContext context) { - if (context != cached_context || w != cached_window) { - cached_context = context; + GLContext current_context = wglGetCurrentContext(); + if (context != current_context || w != cached_window) { cached_window = w; wglMakeCurrent(Fl_WinAPI_Window_Driver::driver(w)->private_dc, (HGLRC)context); } } void Fl_WinAPI_Gl_Window_Driver::delete_gl_context(GLContext context) { - if (cached_context == context) { - cached_context = 0; + GLContext current_context = wglGetCurrentContext(); + if (current_context == context) { cached_window = 0; wglMakeCurrent(0, 0); } |
