diff options
author | sanine-a <sanine.not@pm.me> | 2020-10-27 18:16:24 -0500 |
---|---|---|
committer | sanine-a <sanine.not@pm.me> | 2020-10-27 18:16:24 -0500 |
commit | ec00c661a39073ba24a78ba7624009bc912ae572 (patch) | |
tree | ad7c177db9738fc77031253c68e67c20153ac127 /demo | |
parent | 31e715cc8a2849c059cc46cf51b301f663a953b1 (diff) |
add cglm bindings for vec3 and mat3 functions
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 |