Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/textures.cc')
-rw-r--r--src/render/textures.cc6
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());