From ccd98d4dbdb7acde2433153a01d00a3b9bed02c0 Mon Sep 17 00:00:00 2001 From: sanine-a Date: Tue, 27 Oct 2020 15:31:14 -0500 Subject: fix bug in honey.shader.new and add basic primitives bindings --- demo/main.lua | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'demo') 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 -- cgit v1.2.1