diff options
author | Evan Goers <mega@osirion.org> | 2012-01-21 03:28:48 +0000 |
---|---|---|
committer | Evan Goers <mega@osirion.org> | 2012-01-21 03:28:48 +0000 |
commit | 2d564f92743fa59a7fc8903f9afb3f8344ef2f85 (patch) | |
tree | 5d5d744b5a1a281d893684eb89a53276dc3064b8 /src/render | |
parent | d702c133c06cd9626430263292df69b092954c5f (diff) |
gl::'d polygonoffset and alphafunc.
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/gl.cc | 10 | ||||
-rw-r--r-- | src/render/gl.h | 6 | ||||
-rw-r--r-- | src/render/state.cc | 4 |
3 files changed, 18 insertions, 2 deletions
diff --git a/src/render/gl.cc b/src/render/gl.cc index e416943..3c672cd 100644 --- a/src/render/gl.cc +++ b/src/render/gl.cc @@ -84,6 +84,16 @@ void blendfunc(GLenum sfactor, GLenum dfactor) ::glBlendFunc(sfactor, dfactor); } +void alphafunc(GLenum func, GLclampf ref) +{ + ::glAlphaFunc(func, ref); +} + +void polygonoffset(GLfloat factor, GLfloat units) +{ + ::glPolygonOffset(factor, units); +} + void enable(GLenum cap) { ::glEnable(cap); diff --git a/src/render/gl.h b/src/render/gl.h index 7270f2d..31609ad 100644 --- a/src/render/gl.h +++ b/src/render/gl.h @@ -134,6 +134,12 @@ void depthfunc(GLenum func); /// glBlendFunc void blendfunc(GLenum sfactor, GLenum dfactor); +/// glAlphaFunc +void alphafunc(GLenum func, GLclampf ref); + +/// glPolygonOffset +void polygonoffset(GLfloat factor, GLfloat units); + /// Delimite the start of a sequence of verteces describing a primitive or group of primitives /** @param primitive The type of drawing primitive * @see end() diff --git a/src/render/state.cc b/src/render/state.cc index ffff7e3..dcf62f3 100644 --- a/src/render/state.cc +++ b/src/render/state.cc @@ -224,8 +224,8 @@ void State::use_material(const model::Material * material) { if (material->flags() & model::Material::Decal) { gl::enable(GL_POLYGON_OFFSET_FILL); gl::enable(GL_ALPHA_TEST); - glPolygonOffset(-1,-1); - glAlphaFunc(GL_GEQUAL, 0.5f); + gl::polygonoffset(-1,-1); + gl::alphafunc(GL_GEQUAL, 0.5f); } // assign the opengl drawing color according to material flags |