diff --git a/gfx/context/glx_ctx.c b/gfx/context/glx_ctx.c index 04ecd3fd2e..99f0fcd9a4 100644 --- a/gfx/context/glx_ctx.c +++ b/gfx/context/glx_ctx.c @@ -382,6 +382,7 @@ static bool gfx_ctx_set_video_mode( GLX_CONTEXT_MAJOR_VERSION_ARB, g_major, GLX_CONTEXT_MINOR_VERSION_ARB, g_minor, GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB, + GLX_CONTEXT_FLAGS_ARB, g_extern.system.hw_render_callback.debug_context ? GLX_CONTEXT_DEBUG_BIT_ARB : 0, None, }; diff --git a/gfx/context/wgl_ctx.c b/gfx/context/wgl_ctx.c index 1af72a9420..fd5865508f 100644 --- a/gfx/context/wgl_ctx.c +++ b/gfx/context/wgl_ctx.c @@ -117,11 +117,18 @@ static void create_gl_context(HWND hwnd) #endif #ifndef WGL_CONTEXT_CORE_PROFILE_BIT_ARB #define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x0001 +#endif +#ifndef WGL_CONTEXT_FLAGS_ARB +#define WGL_CONTEXT_FLAGS_ARB 0x2094 +#endif +#ifndef WGL_CONTEXT_DEBUG_BIT_ARB +#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 #endif const int attribs[] = { WGL_CONTEXT_MAJOR_VERSION_ARB, g_major, WGL_CONTEXT_MINOR_VERSION_ARB, g_minor, WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB, + WGL_CONTEXT_FLAGS_ARB, g_extern.system.hw_render_callback.debug_context ? WGL_CONTEXT_DEBUG_BIT_ARB : 0, 0, }; diff --git a/libretro.h b/libretro.h index 1aae5d6d86..54873fd551 100755 --- a/libretro.h +++ b/libretro.h @@ -533,6 +533,7 @@ struct retro_hw_render_callback // The reset callback might still be called in extreme situations such as if the context is lost beyond recovery. // For optimal stability, set this to false, and allow context to be reset at any time. retro_hw_context_reset_t context_destroy; // A callback to be called before the context is destroyed. Resources can be deinitialized at this step. This can be set to NULL, in which resources will just be destroyed without any notification. + bool debug_context; // Creates a debug context. Only takes effect when using GL core. }; // Callback type passed in RETRO_ENVIRONMENT_SET_KEYBOARD_CALLBACK. Called by the frontend in response to keyboard events.