Skip to content

Instantly share code, notes, and snippets.

@BlockoS
Created November 14, 2011 15:04
Show Gist options
  • Save BlockoS/1364120 to your computer and use it in GitHub Desktop.
Save BlockoS/1364120 to your computer and use it in GitHub Desktop.
Vao Example
// init
glGenVertexArrays(1, &fullscreenTriangleVAO);
glBindVertexArray(fullscreenTriangleVAO);
glEnableVertexAttribArray(0);
glEnableVertexAttribArray(1);
glBindBuffer(GL_ARRAY_BUFFER, fullscreenTriangleFBO);
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, 0);
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, (GLvoid*)(6*sizeof(GLfloat)));
glBindBuffer(GL_ARRAY_BUFFER, 0);
gl.BindVertexArray(0);
// draw
glBindVertexArray(fullscreenTriangleVAO);
glDrawArrays(GL_TRIANGLES, 0, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment