Crude, yet functional, custom attribute implementation

This commit is contained in:
Paolo Cignoni 2009-01-23 09:22:38 +00:00
parent 9a47677ed2
commit 7c9aa1c99f
1 changed files with 4 additions and 18 deletions

View File

@ -525,30 +525,16 @@ public:
glProgramParameteriEXT(this->objectID, pname, value); 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); glVertexAttrib4f(index, x, y, z, w);
glVertexAttrib1f(loc, x);
} }
void Attribute(const char * name, GLfloat x, GLfloat y) void BindAttribute(int index, const char * name)
{ {
const GLint loc = glGetAttribLocation(this->objectID, name); glBindAttribLocation(this->objectID, index, 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: protected:
std::set<Shader *> shaders; std::set<Shader *> shaders;
bool linked; bool linked;