From 7460452b2631efb3e301c392490ca3c5a0a610ad Mon Sep 17 00:00:00 2001 From: "Stefanos A." Date: Tue, 1 Oct 2013 22:13:33 +0200 Subject: [PATCH] MakeCurrent(null) should make context non-current This fixes the crash in the "GameWindow Threading" example. --- Source/OpenTK/Platform/SDL2/Sdl2GraphicsContext.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/OpenTK/Platform/SDL2/Sdl2GraphicsContext.cs b/Source/OpenTK/Platform/SDL2/Sdl2GraphicsContext.cs index fb6cd0e5..d004f93e 100644 --- a/Source/OpenTK/Platform/SDL2/Sdl2GraphicsContext.cs +++ b/Source/OpenTK/Platform/SDL2/Sdl2GraphicsContext.cs @@ -178,7 +178,7 @@ namespace OpenTK.Platform.SDL2 public override void MakeCurrent(IWindowInfo window) { var sdl_window = window as Sdl2WindowInfo; - if (SDL.SDL_GL_MakeCurrent(sdl_window.Handle, SdlContext.Handle) < 0) + if (SDL.SDL_GL_MakeCurrent(sdl_window != null ? sdl_window.Handle : IntPtr.Zero, SdlContext.Handle) < 0) { Debug.Print("SDL2 MakeCurrent failed with: {0}", SDL.SDL_GetError()); }