From 032a38e13be28ce4c1858456ace01f50f14e6e0d Mon Sep 17 00:00:00 2001 From: "H. Utku Maden" Date: Mon, 4 Mar 2024 21:41:16 +0300 Subject: [PATCH] Small fixes on OpenTK support. --- Quik.OpenTK/OpenTKPlatform.cs | 5 +++++ Quik.OpenTK/OpenTKPort.cs | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Quik.OpenTK/OpenTKPlatform.cs b/Quik.OpenTK/OpenTKPlatform.cs index 468bdbc..669429c 100644 --- a/Quik.OpenTK/OpenTKPlatform.cs +++ b/Quik.OpenTK/OpenTKPlatform.cs @@ -37,6 +37,11 @@ namespace Quik.OpenTK IsGLInitialized = true; } + window.Closing += (ea) => + { + Environment.Exit(0); + }; + return port; } diff --git a/Quik.OpenTK/OpenTKPort.cs b/Quik.OpenTK/OpenTKPort.cs index 2c13d2b..ca5153f 100644 --- a/Quik.OpenTK/OpenTKPort.cs +++ b/Quik.OpenTK/OpenTKPort.cs @@ -72,7 +72,8 @@ namespace Quik.OpenTK _vertexEngine.Reset(); _vertexEngine.ProcessCommands(new QRectangle(), queue); - _window.Context.MakeCurrent(); + if (!_window.Context.IsCurrent) + _window.Context.MakeCurrent(); if (!_glDriver.IsInit) _glDriver.Init();