diff options
author | Evan Goers <mega@osirion.org> | 2012-11-26 06:29:34 +0000 |
---|---|---|
committer | Evan Goers <mega@osirion.org> | 2012-11-26 06:29:34 +0000 |
commit | a3a57df0be5c9d1d4ebbd153cabadbca48d16e79 (patch) | |
tree | c745f693d46e4f966e9ebc478bf09da795144c2e /src/render/gl.cc | |
parent | bc8fb513b967d9c4eaa5f478e112c7f479093bbf (diff) |
Abstracted many more GL functions.
Added in useful texture unit info to State::init().
Cleaned up many non-abstracted GL functions used in draw.cc and state.cc.
Diffstat (limited to 'src/render/gl.cc')
-rw-r--r-- | src/render/gl.cc | 134 |
1 files changed, 132 insertions, 2 deletions
diff --git a/src/render/gl.cc b/src/render/gl.cc index 48b9b52..8debb8e 100644 --- a/src/render/gl.cc +++ b/src/render/gl.cc @@ -104,6 +104,16 @@ void disable(GLenum cap) ::glDisable(cap); } +void enableclientstate(GLenum cap) +{ + glEnableClientState(cap); +} + +void disableclientstate(GLenum cap) +{ + glDisableClientState(cap); +} + void clear(GLbitfield mask) { glClear(mask); @@ -193,6 +203,26 @@ void texcoord(const float x, const float y, const float z) glTexCoord3f(x, y, z); } +void texcoordpointer(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer) +{ + glTexCoordPointer(size, type, stride, pointer); +} + +void normalpointer(GLenum type, GLsizei stride, const GLvoid* pointer) +{ + glNormalPointer(type, stride, pointer); +} + +void vertexpointer(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer) +{ + glVertexPointer(size, type, stride, pointer); +} + +void interleavedarrays(GLenum format, GLsizei stride, const GLvoid* pointer) +{ + glInterleavedArrays(format, stride, pointer); +} + void push() { glPushMatrix(); @@ -243,15 +273,115 @@ void frustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdou glFrustum(left, right, bottom, top, znear, zfar); } -void texgeni(GLenum coord, GLenum param, GLenum value) +void lightmodel(GLenum pname, GLfloat param) +{ + glLightModelf(pname, param); +} + +void lightmodel(GLenum pname, GLint param) +{ + glLightModeli(pname, param); +} + +void lightmodel(GLenum pname, const GLfloat* param) +{ + glLightModelfv(pname, param); +} + +void lightmodel(GLenum pname, const GLint* param) +{ + glLightModeliv(pname, param); +} + +void polygonmode(GLenum face, GLenum mode) +{ + glPolygonMode(face, mode); +} + +void colormaterial(GLenum face, GLenum mode) +{ + glColorMaterial(face, mode); +} + +void material(GLenum face, GLenum pname, GLfloat param) +{ + glMaterialf(face, pname, param); +} + +void material(GLenum face, GLenum pname, GLint param) +{ + glMateriali(face, pname, param); +} + +void material(GLenum face, GLenum pname, const GLfloat* param) +{ + glMaterialfv(face, pname, param); +} + +void material(GLenum face, GLenum pname, const GLint* param) +{ + glMaterialiv(face, pname, param); +} + +void texenv(GLenum target, GLenum pname, GLfloat param) +{ + glTexEnvf(target, pname, param); +} + +void texenv(GLenum target, GLenum pname, GLint param) +{ + glTexEnvi(target, pname, param); +} + +void texenv(GLenum target, GLenum pname, const GLfloat* param) +{ + glTexEnvfv(target, pname, param); +} + +void texenv(GLenum target, GLenum pname, const GLint* param) +{ + glTexEnviv(target, pname, param); +} + +void texgen(GLenum coord, GLenum param, GLint value) { glTexGeni(coord, param, value); } -void texgenfv(GLenum coord, GLenum param, const GLfloat* value) +void texgen(GLenum coord, GLenum param, GLfloat value) +{ + glTexGenf(coord, param, value); +} + +void texgen(GLenum coord, GLenum param, GLdouble value) +{ + glTexGend(coord, param, value); +} + +void texgen(GLenum coord, GLenum param, const GLint* value) +{ + glTexGeniv(coord, param, value); +} + +void texgen(GLenum coord, GLenum param, const GLfloat* value) { glTexGenfv(coord, param, value); } +void texgen(GLenum coord, GLenum param, const GLdouble* value) +{ + glTexGendv(coord, param, value); +} + +void activetexture(GLenum texture) +{ + glActiveTexture(texture); +} + +void clientactivetexture(GLenum texture) +{ + glClientActiveTexture(texture); +} + } // namespace gl |