From 204700ff7e2e45ecc4ce50582988c014626b0dfe Mon Sep 17 00:00:00 2001 From: Leith Bade Date: Tue, 2 Dec 2014 02:29:07 +1100 Subject: [PATCH] Stop mipmap allocation for textures --- src/geometry/glyph_atlas.cpp | 1 + src/geometry/sprite_atlas.cpp | 1 + src/renderer/prerendered_texture.cpp | 1 + src/util/raster.cpp | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/geometry/glyph_atlas.cpp b/src/geometry/glyph_atlas.cpp index 50bda5dc4..abfde0a55 100644 --- a/src/geometry/glyph_atlas.cpp +++ b/src/geometry/glyph_atlas.cpp @@ -143,6 +143,7 @@ void GlyphAtlas::bind() { if (!texture) { glGenTextures(1, &texture); glBindTexture(GL_TEXTURE_2D, texture); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); diff --git a/src/geometry/sprite_atlas.cpp b/src/geometry/sprite_atlas.cpp index d7ef1e789..cc832b242 100644 --- a/src/geometry/sprite_atlas.cpp +++ b/src/geometry/sprite_atlas.cpp @@ -201,6 +201,7 @@ void SpriteAtlas::bind(bool linear) { if (!texture) { glGenTextures(1, &texture); glBindTexture(GL_TEXTURE_2D, texture); + glTexParameteri(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); first = true; diff --git a/src/renderer/prerendered_texture.cpp b/src/renderer/prerendered_texture.cpp index c9507d602..8d727d351 100644 --- a/src/renderer/prerendered_texture.cpp +++ b/src/renderer/prerendered_texture.cpp @@ -37,6 +37,7 @@ void PrerenderedTexture::bindFramebuffer() { if (texture == 0) { glGenTextures(1, &texture); glBindTexture(GL_TEXTURE_2D, texture); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); diff --git a/src/util/raster.cpp b/src/util/raster.cpp index 4f6acc36c..40fb440fb 100644 --- a/src/util/raster.cpp +++ b/src/util/raster.cpp @@ -48,6 +48,7 @@ void Raster::bind(bool linear) { if (img && !textured) { texture = texturepool.getTextureID(); glBindTexture(GL_TEXTURE_2D, texture); + glTexParameteri(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); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, img->getData()); @@ -101,4 +102,3 @@ void Raster::updateTransitions(timestamp now) { fade_transition = nullptr; } } -