uniform 变量赋值
void glUniform1f (GLint location, GLfloat x);
void glUniform1fv (GLint location, GLsizei count, const GLfloat* v);
void glUniform1i (GLint location, GLint x);
void glUniform1iv (GLint location, GLsizei count, const GLint* v);
void glUniform2f (GLint location, GLfloat x, GLfloat y);
void glUniform2fv (GLint location, GLsizei count, const GLfloat* v);
void glUniform2i (GLint location, GLint x, GLint y);
void glUniform2iv (GLint location, GLsizei count, const GLint* v);
void glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z);
void glUniform3fv (GLint location, GLsizei count, const GLfloat* v);
void glUniform3i (GLint location, GLint x, GLint y, GLint z);
void glUniform3iv (GLint location, GLsizei count, const GLint* v);
void glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
void glUniform4fv (GLint location, GLsizei count, const GLfloat* v);
void glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w);
void glUniform4iv (GLint location, GLsizei count, const GLint* v);
1、2、3、4表示数字参数的个数,i表示32位整形,f表示32位浮点型,v表示接收指针。
attribute 变量赋值
void glVertexAttrib1f (GLuint indx, GLfloat x);
void glVertexAttrib1fv (GLuint indx, const GLfloat* values);
void glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y);
void glVertexAttrib2fv (GLuint indx, const GLfloat* values);
void glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z);
void glVertexAttrib3fv (GLuint indx, const GLfloat* values);
void glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
void glVertexAttrib4fv (GLuint indx, const GLfloat* values);
//第一个参数表示要修改的顶点属性对象 对象的size(1-4) 类型 是否规格化0-1 取下一个变量地址间隔 首地址
void glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);