From ff9cd61777119d653da329fd560e426d1484a112 Mon Sep 17 00:00:00 2001 From: "Stefanos A." Date: Tue, 1 Oct 2013 21:05:02 +0200 Subject: [PATCH] Removed terrible hack for SDL_WINDOW_OPENGL SDL2 will refuse to create an OpenGL context on a window with the SDL_WINDOW_FOREIGN flag (i.e. windows that are passed to SDL2 through SDL_CreateWindowFrom). This must be fixed upstream. --- Source/GLControl/Sdl2GLControl.cs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Source/GLControl/Sdl2GLControl.cs b/Source/GLControl/Sdl2GLControl.cs index 0cea44b2..e6e16edf 100644 --- a/Source/GLControl/Sdl2GLControl.cs +++ b/Source/GLControl/Sdl2GLControl.cs @@ -44,17 +44,10 @@ namespace OpenTK { this.mode = mode; window_info = Utilities.CreateSdl2WindowInfo(control.Handle); - - // On windows, we must set the SDL_WINDOW_OPENGL flag - // otherwise context creation will fail. - if (Configuration.RunningOnWindows) - { - // Set SDL_WINDOW_OPENGL in the SDL_Window->flags field - int flags_offset = 52; // 2 * IntPtr.Size + 9 * sizeof(int); - uint flags = (uint)Marshal.ReadInt32(window_info.Handle, 20); - flags |= 2; - Marshal.WriteInt32(window_info.Handle, flags_offset, (int)flags); - } + // Fixme: SDL2 will refuse to create an OpenGL context on + // a window with the SDL_WINDOW_FOREIGN flag (i.e. windows + // that are passed to SDL2 through SDL_CreateWindowFrom). + // This must be fixed upstream. } public Graphics.IGraphicsContext CreateContext(int major, int minor, Graphics.GraphicsContextFlags flags)