From 2d564f92743fa59a7fc8903f9afb3f8344ef2f85 Mon Sep 17 00:00:00 2001 From: Evan Goers Date: Sat, 21 Jan 2012 03:28:48 +0000 Subject: gl::'d polygonoffset and alphafunc. --- src/render/gl.cc | 10 ++++++++++ src/render/gl.h | 6 ++++++ src/render/state.cc | 4 ++-- 3 files changed, 18 insertions(+), 2 deletions(-) (limited to 'src/render') 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 -- cgit v1.2.3