[Scummvm-git-logs] scummvm master -> 6c2c603df2ccb3d8fa18d955424690aea87e651d
lephilousophe
noreply at scummvm.org
Sat Jul 16 08:00:19 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
6c2c603df2 OPENGL: Fix cast on Vertex Attribute pointer
Commit: 6c2c603df2ccb3d8fa18d955424690aea87e651d
https://github.com/scummvm/scummvm/commit/6c2c603df2ccb3d8fa18d955424690aea87e651d
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2022-07-16T09:57:42+02:00
Commit Message:
OPENGL: Fix cast on Vertex Attribute pointer
Changed paths:
graphics/opengl/shader.cpp
graphics/opengl/shader.h
diff --git a/graphics/opengl/shader.cpp b/graphics/opengl/shader.cpp
index 78155245ff8..ab308aa94f5 100644
--- a/graphics/opengl/shader.cpp
+++ b/graphics/opengl/shader.cpp
@@ -299,7 +299,7 @@ void Shader::use(bool forceReload) {
if (attrib._enabled) {
GL_CALL(glEnableVertexAttribArray(i));
GL_CALL(glBindBuffer(GL_ARRAY_BUFFER, attrib._vbo));
- GL_CALL(glVertexAttribPointer(i, attrib._size, attrib._type, attrib._normalized, attrib._stride, attrib._pointer));
+ GL_CALL(glVertexAttribPointer(i, attrib._size, attrib._type, attrib._normalized, attrib._stride, (const void *)attrib._pointer));
} else {
GL_CALL(glDisableVertexAttribArray(i));
switch (attrib._size) {
@@ -368,7 +368,7 @@ void Shader::enableVertexAttribute(const char *attrib, GLint size, GLenum type,
va._type = type;
va._normalized = normalized;
va._stride = stride;
- va._pointer = pointer;
+ va._pointer = (uintptr)pointer;
}
void Shader::enableVertexAttribute(const char *attrib, GLuint vbo, GLint size, GLenum type, GLboolean normalized, GLsizei stride, uint32 offset) {
@@ -379,7 +379,7 @@ void Shader::enableVertexAttribute(const char *attrib, GLuint vbo, GLint size, G
va._type = type;
va._normalized = normalized;
va._stride = stride;
- va._pointer = (const void *)(long)offset;
+ va._pointer = offset;
}
void Shader::disableVertexAttribute(const char *attrib, int size, const float *data) {
diff --git a/graphics/opengl/shader.h b/graphics/opengl/shader.h
index b1925bd0da8..26a2d3b5fae 100644
--- a/graphics/opengl/shader.h
+++ b/graphics/opengl/shader.h
@@ -40,7 +40,7 @@ namespace OpenGL {
struct VertexAttrib {
VertexAttrib(uint32 idx, const char *name) :
_enabled(false), _idx(idx), _name(name), _vbo(0), _size(0),
- _type(GL_FLOAT), _normalized(false), _stride(0), _pointer(nullptr) {}
+ _type(GL_FLOAT), _normalized(false), _stride(0), _pointer(0) {}
bool _enabled;
uint32 _idx;
Common::String _name;
@@ -49,7 +49,7 @@ struct VertexAttrib {
GLenum _type;
bool _normalized;
GLsizei _stride;
- const void *_pointer;
+ uintptr _pointer;
float _const[4];
};
More information about the Scummvm-git-logs
mailing list