Support creating debug contexts.

This commit is contained in:
Themaister 2013-07-06 23:26:01 +02:00
parent 6b4924c844
commit 335c32d95d
3 changed files with 9 additions and 0 deletions

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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.