From b7a269947f9b5e40e4baa36d763e5c04551f584c Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 5 Mar 2016 01:20:48 +0100 Subject: OPENGL: Flag texture dirty on allocation. --- backends/graphics/opengl/texture.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'backends/graphics/opengl') diff --git a/backends/graphics/opengl/texture.cpp b/backends/graphics/opengl/texture.cpp index 5252b5a32d..8b94549971 100644 --- a/backends/graphics/opengl/texture.cpp +++ b/backends/graphics/opengl/texture.cpp @@ -266,6 +266,12 @@ void Texture::allocate(uint width, uint height) { // Create a sub-buffer for raw access. _userPixelData = _textureData.getSubArea(Common::Rect(width, height)); + + // The whole texture is dirty after we changed the size. This fixes + // multiple texture size changes without any actual update in between. + // Without this we might try to write a too big texture into the GL + // texture. + flagDirty(); } void Texture::updateGLTexture() { @@ -561,6 +567,12 @@ void TextureCLUT8GPU::allocate(uint width, uint height) { _clut8Vertices[6] = width; _clut8Vertices[7] = height; + + // The whole texture is dirty after we changed the size. This fixes + // multiple texture size changes without any actual update in between. + // Without this we might try to write a too big texture into the GL + // texture. + flagDirty(); } Graphics::PixelFormat TextureCLUT8GPU::getFormat() const { -- cgit v1.2.3