diff options
author | Johannes Schickel | 2014-02-12 17:15:07 +0100 |
---|---|---|
committer | Johannes Schickel | 2014-02-12 17:15:07 +0100 |
commit | 1709486859db9c38f5e4287e3e7fa817f76c1ee7 (patch) | |
tree | 4f565b09c037a47b9578d850435616ae4dd4f1b2 | |
parent | 49dcd36e72889b3edb67ce098af7cb854e499cb8 (diff) | |
download | scummvm-rg350-1709486859db9c38f5e4287e3e7fa817f76c1ee7.tar.gz scummvm-rg350-1709486859db9c38f5e4287e3e7fa817f76c1ee7.tar.bz2 scummvm-rg350-1709486859db9c38f5e4287e3e7fa817f76c1ee7.zip |
OPENGL: Use GLfloat for draw cooridnates in Texture.
-rw-r--r-- | backends/graphics/opengl/texture.cpp | 14 | ||||
-rw-r--r-- | backends/graphics/opengl/texture.h | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/backends/graphics/opengl/texture.cpp b/backends/graphics/opengl/texture.cpp index dff483dc0d..7b0b22d630 100644 --- a/backends/graphics/opengl/texture.cpp +++ b/backends/graphics/opengl/texture.cpp @@ -166,7 +166,7 @@ void Texture::fill(uint32 color) { flagDirty(); } -void Texture::draw(GLuint x, GLuint y, GLuint w, GLuint h) { +void Texture::draw(GLfloat x, GLfloat y, GLfloat w, GLfloat h) { // Only do any processing when the Texture is initialized. if (!_textureData.getPixels()) { return; @@ -190,13 +190,13 @@ void Texture::draw(GLuint x, GLuint y, GLuint w, GLuint h) { GLCALL(glTexCoordPointer(2, GL_FLOAT, 0, texcoords)); // Calculate the screen rect where the texture will be drawn. - const GLshort vertices[4*2] = { - (GLshort)x, (GLshort)y, - (GLshort)(x + w), (GLshort)y, - (GLshort)x, (GLshort)(y + h), - (GLshort)(x + w), (GLshort)(y + h) + const GLfloat vertices[4*2] = { + x, y, + x + w, y, + x, y + h, + x + w, y + h }; - GLCALL(glVertexPointer(2, GL_SHORT, 0, vertices)); + GLCALL(glVertexPointer(2, GL_FLOAT, 0, vertices)); // Draw the texture to the screen buffer. GLCALL(glDrawArrays(GL_TRIANGLE_STRIP, 0, 4)); diff --git a/backends/graphics/opengl/texture.h b/backends/graphics/opengl/texture.h index e28d980de4..ad70833544 100644 --- a/backends/graphics/opengl/texture.h +++ b/backends/graphics/opengl/texture.h @@ -79,7 +79,7 @@ public: void fill(uint32 color); - void draw(GLuint x, GLuint y, GLuint w, GLuint h); + void draw(GLfloat x, GLfloat y, GLfloat w, GLfloat h); void flagDirty() { _allDirty = true; } bool isDirty() const { return _allDirty || !_dirtyArea.isEmpty(); } |