From bd31c2b4844a919f342b43ded6a45af9284baeec Mon Sep 17 00:00:00 2001 From: Luflosi Date: Mon, 29 Jun 2020 11:49:49 +0200 Subject: [PATCH] Add GLFW_CONTEXT_DEBUG window hint alias From upstream: https://github.com/glfw/glfw/commit/b420ca74047e26d03bb107b66c50108b153b4ce1. --- glfw/glfw3.h | 11 ++++++++--- glfw/window.c | 4 ++-- kitty/fast_data_types.pyi | 2 +- kitty/glfw-wrapper.h | 11 ++++++++--- kitty/glfw.c | 2 +- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/glfw/glfw3.h b/glfw/glfw3.h index c8b327edd..00af40498 100644 --- a/glfw/glfw3.h +++ b/glfw/glfw3.h @@ -1056,10 +1056,15 @@ extern "C" { #define GLFW_OPENGL_FORWARD_COMPAT 0x00022006 /*! @brief Debug mode context hint and attribute. * - * Debug mode context [hint](@ref GLFW_OPENGL_DEBUG_CONTEXT_hint) and - * [attribute](@ref GLFW_OPENGL_DEBUG_CONTEXT_attrib). + * Debug mode context [hint](@ref GLFW_CONTEXT_DEBUG_hint) and + * [attribute](@ref GLFW_CONTEXT_DEBUG_attrib). */ -#define GLFW_OPENGL_DEBUG_CONTEXT 0x00022007 +#define GLFW_CONTEXT_DEBUG 0x00022007 +/*! @brief Legacy name for compatibility. + * + * This is an alias for compatibility with earlier versions. + */ +#define GLFW_OPENGL_DEBUG_CONTEXT GLFW_CONTEXT_DEBUG /*! @brief OpenGL profile hint and attribute. * * OpenGL profile [hint](@ref GLFW_OPENGL_PROFILE_hint) and diff --git a/glfw/window.c b/glfw/window.c index 20d9926a2..cb2f254c8 100644 --- a/glfw/window.c +++ b/glfw/window.c @@ -440,7 +440,7 @@ GLFWAPI void glfwWindowHint(int hint, int value) case GLFW_OPENGL_FORWARD_COMPAT: _glfw.hints.context.forward = value ? true : false; return; - case GLFW_OPENGL_DEBUG_CONTEXT: + case GLFW_CONTEXT_DEBUG: _glfw.hints.context.debug = value ? true : false; return; case GLFW_CONTEXT_NO_ERROR: @@ -931,7 +931,7 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* handle, int attrib) return window->context.robustness; case GLFW_OPENGL_FORWARD_COMPAT: return window->context.forward; - case GLFW_OPENGL_DEBUG_CONTEXT: + case GLFW_CONTEXT_DEBUG: return window->context.debug; case GLFW_OPENGL_PROFILE: return window->context.profile; diff --git a/kitty/fast_data_types.pyi b/kitty/fast_data_types.pyi index 50f1bb4db..f34310379 100644 --- a/kitty/fast_data_types.pyi +++ b/kitty/fast_data_types.pyi @@ -275,7 +275,7 @@ GLFW_CONTEXT_VERSION_MINOR: int GLFW_CONTEXT_REVISION: int GLFW_CONTEXT_ROBUSTNESS: int GLFW_OPENGL_FORWARD_COMPAT: int -GLFW_OPENGL_DEBUG_CONTEXT: int +GLFW_CONTEXT_DEBUG: int GLFW_OPENGL_PROFILE: int GLFW_OPENGL_API: int GLFW_OPENGL_ES_API: int diff --git a/kitty/glfw-wrapper.h b/kitty/glfw-wrapper.h index 7b6a4dde1..d6d896c1d 100644 --- a/kitty/glfw-wrapper.h +++ b/kitty/glfw-wrapper.h @@ -794,10 +794,15 @@ #define GLFW_OPENGL_FORWARD_COMPAT 0x00022006 /*! @brief Debug mode context hint and attribute. * - * Debug mode context [hint](@ref GLFW_OPENGL_DEBUG_CONTEXT_hint) and - * [attribute](@ref GLFW_OPENGL_DEBUG_CONTEXT_attrib). + * Debug mode context [hint](@ref GLFW_CONTEXT_DEBUG_hint) and + * [attribute](@ref GLFW_CONTEXT_DEBUG_attrib). */ -#define GLFW_OPENGL_DEBUG_CONTEXT 0x00022007 +#define GLFW_CONTEXT_DEBUG 0x00022007 +/*! @brief Legacy name for compatibility. + * + * This is an alias for compatibility with earlier versions. + */ +#define GLFW_OPENGL_DEBUG_CONTEXT GLFW_CONTEXT_DEBUG /*! @brief OpenGL profile hint and attribute. * * OpenGL profile [hint](@ref GLFW_OPENGL_PROFILE_hint) and diff --git a/kitty/glfw.c b/kitty/glfw.c index fa7b51aa1..961fa4870 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -1532,7 +1532,7 @@ init_glfw(PyObject *m) { ADDC(GLFW_CONTEXT_REVISION); ADDC(GLFW_CONTEXT_ROBUSTNESS); ADDC(GLFW_OPENGL_FORWARD_COMPAT); - ADDC(GLFW_OPENGL_DEBUG_CONTEXT); + ADDC(GLFW_CONTEXT_DEBUG); ADDC(GLFW_OPENGL_PROFILE); // ---