OpenGL - VAO
をテンプレートにして作成
[
トップ
|
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
void glGenVertexArrays(GLsizei n, GLuint* arrays);
void glDeleteVertexArrays(GLsizei n, const GLuint* arra...
void glBindVertexArray(GLuint array);
#code(C){{
glGenVertexArrays(1, &vao);
glBindVertexArray(vao);
glEnableVertexArrayAttrib(vao, 0);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
glEnableVertexArrayAttrib(vao, 3);
glVertexAttribPointer(3, 4, GL_FLOAT, GL_FALSE, 0, 0);
glEnableVertexArrayAttrib(vao, 2);
glVertexAttribPointer(2, 3, GL_FLOAT, GL_FALSE, 0, 0);
glBindVertexArray(0);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
}}
void glVertexAttribPointer( GLuint index,
GLint size,
GLenum type,
GLboolean normalized,
GLsizei stride,
const GLvoid *pointer);
void glEnableVertexAttribArray(GLuint index);
void glDisableVertexAttribArray(GLuint index);
#code(C){{
glBindVertexArray(vao);
glDrawElements(GL_LINES, line_size, GL_UNSIGNED_INT, 0);
glBindVertexArray(0);
}}
void glDrawElements( GLenum mode,
GLsizei count,
GLenum type,
const GLvoid* indices);
#code(C){{
glDeleteVertexArrays(1, &vao);
}}
終了行:
void glGenVertexArrays(GLsizei n, GLuint* arrays);
void glDeleteVertexArrays(GLsizei n, const GLuint* arra...
void glBindVertexArray(GLuint array);
#code(C){{
glGenVertexArrays(1, &vao);
glBindVertexArray(vao);
glEnableVertexArrayAttrib(vao, 0);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
glEnableVertexArrayAttrib(vao, 3);
glVertexAttribPointer(3, 4, GL_FLOAT, GL_FALSE, 0, 0);
glEnableVertexArrayAttrib(vao, 2);
glVertexAttribPointer(2, 3, GL_FLOAT, GL_FALSE, 0, 0);
glBindVertexArray(0);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
}}
void glVertexAttribPointer( GLuint index,
GLint size,
GLenum type,
GLboolean normalized,
GLsizei stride,
const GLvoid *pointer);
void glEnableVertexAttribArray(GLuint index);
void glDisableVertexAttribArray(GLuint index);
#code(C){{
glBindVertexArray(vao);
glDrawElements(GL_LINES, line_size, GL_UNSIGNED_INT, 0);
glBindVertexArray(0);
}}
void glDrawElements( GLenum mode,
GLsizei count,
GLenum type,
const GLvoid* indices);
#code(C){{
glDeleteVertexArrays(1, &vao);
}}
ページ名: