From 498f16c2bd7eb604acfd1a53269bd41576f96495 Mon Sep 17 00:00:00 2001 From: "Stefanos A." Date: Mon, 16 Dec 2013 10:39:54 +0100 Subject: [PATCH] Improved diagnostics This helps when tracking down GraphicsContext-related issues in SDL2. --- Source/OpenTK/Platform/SDL2/Sdl2GraphicsContext.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/OpenTK/Platform/SDL2/Sdl2GraphicsContext.cs b/Source/OpenTK/Platform/SDL2/Sdl2GraphicsContext.cs index fae2c03f..a34019f9 100644 --- a/Source/OpenTK/Platform/SDL2/Sdl2GraphicsContext.cs +++ b/Source/OpenTK/Platform/SDL2/Sdl2GraphicsContext.cs @@ -73,10 +73,11 @@ namespace OpenTK.Platform.SDL2 } Mode = GetGLAttributes(SdlContext, out flags); - Debug.Print("SDL2 created GraphicsContext (mode: {0}) (flags: {1})", - Mode, flags); } Handle = GraphicsContext.GetCurrentContext(); + Debug.Print("SDL2 created GraphicsContext (handle: {0})", Handle); + Debug.Print(" GraphicsMode: {0}", Mode); + Debug.Print(" GraphicsContextFlags: {0}", flags); } #region Private Members @@ -332,7 +333,7 @@ namespace OpenTK.Platform.SDL2 { if (manual) { - Debug.Print("Disposing {0}", GetType()); + Debug.Print("Disposing {0} (handle: {1})", GetType(), Handle); lock (SDL.Sync) { SDL.GL.DeleteContext(SdlContext.Handle); @@ -340,7 +341,8 @@ namespace OpenTK.Platform.SDL2 } else { - Debug.WriteLine("Sdl2GraphicsContext leaked, did you forget to call Dispose()?"); + Debug.Print("Sdl2GraphicsContext (handle: {0}) leaked, did you forget to call Dispose()?", + Handle); } IsDisposed = true; }