Skip to content

Commit

Permalink
Create OpenGL context with debug flag for better error messages. (Mon…
Browse files Browse the repository at this point in the history
  • Loading branch information
cpt-max authored and viniciusjarina committed Sep 18, 2021
1 parent 3c7a193 commit 6094cfb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions MonoGame.Framework/Platform/Graphics/GraphicsContext.SDL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6094cfb

Please sign in to comment.