summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/defaults.cpp1
-rw-r--r--src/gui/setup_perfomance.cpp3
-rw-r--r--src/opengl1graphics.cpp10
-rw-r--r--src/openglgraphics.cpp11
4 files changed, 17 insertions, 8 deletions
diff --git a/src/defaults.cpp b/src/defaults.cpp
index 71d190a00..fb461727e 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -252,6 +252,7 @@ DefaultsData* getConfigDefaults()
AddDEF(configData, "repeateDelay", SDL_DEFAULT_REPEAT_DELAY);
AddDEF(configData, "repeateInterval", SDL_DEFAULT_REPEAT_INTERVAL);
AddDEF(configData, "compresstextures", false);
+ AddDEF(configData, "rectangulartextures", true);
return configData;
}
diff --git a/src/gui/setup_perfomance.cpp b/src/gui/setup_perfomance.cpp
index 865839c52..285c2baab 100644
--- a/src/gui/setup_perfomance.cpp
+++ b/src/gui/setup_perfomance.cpp
@@ -96,6 +96,9 @@ Setup_Perfomance::Setup_Perfomance()
new SetupItemCheckBox(_("Enable texture compression (fast OpenGL)"), "",
"compresstextures", this, "compresstexturesEvent");
+ new SetupItemCheckBox(_("Enable rectangular texture extension (OpenGL)"), "",
+ "rectangulartextures", this, "rectangulartexturesEvent");
+
setDimension(gcn::Rectangle(0, 0, 550, 350));
}
diff --git a/src/opengl1graphics.cpp b/src/opengl1graphics.cpp
index 8563ab0d2..ae46846c9 100644
--- a/src/opengl1graphics.cpp
+++ b/src/opengl1graphics.cpp
@@ -125,20 +125,22 @@ bool OpenGL1Graphics::setVideoMode(int w, int h, int bpp, bool fs,
GLint texSize;
bool rectTex = strstr(glExtensions, "GL_ARB_texture_rectangle");
- if (rectTex)
+ if (rectTex && config.getBoolValue("rectangulartextures"))
{
logger->log1("using GL_ARB_texture_rectangle");
Image::mTextureType = GL_TEXTURE_RECTANGLE_ARB;
glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB, &texSize);
+ Image::mTextureSize = texSize;
+ logger->log("OpenGL texture size: %d pixels (rectangle textures)",
+ Image::mTextureSize);
}
else
{
Image::mTextureType = GL_TEXTURE_2D;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &texSize);
+ Image::mTextureSize = texSize;
+ logger->log("OpenGL texture size: %d pixels", Image::mTextureSize);
}
- Image::mTextureSize = texSize;
- logger->log("OpenGL texture size: %d pixels%s", Image::mTextureSize,
- rectTex ? " (rectangle textures)" : "");
return true;
}
diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp
index 6e0bbf829..5d0410f33 100644
--- a/src/openglgraphics.cpp
+++ b/src/openglgraphics.cpp
@@ -155,20 +155,23 @@ bool OpenGLGraphics::setVideoMode(int w, int h, int bpp, bool fs,
GLint texSize;
bool rectTex = supportExtension("GL_ARB_texture_rectangle");
- if (rectTex && Image::getInternalTextureType() == 4)
+ if (rectTex && Image::getInternalTextureType() == 4
+ && config.getBoolValue("rectangulartextures"))
{
logger->log1("using GL_ARB_texture_rectangle");
Image::mTextureType = GL_TEXTURE_RECTANGLE_ARB;
glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB, &texSize);
+ Image::mTextureSize = texSize;
+ logger->log("OpenGL texture size: %d pixels (rectangle textures)",
+ Image::mTextureSize);
}
else
{
Image::mTextureType = GL_TEXTURE_2D;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &texSize);
+ Image::mTextureSize = texSize;
+ logger->log("OpenGL texture size: %d pixels", Image::mTextureSize);
}
- Image::mTextureSize = texSize;
- logger->log("OpenGL texture size: %d pixels%s", Image::mTextureSize,
- rectTex ? " (rectangle textures)" : "");
return true;
}