aboutsummaryrefslogtreecommitdiff
path: root/src/OpenGLSupport.h
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2020-05-30 03:19:20 +0200
committerArisotura <thetotalworm@gmail.com>2020-05-30 03:19:20 +0200
commitb62d90cbe4c5232f0fe8604bd5e11f8eccd48ba1 (patch)
treebfd0a5e6f30fc382170ec9402adea32f12ebc342 /src/OpenGLSupport.h
parent82302c9bf48598f889d0942340c224852c1378c5 (diff)
parent993048dd241b59747a7b30edfc861eedd4c005c9 (diff)
Merge remote-tracking branch 'remotes/origin/master' into melonDSi
Diffstat (limited to 'src/OpenGLSupport.h')
-rw-r--r--src/OpenGLSupport.h31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/OpenGLSupport.h b/src/OpenGLSupport.h
index 5f92580..925c0ad 100644
--- a/src/OpenGLSupport.h
+++ b/src/OpenGLSupport.h
@@ -21,6 +21,8 @@
#include <stdio.h>
#include <string.h>
+
+// TODO: different includes for each platform
#include <GL/gl.h>
#include <GL/glext.h>
@@ -45,18 +47,18 @@
// if you need more OpenGL functions, add them to the macronator here
-// TODO: handle conditionally loading certain functions for different GL versions
-#ifndef __WIN32__
-#define DO_PROCLIST_1_3(func)
-
-#else
+#ifdef __WIN32__
#define DO_PROCLIST_1_3(func) \
func(GLACTIVETEXTURE, glActiveTexture); \
func(GLBLENDCOLOR, glBlendColor); \
+#else
+
+#define DO_PROCLIST_1_3(func)
+
#endif
@@ -112,6 +114,11 @@
func(GLGETUNIFORMLOCATION, glGetUniformLocation); \
func(GLGETUNIFORMBLOCKINDEX, glGetUniformBlockIndex); \
\
+ func(GLFENCESYNC, glFenceSync); \
+ func(GLDELETESYNC, glDeleteSync); \
+ func(GLWAITSYNC, glWaitSync); \
+ func(GLCLIENTWAITSYNC, glClientWaitSync); \
+ \
func(GLDRAWBUFFERS, glDrawBuffers); \
\
func(GLBLENDFUNCSEPARATE, glBlendFuncSeparate); \
@@ -122,14 +129,18 @@
func(GLGETSTRINGI, glGetStringi); \
+namespace OpenGL
+{
+
DO_PROCLIST(DECLPROC_EXT);
+bool Init();
-bool OpenGL_Init();
+bool BuildShaderProgram(const char* vs, const char* fs, GLuint* ids, const char* name);
+bool LinkShaderProgram(GLuint* ids);
+void DeleteShaderProgram(GLuint* ids);
+void UseShaderProgram(GLuint* ids);
-bool OpenGL_BuildShaderProgram(const char* vs, const char* fs, GLuint* ids, const char* name);
-bool OpenGL_LinkShaderProgram(GLuint* ids);
-void OpenGL_DeleteShaderProgram(GLuint* ids);
-void OpenGL_UseShaderProgram(GLuint* ids);
+}
#endif // OPENGLSUPPORT_H