From 8627c9567803ae4593ebc441aaefe650100bef0d Mon Sep 17 00:00:00 2001 From: cnr-isti-vclab Date: Mon, 12 Jan 2009 13:57:48 +0000 Subject: [PATCH] Added Attribute support --- wrap/gl/shaders.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/wrap/gl/shaders.h b/wrap/gl/shaders.h index 53f40ac5..751db8ed 100644 --- a/wrap/gl/shaders.h +++ b/wrap/gl/shaders.h @@ -525,6 +525,29 @@ public: glProgramParameteriEXT(this->objectID, pname, value); } + void Attribute(const char * name, GLfloat x) + { + const GLint loc = glGetAttribLocation(this->objectID, name); + glVertexAttrib1f(loc, x); + } + + void Attribute(const char * name, GLfloat x, GLfloat y) + { + const GLint loc = glGetAttribLocation(this->objectID, name); + glVertexAttrib2f(loc, x, y); + } + + 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;