diff options
| author | Ray <raysan5@gmail.com> | 2018-12-18 16:52:18 +0100 |
|---|---|---|
| committer | Ray <raysan5@gmail.com> | 2018-12-18 16:52:18 +0100 |
| commit | db96cf4a8ba87f10c3f0bb1043f846f2233dba03 (patch) | |
| tree | 478de0bf34f1e6f57f5e9e4de64e507b5e8c0559 /src | |
| parent | 5a9e03fddf2feda74e01d054c037e42ac8c3b61b (diff) | |
| download | raylib-db96cf4a8ba87f10c3f0bb1043f846f2233dba03.tar.gz raylib-db96cf4a8ba87f10c3f0bb1043f846f2233dba03.zip | |
Corrected bug on OpenGL ES quads drawing
Diffstat (limited to 'src')
| -rw-r--r-- | src/rlgl.h | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -2647,13 +2647,11 @@ void *rlReadTexturePixels(Texture2D texture) glBindTexture(GL_TEXTURE_2D, texture.id); // NOTE: Using texture.id, we can retrieve some texture info (but not on OpenGL ES 2.0) - /* - int width, height, format; - glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width); - glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &height); - glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, &format); + //int width, height, format; + //glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width); + //glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &height); + //glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, &format); // Other texture info: GL_TEXTURE_RED_SIZE, GL_TEXTURE_GREEN_SIZE, GL_TEXTURE_BLUE_SIZE, GL_TEXTURE_ALPHA_SIZE - */ // NOTE: Each row written to or read from by OpenGL pixel operations like glGetTexImage are aligned to a 4 byte boundary by default, which may add some padding. // Use glPixelStorei to modify padding with the GL_[UN]PACK_ALIGNMENT setting. @@ -4044,7 +4042,7 @@ static void DrawBuffersDefault(void) // start of the index buffer to the location of the first index to process glDrawElements(GL_TRIANGLES, draws[i].vertexCount/4*6, GL_UNSIGNED_INT, (GLvoid *)(sizeof(GLuint)*vertexOffset/4*6)); #elif defined(GRAPHICS_API_OPENGL_ES2) - glDrawElements(GL_TRIANGLES, draws[i].vertexCount/4*6, GL_UNSIGNED_SHORT, (GLvoid *)(sizeof(GLuint)*vertexOffset/4*6)); + glDrawElements(GL_TRIANGLES, draws[i].vertexCount/4*6, GL_UNSIGNED_SHORT, (GLvoid *)(sizeof(GLushort)*vertexOffset/4*6)); #endif } |
