summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2024-06-07 19:12:35 -0700
committer3gg <3gg@shellblade.net>2024-06-07 19:12:35 -0700
commit584e976d916b6405452e40253848f1b752344c50 (patch)
tree9ca67248b102e68c070e0e87d9062494865dcaca
parentb55bc7d6620f069f576cbabaf47c571ee2e545b9 (diff)
Format.
-rw-r--r--gfx/src/core/gl_util.h56
1 files changed, 27 insertions, 29 deletions
diff --git a/gfx/src/core/gl_util.h b/gfx/src/core/gl_util.h
index a3cc629..d2d6e22 100644
--- a/gfx/src/core/gl_util.h
+++ b/gfx/src/core/gl_util.h
@@ -3,8 +3,6 @@
3#include <glad/glad.h> 3#include <glad/glad.h>
4#include <log/log.h> 4#include <log/log.h>
5 5
6#include <assert.h>
7
8#define GFX_GL_CONTEXT_PC 1 6#define GFX_GL_CONTEXT_PC 1
9#define GFX_GL_CONTEXT_ES 2 7#define GFX_GL_CONTEXT_ES 2
10 8
@@ -14,33 +12,33 @@
14 12
15/// Log an error if an OpenGL has occurred. 13/// Log an error if an OpenGL has occurred.
16#ifndef NDEBUG 14#ifndef NDEBUG
17#define ASSERT_GL \ 15#define ASSERT_GL \
18 { \ 16 { \
19 GLenum e = glGetError(); \ 17 GLenum e = glGetError(); \
20 switch (e) { \ 18 switch (e) { \
21 case GL_NO_ERROR: \ 19 case GL_NO_ERROR: \
22 break; \ 20 break; \
23 case GL_INVALID_ENUM: \ 21 case GL_INVALID_ENUM: \
24 LOGE("GL_INVALID_ENUM"); \ 22 LOGE("GL_INVALID_ENUM"); \
25 break; \ 23 break; \
26 case GL_INVALID_VALUE: \ 24 case GL_INVALID_VALUE: \
27 LOGE("GL_INVALID_VALUE"); \ 25 LOGE("GL_INVALID_VALUE"); \
28 break; \ 26 break; \
29 case GL_INVALID_OPERATION: \ 27 case GL_INVALID_OPERATION: \
30 LOGE("GL_INVALID_OPERATION"); \ 28 LOGE("GL_INVALID_OPERATION"); \
31 break; \ 29 break; \
32 case GL_INVALID_FRAMEBUFFER_OPERATION: \ 30 case GL_INVALID_FRAMEBUFFER_OPERATION: \
33 LOGE("GL_INVALID_FRAMEBUFFER_OPERATION"); \ 31 LOGE("GL_INVALID_FRAMEBUFFER_OPERATION"); \
34 break; \ 32 break; \
35 case GL_OUT_OF_MEMORY: \ 33 case GL_OUT_OF_MEMORY: \
36 LOGE("GL_OUT_OF_MEMORY"); \ 34 LOGE("GL_OUT_OF_MEMORY"); \
37 break; \ 35 break; \
38 /*case GL_STACK_UNDERFLOW: LOGE("GL_STACK_UNDERFLOW");*/ \ 36 /*case GL_STACK_UNDERFLOW: LOGE("GL_STACK_UNDERFLOW");*/ \
39 /*case GL_STACK_OVERFLOW: LOGE("GL_STACK_OVERFLOW");*/ \ 37 /*case GL_STACK_OVERFLOW: LOGE("GL_STACK_OVERFLOW");*/ \
40 default: \ 38 default: \
41 LOGE("Unknown OpenGL error"); \ 39 LOGE("Unknown OpenGL error"); \
42 break; \ 40 break; \
43 } \ 41 } \
44 } 42 }
45#else // Not NDEBUG. 43#else // Not NDEBUG.
46#define ASSERT_GL 44#define ASSERT_GL