Added Attribute support

This commit is contained in:
Paolo Cignoni 2009-01-12 13:57:48 +00:00
parent abbf0d60ce
commit 8627c95678
1 changed files with 23 additions and 0 deletions

View File

@ -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<Shader *> shaders;