diff --git a/MonoGame.Framework/Platform/Graphics/GraphicsContext.SDL.cs b/MonoGame.Framework/Platform/Graphics/GraphicsContext.SDL.cs index f6a2756b0c4..eb9d42c9354 100644 --- a/MonoGame.Framework/Platform/Graphics/GraphicsContext.SDL.cs +++ b/MonoGame.Framework/Platform/Graphics/GraphicsContext.SDL.cs @@ -41,6 +41,10 @@ public GraphicsContext(IWindowInfo info) return; SetWindowHandle(info); +#if DEBUG + // create debug context, so we get better error messages (glDebugMessageCallback) + Sdl.GL.SetAttribute(Sdl.GL.Attribute.ContextFlags, 1); // 1 = SDL_GL_CONTEXT_DEBUG_FLAG +#endif _context = Sdl.GL.CreateContext(_winHandle); // GL entry points must be loaded after the GL context creation, otherwise some Windows drivers will return only GL 1.3 compatible functions