GRAPHICS: Revert "GRAPHICS: Add support for integer shader attributes"

This is not supported in OpenGL 2.1

This reverts commit a081bbfdc3844a11463baf190acb6d9dd884f1ae.
This commit is contained in:
Bastien Bouclet 2015-02-21 12:42:05 +01:00
parent 030cc7794c
commit a72d415793
2 changed files with 2 additions and 20 deletions

View file

@ -170,11 +170,7 @@ void Shader::use(bool forceReload) {
if (attrib._enabled) {
glEnableVertexAttribArray(i);
glBindBuffer(GL_ARRAY_BUFFER, attrib._vbo);
if (attrib._integer) {
glVertexAttribIPointer(i, attrib._size, attrib._type, attrib._stride, (const GLvoid *)attrib._offset);
} else {
glVertexAttribPointer(i, attrib._size, attrib._type, attrib._normalized, attrib._stride, (const GLvoid *)attrib._offset);
}
glVertexAttribPointer(i, attrib._size, attrib._type, attrib._normalized, attrib._stride, (const GLvoid *)attrib._offset);
} else {
glDisableVertexAttribArray(i);
switch (attrib._size) {
@ -220,7 +216,6 @@ VertexAttrib &Shader::getAttribute(const char *attrib) {
void Shader::enableVertexAttribute(const char *attrib, GLuint vbo, GLint size, GLenum type, GLboolean normalized, GLsizei stride, uint32 offset) {
VertexAttrib &va = getAttribute(attrib);
va._enabled = true;
va._integer = false;
va._vbo = vbo;
va._size = size;
va._type = type;
@ -229,17 +224,6 @@ void Shader::enableVertexAttribute(const char *attrib, GLuint vbo, GLint size, G
va._offset = offset;
}
void Shader::enableIntegerVertexAttribute(const char *attrib, GLuint vbo, GLint size, GLenum type, GLsizei stride, uint32 offset) {
VertexAttrib &va = getAttribute(attrib);
va._enabled = true;
va._integer = true;
va._vbo = vbo;
va._size = size;
va._type = type;
va._stride = stride;
va._offset = offset;
}
void Shader::disableVertexAttribute(const char *attrib, int size, const float *data) {
VertexAttrib &va = getAttribute(attrib);
va._enabled = false;

View file

@ -45,10 +45,9 @@ namespace BuiltinShaders {
struct VertexAttrib {
VertexAttrib(uint32 idx, const char *name) :
_enabled(false), _integer(false), _idx(idx), _name(name), _vbo(0), _size(0),
_enabled(false), _idx(idx), _name(name), _vbo(0), _size(0),
_type(GL_FLOAT), _normalized(false), _stride(0), _offset(0) {}
bool _enabled;
bool _integer;
uint32 _idx;
Common::String _name;
GLuint _vbo;
@ -126,7 +125,6 @@ public:
}
void enableVertexAttribute(const char *attrib, GLuint vbo, GLint size, GLenum type, GLboolean normalized, GLsizei stride, uint32 offset);
void enableIntegerVertexAttribute(const char *attrib, GLuint vbo, GLint size, GLenum type, GLsizei stride, uint32 offset);
void disableVertexAttribute(const char *attrib, int size, const float *data);
template <int r>
void disableVertexAttribute(const char *attrib, const Math::Matrix<r,1> &m) {