new commit for Porting to Glow #1

Merged
milk merged 5 commits from glowPort into master 2023-03-09 14:12:42 +01:00

i am using the gl bindings instead of the safer higher level glow bindings, this will be problematic when it comes to if i want to use imgui on this project

i am using the gl bindings instead of the safer higher level glow bindings, this will be problematic when it comes to if i want to use imgui on this project
milk added 1 commit 2023-03-05 00:52:32 +01:00
milk added 1 commit 2023-03-06 10:14:44 +01:00
milk added 1 commit 2023-03-08 10:25:53 +01:00
Poster
Owner

the glow equivelent of UniformMatrix requires a slice, idk how to do that, so i just put the values as vectors

          pub fn setMat3(&self, name: &str, value: cgmath::Matrix3<f32>)
          {
            let nums = vec![value.x.x, value.x.y, value.x.z,
            value.y.x, value.y.y, value.y.z,
            value.z.x, value.z.y, value.z.z];
            unsafe
            {
              self.gl.uniform_matrix_3_f32_slice(self.gl.get_uniform_location(self.ID, name).as_ref(), false, nums.as_ref());
            }
          }

          pub fn setMat4(&self, name: &str, value: &cgmath::Matrix4<f32>)
          {
            let nums = vec![value.x.x, value.x.y, value.x.z, value.x.w,
            value.y.x, value.y.y, value.y.z, value.y.w,
            value.z.x, value.z.y, value.z.z, value.z.w,
            value.w.x, value.w.y, value.w.z, value.w.w];
            unsafe
            {
              self.gl.uniform_matrix_4_f32_slice(self.gl.get_uniform_location(self.ID, name).as_ref(), false, nums.as_ref());
            }
          }

the glow equivelent of UniformMatrix requires a slice, idk how to do that, so i just put the values as vectors ```rust pub fn setMat3(&self, name: &str, value: cgmath::Matrix3<f32>) { let nums = vec![value.x.x, value.x.y, value.x.z, value.y.x, value.y.y, value.y.z, value.z.x, value.z.y, value.z.z]; unsafe { self.gl.uniform_matrix_3_f32_slice(self.gl.get_uniform_location(self.ID, name).as_ref(), false, nums.as_ref()); } } pub fn setMat4(&self, name: &str, value: &cgmath::Matrix4<f32>) { let nums = vec![value.x.x, value.x.y, value.x.z, value.x.w, value.y.x, value.y.y, value.y.z, value.y.w, value.z.x, value.z.y, value.z.z, value.z.w, value.w.x, value.w.y, value.w.z, value.w.w]; unsafe { self.gl.uniform_matrix_4_f32_slice(self.gl.get_uniform_location(self.ID, name).as_ref(), false, nums.as_ref()); } } ```
milk added 1 commit 2023-03-08 15:10:52 +01:00
milk added 1 commit 2023-03-09 13:48:37 +01:00
milk force-pushed glowPort from 10a03e47a4 to aa6ce170ba 2023-03-09 13:51:06 +01:00 Compare
Poster
Owner

for 2 Days there has been an issue with the loading,
it was caused by one bad line
aa6ce170ba/src/model/mesh.rs (L140)
it was setting the length of the slice to vertices.len() * size_of<f32>
instead of vertices.len() * size_of<Vertex>

for 2 Days there has been an issue with the loading, it was caused by one bad line https://got.milkte.ch/milk/Dairy-Drift/src/commit/aa6ce170ba508640a08455f45b73b1c6f6ca10d4/src/model/mesh.rs#L140 it was setting the length of the slice to `vertices.len() * size_of<f32>` instead of `vertices.len() * size_of<Vertex>`
milk changed title from WIP: new commit for Porting to Glow to new commit for Porting to Glow 2023-03-09 14:12:31 +01:00
milk merged commit e363da01b5 into master 2023-03-09 14:12:42 +01:00
milk deleted branch glowPort 2023-03-09 14:12:42 +01:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: milk/Dairy-Drift#1
There is no content yet.