From 7a5b8cc4b9f7343db13491941088c95c96833c18 Mon Sep 17 00:00:00 2001 From: Evan Goers Date: Mon, 26 Nov 2012 07:33:32 +0000 Subject: More gl::-ization. --- src/render/textures.cc | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/render/textures.cc') diff --git a/src/render/textures.cc b/src/render/textures.cc index ab490a6..e4bfe7f 100644 --- a/src/render/textures.cc +++ b/src/render/textures.cc @@ -251,14 +251,14 @@ void Textures::load_cubemap(const std::string & name) glBindTexture(GL_TEXTURE_CUBE_MAP, textures_cubemap_id); - glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + gl::texparameter(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + gl::texparameter(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); + gl::texparameter(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + gl::texparameter(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + gl::texparameter(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAX_LEVEL, 0); + gl::texparameter(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAX_LEVEL, 0); for (size_t i = 0; i < 6; i++) { if (cube_texture[i]) { @@ -322,10 +322,10 @@ size_t Textures::load(const std::string &name, const bool filter) if (filter) { // scaling functions - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + gl::texparameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + gl::texparameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // 4 levels of mipmaps - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 4); + gl::texparameter(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 4); if (r_mipmap->value()) { // hardware generated mipmaps (requires OpenGL 1.4) @@ -333,19 +333,19 @@ size_t Textures::load(const std::string &name, const bool filter) } // enable texture wrapping - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + gl::texparameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + gl::texparameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); } else { // scaling functions - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + gl::texparameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + gl::texparameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // no mipmaps, base level only - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); + gl::texparameter(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + gl::texparameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + gl::texparameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); } - //glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + //gl::texenv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); if (image->channels() == 4) { texture_format = GL_RGBA; -- cgit v1.2.3