diff options
author | Johannes Schickel | 2016-03-04 15:32:14 +0100 |
---|---|---|
committer | Johannes Schickel | 2016-03-16 20:29:31 +0100 |
commit | 1e1272a8c4c54d43f076d5a0153db36ee8cbeb42 (patch) | |
tree | d10ed7037f784958137e77497eb59dc713d799e2 /backends/graphics/opengl | |
parent | 2b3340474e6b1c7bbf12923f86c39f1d4d9b245e (diff) | |
download | scummvm-rg350-1e1272a8c4c54d43f076d5a0153db36ee8cbeb42.tar.gz scummvm-rg350-1e1272a8c4c54d43f076d5a0153db36ee8cbeb42.tar.bz2 scummvm-rg350-1e1272a8c4c54d43f076d5a0153db36ee8cbeb42.zip |
OPENGL: Store logical texture dimensions in GLTexture.
Diffstat (limited to 'backends/graphics/opengl')
-rw-r--r-- | backends/graphics/opengl/texture.cpp | 6 | ||||
-rw-r--r-- | backends/graphics/opengl/texture.h | 18 |
2 files changed, 23 insertions, 1 deletions
diff --git a/backends/graphics/opengl/texture.cpp b/backends/graphics/opengl/texture.cpp index 79e3acc7c0..5252b5a32d 100644 --- a/backends/graphics/opengl/texture.cpp +++ b/backends/graphics/opengl/texture.cpp @@ -46,7 +46,8 @@ static GLuint nextHigher2(GLuint v) { GLTexture::GLTexture(GLenum glIntFormat, GLenum glFormat, GLenum glType) : _glIntFormat(glIntFormat), _glFormat(glFormat), _glType(glType), - _width(0), _height(0), _texCoords(), _glFilter(GL_NEAREST), + _width(0), _height(0), _logicalWidth(0), _logicalHeight(0), + _texCoords(), _glFilter(GL_NEAREST), _glTexture(0) { create(); } @@ -112,6 +113,9 @@ void GLTexture::setSize(uint width, uint height) { _height = height; } + _logicalWidth = width; + _logicalHeight = height; + // If a size is specified, allocate memory for it. if (width != 0 && height != 0) { const GLfloat texWidth = (GLfloat)width / _width; diff --git a/backends/graphics/opengl/texture.h b/backends/graphics/opengl/texture.h index 97e99b4b37..3be09cb9f9 100644 --- a/backends/graphics/opengl/texture.h +++ b/backends/graphics/opengl/texture.h @@ -99,10 +99,27 @@ public: */ void updateArea(const Common::Rect &area, const Graphics::Surface &src); + /** + * Query the GL texture's width. + */ uint getWidth() const { return _width; } + + /** + * Query the GL texture's height. + */ uint getHeight() const { return _height; } /** + * Query the logical texture's width. + */ + uint getLogicalWidth() const { return _logicalWidth; } + + /** + * Query the logical texture's height. + */ + uint getLogicalHeight() const { return _logicalHeight; } + + /** * Obtain texture coordinates for rectangular drawing. */ const GLfloat *getTexCoords() const { return _texCoords; } @@ -120,6 +137,7 @@ private: const GLenum _glType; uint _width, _height; + uint _logicalWidth, _logicalHeight; GLfloat _texCoords[4*2]; GLint _glFilter; |