Last active
November 21, 2015 22:58
-
-
Save GilesBathgate/a8b1e547fc24a19e677b to your computer and use it in GitHub Desktop.
GLWrapper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "glwrapper.h" | |
GLWrapper* GLWrapper::instance=NULL; | |
extern "C" { | |
GLvoid Q_DECL_EXPORT glClear(GLbitfield mask) | |
{ | |
GLWrapper::getInstance()->glClear(mask); | |
} | |
GLvoid Q_DECL_EXPORT glClearColor(GLclampf red,GLclampf green,GLclampf blue,GLclampf alpha) | |
{ | |
GLWrapper::getInstance()->glClearColor(red,green,blue,alpha); | |
} | |
GLvoid Q_DECL_EXPORT glEnable(GLenum cap) | |
{ | |
GLWrapper::getInstance()->glEnable(cap); | |
} | |
GLvoid Q_DECL_EXPORT glMatrixMode(GLenum mode) | |
{ | |
GLWrapper::getInstance()->glMatrixMode(mode); | |
} | |
GLvoid Q_DECL_EXPORT glLightfv(GLenum light,GLenum pname,const GLfloat* params) | |
{ | |
GLWrapper::getInstance()->glLightfv(light,pname,params); | |
} | |
GLvoid Q_DECL_EXPORT glLoadIdentity() | |
{ | |
GLWrapper::getInstance()->glLoadIdentity(); | |
} | |
GLvoid Q_DECL_EXPORT glRotatef(GLfloat a, GLfloat x,GLfloat y,GLfloat z) | |
{ | |
GLWrapper::getInstance()->glRotatef(a,x,y,z); | |
} | |
GLvoid Q_DECL_EXPORT glViewport(GLint x,GLint y,GLsizei width,GLsizei height) | |
{ | |
GLWrapper::getInstance()->glViewport(x,y,width,height); | |
} | |
GLvoid Q_DECL_EXPORT glLineWidth(GLfloat width) | |
{ | |
GLWrapper::getInstance()->glLineWidth(width); | |
} | |
GLvoid Q_DECL_EXPORT glVertex3i(GLint x, GLint y, GLint z) | |
{ | |
GLWrapper::getInstance()->glVertex3i(x,y,z); | |
} | |
GLvoid Q_DECL_EXPORT glColor3f(GLfloat red,GLfloat green,GLfloat blue) | |
{ | |
GLWrapper::getInstance()->glColor3f(red,green,blue); | |
} | |
GLvoid Q_DECL_EXPORT glVertex3f(GLfloat x,GLfloat y,GLfloat z) | |
{ | |
GLWrapper::getInstance()->glVertex3f(x,y,z); | |
} | |
GLvoid Q_DECL_EXPORT glBegin(GLenum mode) | |
{ | |
GLWrapper::getInstance()->glBegin(mode); | |
} | |
GLvoid Q_DECL_EXPORT glEnd() | |
{ | |
GLWrapper::getInstance()->glEnd(); | |
} | |
GLvoid Q_DECL_EXPORT glColorMaterial(GLenum face,GLenum mode) | |
{ | |
GLWrapper::getInstance()->glColorMaterial(face,mode); | |
} | |
GLvoid Q_DECL_EXPORT glCallList(GLuint list) | |
{ | |
GLWrapper::getInstance()->glCallList(list); | |
} | |
GLvoid Q_DECL_EXPORT glDisable(GLenum cap) | |
{ | |
GLWrapper::getInstance()->glDisable(cap); | |
} | |
GLuint Q_DECL_EXPORT glGenLists(GLsizei range) | |
{ | |
return GLWrapper::getInstance()->glGenLists(range); | |
} | |
GLvoid Q_DECL_EXPORT glNewList(GLuint list,GLenum mode) | |
{ | |
GLWrapper::getInstance()->glNewList(list,mode); | |
} | |
GLvoid Q_DECL_EXPORT glPointSize(GLfloat size) | |
{ | |
GLWrapper::getInstance()->glPointSize(size); | |
} | |
GLvoid Q_DECL_EXPORT glColor3ub(GLubyte red,GLubyte green,GLubyte blue) | |
{ | |
GLWrapper::getInstance()->glColor3ub(red,green,blue); | |
} | |
GLvoid Q_DECL_EXPORT glEndList() | |
{ | |
GLWrapper::getInstance()->glEndList(); | |
} | |
GLvoid Q_DECL_EXPORT glDeleteLists(GLuint list,GLsizei range) | |
{ | |
GLWrapper::getInstance()->glDeleteLists(list,range); | |
} | |
GLvoid Q_DECL_EXPORT glNormal3fv(const GLfloat* v) | |
{ | |
GLWrapper::getInstance()->glNormal3fv(v); | |
} | |
GLvoid Q_DECL_EXPORT glVertex3fv(const GLfloat* v) | |
{ | |
GLWrapper::getInstance()->glVertex3fv(v); | |
} | |
GLvoid Q_DECL_EXPORT glScalef(GLfloat x,GLfloat y,GLfloat z) | |
{ | |
GLWrapper::getInstance()->glScalef(x,y,z); | |
} | |
GLvoid Q_DECL_EXPORT glTranslatef(GLfloat x,GLfloat y,GLfloat z) | |
{ | |
GLWrapper::getInstance()->glTranslatef(x,y,z); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef GLWRAPPER_H | |
#define GLWRAPPER_H | |
#include "mingl.h" | |
#include <QOpenGLFunctions_1_0> | |
class GLWrapper : public QOpenGLFunctions_1_0 | |
{ | |
public: | |
static GLWrapper* getInstance() { if(!instance) instance=new GLWrapper(); return instance; } | |
private: | |
GLWrapper() { this->initializeOpenGLFunctions(); } | |
static GLWrapper* instance; | |
}; | |
#endif // GLWRAPPER_H |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __gl_h_ | |
#ifndef __GL_H__ | |
#define __gl_h_ | |
#define __GL_H__ | |
#include <QtCore/qglobal.h> | |
#ifdef __cplusplus | |
extern "C" { | |
#endif | |
typedef unsigned int GLenum; | |
typedef unsigned char GLboolean; | |
typedef unsigned int GLbitfield; | |
typedef signed char GLbyte; | |
typedef short GLshort; | |
typedef int GLint; | |
typedef int GLsizei; | |
typedef unsigned char GLubyte; | |
typedef unsigned short GLushort; | |
typedef unsigned int GLuint; | |
typedef float GLfloat; | |
typedef float GLclampf; | |
typedef double GLdouble; | |
typedef double GLclampd; | |
typedef void GLvoid; | |
GLvoid Q_DECL_EXPORT glClear(GLbitfield mask); | |
GLvoid Q_DECL_EXPORT glClearColor(GLclampf red,GLclampf green,GLclampf blue,GLclampf alpha); | |
GLvoid Q_DECL_EXPORT glEnable(GLenum cap); | |
GLvoid Q_DECL_EXPORT glMatrixMode(GLenum mode); | |
GLvoid Q_DECL_EXPORT glLightfv(GLenum light,GLenum pname,const GLfloat* params); | |
GLvoid Q_DECL_EXPORT glLoadIdentity(); | |
GLvoid Q_DECL_EXPORT glRotatef(GLfloat a, GLfloat x,GLfloat y,GLfloat z); | |
GLvoid Q_DECL_EXPORT glViewport(GLint x,GLint y,GLsizei width,GLsizei height); | |
GLvoid Q_DECL_EXPORT glLineWidth(GLfloat width); | |
GLvoid Q_DECL_EXPORT glVertex3i(GLint x, GLint y, GLint z); | |
GLvoid Q_DECL_EXPORT glColor3f(GLfloat red,GLfloat green,GLfloat blue); | |
GLvoid Q_DECL_EXPORT glVertex3f(GLfloat x,GLfloat y,GLfloat z); | |
GLvoid Q_DECL_EXPORT glBegin(GLenum mode); | |
GLvoid Q_DECL_EXPORT glEnd(); | |
GLvoid Q_DECL_EXPORT glColorMaterial(GLenum face,GLenum mode); | |
GLvoid Q_DECL_EXPORT glCallList(GLuint list); | |
GLvoid Q_DECL_EXPORT glDisable(GLenum cap); | |
GLuint Q_DECL_EXPORT glGenLists(GLsizei range); | |
GLvoid Q_DECL_EXPORT glNewList(GLuint list,GLenum mode); | |
GLvoid Q_DECL_EXPORT glPointSize(GLfloat size); | |
GLvoid Q_DECL_EXPORT glColor3ub(GLubyte red,GLubyte green,GLubyte blue); | |
GLvoid Q_DECL_EXPORT glEndList(); | |
GLvoid Q_DECL_EXPORT glDeleteLists(GLuint list,GLsizei range); | |
GLvoid Q_DECL_EXPORT glNormal3fv(const GLfloat* v); | |
GLvoid Q_DECL_EXPORT glVertex3fv(const GLfloat* v); | |
GLvoid Q_DECL_EXPORT glScalef(GLfloat x,GLfloat y,GLfloat z); | |
GLvoid Q_DECL_EXPORT glTranslatef(GLfloat x,GLfloat y,GLfloat z); | |
#ifdef __cplusplus | |
} | |
#endif | |
#endif /* __GL_H__ */ | |
#endif /* __gl_h_ */ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment