From 7c9aa1c99ffe87ce331bd4bdc418090e89d6f46f Mon Sep 17 00:00:00 2001 From: cnr-isti-vclab Date: Fri, 23 Jan 2009 09:22:38 +0000 Subject: [PATCH] Crude, yet functional, custom attribute implementation --- wrap/gl/shaders.h | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/wrap/gl/shaders.h b/wrap/gl/shaders.h index 751db8ed..ffaf62bb 100644 --- a/wrap/gl/shaders.h +++ b/wrap/gl/shaders.h @@ -525,30 +525,16 @@ public: glProgramParameteriEXT(this->objectID, pname, value); } - void Attribute(const char * name, GLfloat x) + void Attribute(int index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { - const GLint loc = glGetAttribLocation(this->objectID, name); - glVertexAttrib1f(loc, x); + glVertexAttrib4f(index, x, y, z, w); } - void Attribute(const char * name, GLfloat x, GLfloat y) + void BindAttribute(int index, const char * name) { - const GLint loc = glGetAttribLocation(this->objectID, name); - glVertexAttrib2f(loc, x, y); + glBindAttribLocation(this->objectID, index, name); } - void Attribute(const char * name, GLfloat x, GLfloat y, GLfloat z) - { - const GLint loc = glGetAttribLocation(this->objectID, name); - glVertexAttrib3f(loc, x, y, z); - } - void Attribute(const char * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w) - { - const GLint loc = glGetAttribLocation(this->objectID, name); - glVertexAttrib4f(loc, x, y, z, w); - } - - protected: std::set shaders; bool linked;