Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/render')
-rw-r--r--src/render/gl.cc8
-rw-r--r--src/render/gl.h33
2 files changed, 30 insertions, 11 deletions
diff --git a/src/render/gl.cc b/src/render/gl.cc
index ebba733..e416943 100644
--- a/src/render/gl.cc
+++ b/src/render/gl.cc
@@ -14,10 +14,10 @@ using math::Vector2f;
using math::Vector3f;
using math::Color;
-genbuffers_func genbuffers = 0;
-deletebuffers_func deletebuffers = 0;
-bindbuffer_func bindbuffer = 0;
-bufferdata_func bufferdata = 0;
+genbuffers_func genbuffers = 0;
+deletebuffers_func deletebuffers = 0;
+bindbuffer_func bindbuffer = 0;
+bufferdata_func bufferdata = 0;
std::string renderer()
{
diff --git a/src/render/gl.h b/src/render/gl.h
index c230547..51e215c 100644
--- a/src/render/gl.h
+++ b/src/render/gl.h
@@ -20,35 +20,53 @@
#ifdef _WIN32
#ifndef GL_RESCALE_NORMAL
-#define GL_RESCALE_NORMAL 0x803A
+#define GL_RESCALE_NORMAL 0x803A
#endif
#ifndef GL_TEXTURE_MAX_LEVEL
-#define GL_TEXTURE_MAX_LEVEL 0x813D
+#define GL_TEXTURE_MAX_LEVEL 0x813D
#endif
#ifndef GL_GENERATE_MIPMAP
-#define GL_GENERATE_MIPMAP 0x8191
+#define GL_GENERATE_MIPMAP 0x8191
#endif
#ifndef GL_REFLECTION_MAP
-#define GL_REFLECTION_MAP 0x8512
+#define GL_REFLECTION_MAP 0x8512
#endif
#ifndef GL_CLAMP_TO_EDGE
-#define GL_CLAMP_TO_EDGE 0x812F
+#define GL_CLAMP_TO_EDGE 0x812F
#endif
#ifndef GL_ARRAY_BUFFER
-#define GL_ARRAY_BUFFER 0x8892
+#define GL_ARRAY_BUFFER 0x8892
#endif
#ifndef GL_STATIC_DRAW
-#define GL_STATIC_DRAW 0x88E4
+#define GL_STATIC_DRAW 0x88E4
#endif
#endif // _WIN32
+/*
+ * @brief wrapper class for OpenGL functions
+ * The gl class accesses the OpenGL library functions
+ * through function pointers.
+ * This allows loading the library at runtime
+ * and makes static builds possible
+ */
+/*
+class GL {
+
+private:
+ typedef void (* APIENTRY gl_genbuffers_func)(GLuint count, GLuint *id);
+ typedef void (* APIENTRY gl_deletebuffers_func)(GLuint count, GLuint *id);
+ typedef void (* APIENTRY gl_bindbuffer_func)(GLenum target, GLuint id);
+ typedef void (* APIENTRY gl_bufferdata_func)(GLenum target, GLsizei size, const GLvoid *data, GLenum usage);
+
+}
+*/
/// wrapper namespace for OpenGL operations
/** The gl namespace provides a wrapper to the OpenGL library functions.
* All methods take floats or Vector3f and Color as parameters.
@@ -83,6 +101,7 @@ void viewport(GLint x, GLint y, GLsizei width, GLsizei height);
/// set the color used to clear to buffer
void clearcolor(math::Color const &color);
+
void clearcolor(const float r, const float g, const float b, const float a);
/// clear buffers to preset values