summaryrefslogtreecommitdiff
path: root/demo/main.lua
diff options
context:
space:
mode:
Diffstat (limited to 'demo/main.lua')
-rw-r--r--demo/main.lua25
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