From d584d29ac49182130d643c9221047e0acb5cfa01 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 30 Jan 2008 17:36:03 +0000 Subject: accomodate the new modules --- src/gl/osiriongl.cc | 233 ---------------------------------------------------- 1 file changed, 233 deletions(-) delete mode 100644 src/gl/osiriongl.cc (limited to 'src/gl/osiriongl.cc') diff --git a/src/gl/osiriongl.cc b/src/gl/osiriongl.cc deleted file mode 100644 index 08462e7..0000000 --- a/src/gl/osiriongl.cc +++ /dev/null @@ -1,233 +0,0 @@ -/* - gl/osiriongl.cc - This file is part of the Osirion project and is distributed under - the terms of the GNU General Public License version 2 -*/ - -#include "osiriongl.h" - -#include - -namespace gl -{ - -typedef void (APIENTRY *glBegin_func)(GLenum); -typedef void (APIENTRY *glEnd_func)(); -typedef void (APIENTRY *glViewport_func)(GLint, GLint, GLsizei, GLsizei); -typedef void (APIENTRY *glDepthMask_func)(GLenum); -typedef void (APIENTRY *glFrontFace_func)(GLenum); -typedef void (APIENTRY *glCullFace_func)(GLenum); -typedef void (APIENTRY *glShadeModel_func)(GLenum); -typedef void (APIENTRY *glEnable_func)(GLenum); -typedef void (APIENTRY *glDisable_func)(GLenum); -typedef void (APIENTRY *glBlendFunc_func)(GLenum, GLenum); -typedef void (APIENTRY *glClear_func)(GLbitfield); -typedef void (APIENTRY *glClearColor_func)(GLclampf, GLclampf, GLclampf,GLclampf); -typedef void (APIENTRY *glRotatef_func)(GLfloat, GLfloat, GLfloat, GLfloat); -typedef void (APIENTRY *glTranslatef_func)(GLfloat, GLfloat, GLfloat); -typedef void (APIENTRY *glScalef_func)(GLfloat, GLfloat, GLfloat); -typedef void (APIENTRY *glVertex3f_func)(GLfloat, GLfloat, GLfloat); -typedef void (APIENTRY *glPushMatrix_func)(); -typedef void (APIENTRY *glPopMatrix_func)(); -typedef void (APIENTRY *glColor4f_func)(GLfloat, GLfloat, GLfloat, GLfloat); -typedef void (APIENTRY *glMatrixMode_func)(GLenum); -typedef void (APIENTRY *glLoadIdentity_func)(); -typedef void (APIENTRY *glFrustum_func)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble); - -glBegin_func osglBegin = 0; -glEnd_func osglEnd = 0; -glViewport_func osglViewport = 0; -glDepthMask_func osglDepthMask = 0; -glFrontFace_func osglFrontFace = 0; -glCullFace_func osglCullFace = 0; -glShadeModel_func osglShadeModel = 0; -glEnable_func osglEnable = 0; -glDisable_func osglDisable = 0; -glBlendFunc_func osglBlendFunc = 0; -glClear_func osglClear = 0; -glClearColor_func osglClearColor = 0; -glRotatef_func osglRotatef = 0; -glTranslatef_func osglTranslatef = 0; -glScalef_func osglScalef = 0; -glVertex3f_func osglVertex3f = 0; -glPushMatrix_func osglPushMatrix = 0; -glPopMatrix_func osglPopMatrix = 0; -glColor4f_func osglColor4f = 0; -glMatrixMode_func osglMatrixMode = 0; -glLoadIdentity_func osglLoadIdentity = 0; -glFrustum_func osglFrustum = 0; - -// ------------- INITIALIZE FUNCTION POINTERS --------------// -void init() -{ - osglBegin = (glBegin_func) SDL_GL_GetProcAddress("glBegin"); - osglEnd = (glEnd_func) SDL_GL_GetProcAddress("glEnd"); - osglViewport = (glViewport_func) SDL_GL_GetProcAddress("glViewport"); - osglDepthMask = (glDepthMask_func) SDL_GL_GetProcAddress("glDepthMask"); - osglFrontFace = (glFrontFace_func) SDL_GL_GetProcAddress("glFrontFace"); - osglCullFace = (glCullFace_func) SDL_GL_GetProcAddress("glCullFace"); - osglShadeModel = (glShadeModel_func) SDL_GL_GetProcAddress("glShadeModel"); - osglEnable = (glEnable_func) SDL_GL_GetProcAddress("glEnable"); - osglDisable = (glDisable_func) SDL_GL_GetProcAddress("glDisable"); - osglBlendFunc = (glBlendFunc_func ) SDL_GL_GetProcAddress("glBlendFunc"); - osglClear = (glClear_func) SDL_GL_GetProcAddress("glClear"); - osglClearColor = (glClearColor_func) SDL_GL_GetProcAddress("glClearColor"); - osglRotatef = (glRotatef_func) SDL_GL_GetProcAddress("glRotatef"); - osglTranslatef = (glTranslatef_func) SDL_GL_GetProcAddress("glTranslatef"); - osglScalef = (glScalef_func) SDL_GL_GetProcAddress("glScalef"); - osglVertex3f = (glVertex3f_func) SDL_GL_GetProcAddress("glVertex3f"); - osglPushMatrix = (glPushMatrix_func) SDL_GL_GetProcAddress("glPushMatrix"); - osglPopMatrix = (glPopMatrix_func) SDL_GL_GetProcAddress("glPopMatrix"); - osglColor4f = (glColor4f_func) SDL_GL_GetProcAddress("glColor4f"); - osglMatrixMode = (glMatrixMode_func) SDL_GL_GetProcAddress("glMatrixMode"); - osglLoadIdentity = (glLoadIdentity_func) SDL_GL_GetProcAddress("glLoadIdentity"); - osglFrustum = (glFrustum_func) SDL_GL_GetProcAddress("glFrustum"); -} - - -void shutdown() -{ - osglBegin = 0; - osglEnd = 0; - osglViewport = 0; - osglDepthMask = 0; - osglFrontFace = 0; - osglCullFace = 0; - osglShadeModel = 0; - osglEnable = 0; - osglDisable = 0; - osglBlendFunc = 0; - osglClear = 0; - osglClearColor = 0; - osglRotatef = 0; - osglTranslatef = 0; - osglScalef = 0; - osglVertex3f = 0; - osglPushMatrix = 0; - osglPopMatrix = 0; - osglColor4f = 0; - osglMatrixMode = 0; - osglLoadIdentity = 0; -} - -void begin(Primitive primitive) { - osglBegin(primitive); -} - -void end() { - osglEnd(); -} - -void viewport(GLint x, GLint y, GLsizei width, GLsizei height) -{ - osglViewport(x, y, width, height); -} - -void depthmask(GLenum mode) -{ - osglDepthMask(mode); -} - - -void frontface(GLenum mode) -{ - osglFrontFace(mode); -} - -void cullface(GLenum mode) -{ - osglCullFace(mode); -} - -void shademodel(GLenum mode) -{ - osglShadeModel(mode); -} - -void blendfunc(GLenum sfactor, GLenum dfactor) -{ - osglBlendFunc(sfactor, dfactor); -} - -void enable(GLenum cap) -{ - osglEnable(cap); -} - -void disable(GLenum cap) -{ - osglDisable(cap); -} - -void clear (GLbitfield mask) { - osglClear(mask); -} - -void clearcolor(Color const & color) { - osglClearColor(color.red(), color.green(), color.blue(), color.alpha()); -} - -void clearcolor(const float r, const float g, const float b, const float a) { - osglClearColor(r,g,b, a); -} - -void rotate(const float angle, const Vector3f& vector) { - osglRotatef(angle, vector[0], vector[1], vector[2]); -} - -void rotate(const float angle, const float x, const float y, const float z) { - osglRotatef(angle, x, y, z); -} - -void translate(const Vector3f& vector) { - osglTranslatef(vector[0], vector[1], vector[2]); -} - -void translate(const float x, const float y, const float z) { - osglTranslatef(x, y, z); -} -void scale(const Vector3f& vector) { - osglScalef(vector[0], vector[1], vector[2]); -} - -void scale(const float x, const float y, const float z) { - osglScalef(x, y, z); -} - -void vertex(const Vector3f& vector) { - osglVertex3f(vector[0], vector[1], vector[2]); -} - -void vertex(const float x, const float y, const float z) { - osglVertex3f(x, y, z); -} - -void push() { - osglPushMatrix(); -} - -void pop() { - osglPopMatrix(); -} - -void color(const float r, const float g, const float b, const float a) { - osglColor4f(r,g,b,a); -} -void color(Color const & color) { - osglColor4f(color.red(), color.green(), color.blue(), color.alpha()); -} - -void matrixmode(GLenum mode) { - osglMatrixMode(mode); -} - -void loadidentity() { - osglLoadIdentity(); -} - -void frustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble znear, GLdouble zfar) -{ - osglFrustum(left, right, bottom, top, znear, zfar); -} - -} // namespace gl -- cgit v1.2.3