aboutsummaryrefslogtreecommitdiff
path: root/src/OpenGLSupport.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/OpenGLSupport.h')
-rw-r--r--src/OpenGLSupport.h35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/OpenGLSupport.h b/src/OpenGLSupport.h
index 5f92580..edf7eda 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,23 +47,11 @@
// 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
-#define DO_PROCLIST_1_3(func) \
+#define DO_PROCLIST(func) \
func(GLACTIVETEXTURE, glActiveTexture); \
func(GLBLENDCOLOR, glBlendColor); \
-
-#endif
-
-
-#define DO_PROCLIST(func) \
- DO_PROCLIST_1_3(func) \
\
func(GLGENFRAMEBUFFERS, glGenFramebuffers); \
func(GLDELETEFRAMEBUFFERS, glDeleteFramebuffers); \
@@ -112,6 +102,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 +117,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