thomasfn

GL3: Mesh 2

Sep 1st, 2011
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. public void Render(ProjectionType projection)
  2. {
  3. // Enable the shader and prepare it
  4. Shader.Activate();
  5. Viewpoint.PrepareShader(Shader, projection);
  6. Shader.BindAttrib("inPosition", 0);
  7. Shader.BindAttrib("inNormal", 1);
  8. Shader.BindFragData("outColour", 0);
  9.  
  10. // Bind the VAO and index vbo
  11. GL.BindVertexArray(iVAO);
  12. GL.BindBuffer(BufferTarget.ElementArrayBuffer, iVBOIndices);
  13.  
  14. // Draw
  15. GL.DrawElements(BeginMode.Triangles, lstIndices.Count, DrawElementsType.UnsignedInt, 0);
  16.  
  17. // Cleanup
  18. GL.BindVertexArray(0);
  19. GL.BindBuffer(BufferTarget.ElementArrayBuffer, 0);
  20. Shader.Deactivate();
  21. }
Advertisement
Add Comment
Please, Sign In to add comment