diff options
author | sanine-a <sanine.not@pm.me> | 2020-10-27 15:31:14 -0500 |
---|---|---|
committer | sanine-a <sanine.not@pm.me> | 2020-10-27 15:31:14 -0500 |
commit | ccd98d4dbdb7acde2433153a01d00a3b9bed02c0 (patch) | |
tree | 9ad033d4d6b48d9824a9c924fe23a421feff1f70 /demo | |
parent | 50a8d3dc884816fbb1e3a3df3c401358e62b5eea (diff) |
fix bug in honey.shader.new and add basic primitives bindings
Diffstat (limited to 'demo')
-rw-r--r-- | demo/main.lua | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/demo/main.lua b/demo/main.lua index 0ec77a9..bad2c68 100644 --- a/demo/main.lua +++ b/demo/main.lua @@ -4,9 +4,28 @@ end honey.input.key.bind(honey.input.key.escape, honey.exit) +local vertex_shader = [[ +#version 330 core + +layout(location = 0) in vec3 position; + +void main() +{ + gl_Position.xyz = position; + gl_Position.w = 1.0; +} ]] +local fragment_shader = [[ +#version 330 core + +out vec4 color; +void main() { color = vec4(1,0,0,1); } ]] + +local shader = honey.shader.new(vertex_shader, fragment_shader) +local plane = honey.primitives.plane(1,1) + function honey.update(dt) end ---function honey.draw() --- print('draw!') ---end +function honey.draw() + honey.mesh.draw(plane, shader) +end |