diff options
author | Stijn Buys <ingar@osirion.org> | 2008-01-30 17:36:03 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-01-30 17:36:03 +0000 |
commit | d584d29ac49182130d643c9221047e0acb5cfa01 (patch) | |
tree | 06f23cb1cae0a1945e88ea7f19ad80394cb35d6b /src/gl/gllib.cc | |
parent | bac8343bbc9f1e4cf97a561c732054539f21f03d (diff) |
accomodate the new modules
Diffstat (limited to 'src/gl/gllib.cc')
-rw-r--r-- | src/gl/gllib.cc | 151 |
1 files changed, 151 insertions, 0 deletions
diff --git a/src/gl/gllib.cc b/src/gl/gllib.cc new file mode 100644 index 0000000..32aa55e --- /dev/null +++ b/src/gl/gllib.cc @@ -0,0 +1,151 @@ +/* + gl/gllib.cc + This file is part of the Osirion project and is distributed under + the terms of the GNU General Public License version 2 +*/ + +// project includes +#include "gl/gllib.h" +#include "common/common.h" + +// system includes +#include "GL/gl.h" + +using math::Vector3f; +using math::Color; + +namespace gl +{ + +void init() +{ + con_debug << "Initiliazing gl..." << std::endl; +} + +void shutdown() +{ + con_debug << "Shutting down gl..." << std::endl; +} + +void begin(Primitive primitive) { + glBegin(primitive); +} + +void end() { + glEnd(); +} + +void viewport(GLint x, GLint y, GLsizei width, GLsizei height) +{ + glViewport(x, y, width, height); +} + +void depthmask(GLenum mode) +{ + glDepthMask(mode); +} + + +void frontface(GLenum mode) +{ + glFrontFace(mode); +} + +void cullface(GLenum mode) +{ + glCullFace(mode); +} + +void shademodel(GLenum mode) +{ + glShadeModel(mode); +} + +void blendfunc(GLenum sfactor, GLenum dfactor) +{ + glBlendFunc(sfactor, dfactor); +} + +void enable(GLenum cap) +{ + glEnable(cap); +} + +void disable(GLenum cap) +{ + glDisable(cap); +} + +void clear (GLbitfield mask) { + glClear(mask); +} + +void clearcolor(Color const & color) { + glClearColor(color.red(), color.green(), color.blue(), color.alpha()); +} + +void clearcolor(const float r, const float g, const float b, const float a) { + glClearColor(r,g,b, a); +} + +void rotate(const float angle, const Vector3f& vector) { + glRotatef(angle, vector[0], vector[1], vector[2]); +} + +void rotate(const float angle, const float x, const float y, const float z) { + glRotatef(angle, x, y, z); +} + +void translate(const Vector3f& vector) { + glTranslatef(vector[0], vector[1], vector[2]); +} + +void translate(const float x, const float y, const float z) { + glTranslatef(x, y, z); +} +void scale(const Vector3f& vector) { + glScalef(vector[0], vector[1], vector[2]); +} + +void scale(const float x, const float y, const float z) { + glScalef(x, y, z); +} + +void vertex(const Vector3f& vector) { + glVertex3f(vector[0], vector[1], vector[2]); +} + +void vertex(const float x, const float y, const float z) { + glVertex3f(x, y, z); +} + +void push() { + glPushMatrix(); +} + +void pop() { + glPopMatrix(); +} + +void color(const float r, const float g, const float b, const float a) { + glColor4f(r,g,b,a); +} +void color(Color const & color) { + glColor4f(color.red(), color.green(), color.blue(), color.alpha()); +} + +void matrixmode(GLenum mode) { + glMatrixMode(mode); +} + +void loadidentity() { + glLoadIdentity(); +} + +void frustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble znear, GLdouble zfar) +{ + glFrustum(left, right, bottom, top, znear, zfar); +} + +} // namespace gl + |