diff options
Diffstat (limited to 'demo')
-rw-r--r-- | demo/main.lua | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/demo/main.lua b/demo/main.lua index f3a3c4a..1be7eaf 100644 --- a/demo/main.lua +++ b/demo/main.lua @@ -4,6 +4,15 @@ end honey.input.key.bind(honey.input.key.escape, honey.exit) +local vec4 = function(v) + local vector = honey.cglm.new_array_zero(4) + honey.cglm.set_value(vector, 0, v[1]) + honey.cglm.set_value(vector, 1, v[2]) + honey.cglm.set_value(vector, 2, v[3]) + honey.cglm.set_value(vector, 3, v[4]) + return vector +end + local vertex_shader = [[ #version 330 core @@ -24,12 +33,8 @@ void main() { color = base_color; } ]] local shader = honey.shader.new(vertex_shader, fragment_shader) local plane = honey.primitives.plane(2,2) -local color1 = honey.cglm.new_array_zero(4) -honey.cglm.set_value(color1, 3, 1) -local color2 = honey.cglm.copy_array(color1, 4) -honey.cglm.set_value(color1, 0, 1) -honey.cglm.set_value(color2, 2, 1) - +local color1 = vec4{1,0,0,1} +local color2 = vec4{0,0,1,1} local color = honey.cglm.new_array_zero(4) local total_time = 0 |