summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/src/renderer_gl.h
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/src/renderer_gl.h')
-rw-r--r--3rdparty/bgfx/src/renderer_gl.h66
1 files changed, 29 insertions, 37 deletions
diff --git a/3rdparty/bgfx/src/renderer_gl.h b/3rdparty/bgfx/src/renderer_gl.h
index 4c2942a03b8..f5b9e05ea76 100644
--- a/3rdparty/bgfx/src/renderer_gl.h
+++ b/3rdparty/bgfx/src/renderer_gl.h
@@ -1,18 +1,17 @@
/*
- * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2023 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_RENDERER_GL_H_HEADER_GUARD
#define BGFX_RENDERER_GL_H_HEADER_GUARD
-#define BGFX_USE_EGL (BGFX_CONFIG_RENDERER_OPENGLES && (0 \
- || BX_PLATFORM_ANDROID \
- || BX_PLATFORM_BSD \
- || BX_PLATFORM_LINUX \
- || BX_PLATFORM_NX \
- || BX_PLATFORM_RPI \
- || BX_PLATFORM_WINDOWS \
+#define BGFX_USE_EGL ( (BGFX_CONFIG_RENDERER_OPENGL || BGFX_CONFIG_RENDERER_OPENGLES) && (0 \
+ || BX_PLATFORM_ANDROID \
+ || BX_PLATFORM_BSD \
+ || BX_PLATFORM_LINUX \
+ || BX_PLATFORM_NX \
+ || BX_PLATFORM_RPI \
) )
#define BGFX_USE_HTML5 (BGFX_CONFIG_RENDERER_OPENGLES && (0 \
@@ -23,11 +22,6 @@
|| BX_PLATFORM_WINDOWS \
) )
-#define BGFX_USE_GLX (BGFX_CONFIG_RENDERER_OPENGL && (0 \
- || BX_PLATFORM_BSD \
- || BX_PLATFORM_LINUX \
- ) )
-
#define BGFX_USE_GL_DYNAMIC_LIB (0 \
|| BX_PLATFORM_BSD \
|| BX_PLATFORM_LINUX \
@@ -140,18 +134,16 @@ typedef uint64_t GLuint64;
# define GL_UNSIGNED_INT_24_8 GL_UNSIGNED_INT_24_8_OES
# elif BGFX_CONFIG_RENDERER_OPENGLES >= 30
# include <GLES3/gl3platform.h>
-# include <GLES3/gl3.h>
-# include <GLES3/gl3ext.h>
+# if BGFX_CONFIG_RENDERER_OPENGLES >= 32
+# include <GLES3/gl32.h>
+# elif BGFX_CONFIG_RENDERER_OPENGLES >= 31
+# include <GLES3/gl31.h>
+# else
+# include <GLES3/gl3.h>
+# endif // BGFX_CONFIG_RENDERER_OPENGLES
+# include <GLES2/gl2ext.h>
# endif // BGFX_CONFIG_RENDERER_
-# if BGFX_USE_EGL
-# include "glcontext_egl.h"
-# endif // BGFX_USE_EGL
-
-# if BGFX_USE_HTML5
-# include "glcontext_html5.h"
-# endif // BGFX_USE_EGL
-
#endif // BGFX_CONFIG_RENDERER_OPENGL
#include "renderer.h"
@@ -1162,18 +1154,18 @@ typedef uint64_t GLuint64;
# define GL_TEXTURE_LOD_BIAS 0x8501
#endif // GL_TEXTURE_LOD_BIAS
-#if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# include "glcontext_glx.h"
+#if BGFX_USE_EGL
+# include "glcontext_egl.h"
+#elif BGFX_USE_HTML5
+# include "glcontext_html5.h"
+#elif BGFX_USE_WGL
+# include "glcontext_wgl.h"
#elif BX_PLATFORM_OSX
# include "glcontext_nsgl.h"
#elif BX_PLATFORM_IOS
# include "glcontext_eagl.h"
#endif // BX_PLATFORM_
-#if BGFX_USE_WGL
-# include "glcontext_wgl.h"
-#endif // BGFX_USE_WGL
-
#ifndef GL_APIENTRY
# define GL_APIENTRY APIENTRY
#endif // GL_APIENTRY
@@ -1200,14 +1192,14 @@ namespace bgfx { namespace gl
const char* glEnumName(GLenum _enum);
-#define _GL_CHECK(_check, _call) \
- BX_MACRO_BLOCK_BEGIN \
- /*BX_TRACE(#_call);*/ \
- _call; \
- GLenum gl_err = glGetError(); \
- _check(0 == gl_err, #_call "; GL error 0x%x: %s", gl_err, glEnumName(gl_err) ); \
- BX_UNUSED(gl_err); \
- BX_MACRO_BLOCK_END
+#define _GL_CHECK(_check, _call) \
+ BX_MACRO_BLOCK_BEGIN \
+ /*BX_TRACE(#_call);*/ \
+ _call; \
+ GLenum gl_err = glGetError(); \
+ _check(0 == gl_err, #_call "; GL error 0x%x: %s", gl_err, glEnumName(gl_err) ); \
+ BX_UNUSED(gl_err); \
+ BX_MACRO_BLOCK_END
#define IGNORE_GL_ERROR_CHECK(...) BX_NOOP()