From 3d2be697a2e9e06cc1a7f7a7fe2cbce2c4b58529 Mon Sep 17 00:00:00 2001 From: Stan Date: Tue, 4 Jan 2022 00:21:37 +0000 Subject: [PATCH] Fix OpenGL ES build after ae32055c9b. This was SVN commit r26163. --- .../external_libraries/opengles2_wrapper.h | 21 ++++++++++++++++++- source/lib/ogl.cpp | 4 +++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/source/lib/external_libraries/opengles2_wrapper.h b/source/lib/external_libraries/opengles2_wrapper.h index ec6caef77d..090913e42c 100644 --- a/source/lib/external_libraries/opengles2_wrapper.h +++ b/source/lib/external_libraries/opengles2_wrapper.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -91,6 +91,25 @@ // GL_KHR_debug #define glPopDebugGroupKHR glPopDebugGroup #define glPushDebugGroupKHR glPushDebugGroup +#define GL_DEBUG_SOURCE_API_KHR GL_DEBUG_SOURCE_API +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR GL_DEBUG_SOURCE_WINDOW_SYSTEM +#define GL_DEBUG_SOURCE_SHADER_COMPILER_KHR GL_DEBUG_SOURCE_SHADER_COMPILER +#define GL_DEBUG_SOURCE_THIRD_PARTY_KHR GL_DEBUG_SOURCE_THIRD_PARTY +#define GL_DEBUG_SOURCE_APPLICATION_KHR GL_DEBUG_SOURCE_APPLICATION +#define GL_DEBUG_SOURCE_OTHER_KHR GL_DEBUG_SOURCE_OTHER +#define GL_DEBUG_TYPE_ERROR_KHR GL_DEBUG_TYPE_ERROR +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR +#define GL_DEBUG_TYPE_PORTABILITY_KHR GL_DEBUG_TYPE_PORTABILITY +#define GL_DEBUG_TYPE_PERFORMANCE_KHR GL_DEBUG_TYPE_PERFORMANCE +#define GL_DEBUG_TYPE_OTHER_KHR GL_DEBUG_TYPE_OTHER +#define GL_DEBUG_TYPE_MARKER_KHR GL_DEBUG_TYPE_MARKER +#define GL_DEBUG_TYPE_PUSH_GROUP_KHR GL_DEBUG_TYPE_PUSH_GROUP +#define GL_DEBUG_TYPE_POP_GROUP_KHR GL_DEBUG_TYPE_POP_GROUP +#define GL_DEBUG_SEVERITY_HIGH_KHR GL_DEBUG_SEVERITY_HIGH +#define GL_DEBUG_SEVERITY_MEDIUM_KHR GL_DEBUG_SEVERITY_MEDIUM +#define GL_DEBUG_SEVERITY_LOW_KHR GL_DEBUG_SEVERITY_LOW +#define GL_DEBUG_SEVERITY_NOTIFICATION_KHR GL_DEBUG_SEVERITY_NOTIFICATION #endif // CONFIG2_GLES diff --git a/source/lib/ogl.cpp b/source/lib/ogl.cpp index f8a539125f..af9e79a5b8 100644 --- a/source/lib/ogl.cpp +++ b/source/lib/ogl.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -375,6 +375,7 @@ void ogl_WarnIfErrorLoc(const char *file, int line) debug_printf("%s:%d: OpenGL error(s) occurred: %s (%04x)\n", file, line, ogl_GetErrorName(first_error), (unsigned int)first_error); } +#if KHR_DEBUG_ENABLED void GLAD_API_PTR ogl_OnDebugMessage(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei UNUSED(length), const GLchar* message, const void* UNUSED(user_param)) { std::string debugSource = "unknown"; @@ -452,6 +453,7 @@ void GLAD_API_PTR ogl_OnDebugMessage(GLenum source, GLenum type, GLuint id, GLen debug_printf("OpenGL | %s: %s source: %s id %u: %s\n", debugSeverity.c_str(), debugType.c_str(), debugSource.c_str(), id, message); } +#endif // ignore and reset the specified error (as returned by glGetError).