main.lua 397 B

12345678910111213141516
  1. function lovr.draw(pass)
  2. local vertices = {
  3. vec3( 0, .4, 0), vec4(1, 0, 0, 1),
  4. vec3(-.5, -.4, 0), vec4(0, 1, 0, 1),
  5. vec3( .5, -.4, 0), vec4(0, 0, 1, 1)
  6. }
  7. local format = {
  8. { type = 'vec3', location = 'VertexPosition' },
  9. { type = 'vec4', location = 'VertexColor' }
  10. }
  11. local triangle = lovr.graphics.getBuffer(vertices, format)
  12. pass:mesh(triangle, 0, 1.7, -1)
  13. end