diff options
author | iurii plugatarov <[email protected]> | 2024-08-19 23:49:44 +0200 |
---|---|---|
committer | iurii plugatarov <[email protected]> | 2024-08-19 23:49:44 +0200 |
commit | 0be81b1387f010bb00e1ea34ff66561fa67cedef (patch) | |
tree | ba7f9674e339e82abc495bf64aac6a80125b0c8c /src/main.odin | |
parent | 30c8a4d7c2160c174392aa2dccf60178f9cd02c2 (diff) | |
download | funhalla-0be81b1387f010bb00e1ea34ff66561fa67cedef.tar.gz |
updated code
Diffstat (limited to 'src/main.odin')
-rw-r--r-- | src/main.odin | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main.odin b/src/main.odin index 43cd5fb..f09ccb4 100644 --- a/src/main.odin +++ b/src/main.odin @@ -225,9 +225,9 @@ main :: proc() { shader.use(lighting_shader) object_color := Vec3{1.0, 0.5, 0.31} light_color := Vec3{1.0, 1.0, 1.0} - shader.set_vec3(lighting_shader, cstring("object_color"), &object_color[0]) - shader.set_vec3(lighting_shader, cstring("light_color"), &light_color[0]) - shader.set_vec3(lighting_shader, cstring("light_position"), &light_pos[0]) + shader.set_vec3(lighting_shader, cstring("object_color"), &object_color) + shader.set_vec3(lighting_shader, cstring("light_color"), &light_color) + shader.set_vec3(lighting_shader, cstring("light_position"), &light_pos) aspect: f32 = 800.0 / 600.0 projection := linalg.matrix4_perspective_f32( @@ -246,18 +246,18 @@ main :: proc() { gl.UniformMatrix4fv(projection_location, 1, gl.FALSE, &projection[0][0]) model := linalg.MATRIX4F32_IDENTITY - shader.set_mat4(lighting_shader, cstring("model"), &model[0][0]) + shader.set_mat4(lighting_shader, cstring("model"), &model) gl.BindVertexArray(cube_vao) gl.DrawArrays(gl.TRIANGLES, 0, 36) shader.use(light_cube_shader) - shader.set_mat4(light_cube_shader, cstring("projection"), &projection[0][0]) - shader.set_mat4(light_cube_shader, cstring("view"), &view[0][0]) + shader.set_mat4(light_cube_shader, cstring("projection"), &projection) + shader.set_mat4(light_cube_shader, cstring("view"), &view) model = linalg.matrix4_translate_f32(light_pos) model *= linalg.matrix4_scale_f32(Vec3{0.2, 0.2, 0.2}) - shader.set_mat4(light_cube_shader, cstring("model"), &model[0][0]) + shader.set_mat4(light_cube_shader, cstring("model"), &model) gl.BindVertexArray(light_cube_vao) gl.DrawArrays(gl.TRIANGLES, 0, 36) |