Created
September 30, 2011 08:06
-
-
Save madebyjeffrey/1253048 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Object::draw() | |
{ | |
shader.use(); | |
GLuint var = shader.uniformLocation("projectionMatrix"); | |
glUniformMatrix4fv(var, 1, GL_FALSE, glm::value_ptr(projectionMatrix)); | |
var = shader.uniformLocation("viewportTranslation"); | |
glUniformMatrix4fv(var, 1, GL_FALSE, glm::value_ptr(viewportTranslation)); | |
glBindBuffer(GL_ARRAY_BUFFER, object); | |
glEnableVertexAttribArray(0); | |
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, 0); | |
glDrawArrays(GL_TRIANGLES, 0, 3); | |
glDisableVertexAttribArray(0); | |
shader.unuse(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment