diff options
author | Stijn Buys <ingar@osirion.org> | 2009-05-06 19:01:42 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2009-05-06 19:01:42 +0000 |
commit | 3dde787b2546958072e8a98350335b2bab6d1c17 (patch) | |
tree | 788ab92dcc575d83291baa33cd4698bf2be5a768 /src/render/textures.cc | |
parent | ada263d9924c9014b445d0b855f52f1ef75d39dd (diff) |
added r_mipmap variable to enable hardware generated mimaps
Diffstat (limited to 'src/render/textures.cc')
-rw-r--r-- | src/render/textures.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/render/textures.cc b/src/render/textures.cc index f5a5c62..5845bb6 100644 --- a/src/render/textures.cc +++ b/src/render/textures.cc @@ -6,6 +6,7 @@ #include <string.h> +#include "render/render.h" #include "render/gl.h" #include "render/image.h" #include "render/textures.h" @@ -176,7 +177,7 @@ size_t Textures::load(const std::string &name, const bool filter) // 4 levels of mipmaps glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 4); - if (State::has_generate_mipmaps()) { + if (r_mipmap->value()) { // hardware generated mipmaps (requires OpenGL 1.4) glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE); } @@ -197,12 +198,11 @@ size_t Textures::load(const std::string &name, const bool filter) texture_internalformat = GL_RGB8; } - if (filter && !State::has_generate_mipmaps()) { + if (filter && (r_mipmap->value() <= 0)) { gluBuild2DMipmaps(GL_TEXTURE_2D, texture_internalformat, image->width(), image->height(), texture_format, GL_UNSIGNED_BYTE, image->data()); } else { - glTexImage2D(GL_TEXTURE_2D, 0, texture_internalformat, image->width(), image->height(), 0, texture_format, GL_UNSIGNED_BYTE, image->data()); |