mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
ui: cleanup warnings from glm module
This commit is contained in:
parent
6b706a0c99
commit
d90a291c5e
@ -131,7 +131,7 @@ fn rotate(m Mat4, angle f32, vec Vec3) Mat4 {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
fn f32_calloc(n int) &f32 {
|
fn f32_calloc(n int) &f32 {
|
||||||
return *f32(calloc(n * sizeof(f32)))
|
return &f32(calloc(n * sizeof(f32)))
|
||||||
}
|
}
|
||||||
// fn translate(vec Vec3) *f32 {
|
// fn translate(vec Vec3) *f32 {
|
||||||
pub fn translate(m Mat4, v Vec3) Mat4 {
|
pub fn translate(m Mat4, v Vec3) Mat4 {
|
||||||
@ -277,23 +277,24 @@ fn ortho_js(left, right, bottom, top f32) &f32 {
|
|||||||
lr := 1.0 / (left - right)
|
lr := 1.0 / (left - right)
|
||||||
bt := 1.0 / (bottom - top)
|
bt := 1.0 / (bottom - top)
|
||||||
nf := 1.0 / 1.0// (mynear -myfar)
|
nf := 1.0 / 1.0// (mynear -myfar)
|
||||||
mut out := (*f32)( malloc (sizeof(f32) * 16))
|
mut out := &f32(0)
|
||||||
out[0] = -2.0 * lr
|
unsafe { out = &f32( malloc (sizeof(f32) * 16)) }
|
||||||
out[1] = 0
|
out[0] = -2.0 * lr
|
||||||
out[2] = 0
|
out[1] = 0
|
||||||
out[3] = 0
|
out[2] = 0
|
||||||
out[4] = 0
|
out[3] = 0
|
||||||
out[5] = -2.0 * bt
|
out[4] = 0
|
||||||
out[6] = 0
|
out[5] = -2.0 * bt
|
||||||
out[7] = 0
|
out[6] = 0
|
||||||
out[8] = 0
|
out[7] = 0
|
||||||
out[9] = 0
|
out[8] = 0
|
||||||
out[10] = 2.0 * nf
|
out[9] = 0
|
||||||
out[11] = 0
|
out[10] = 2.0 * nf
|
||||||
out[12] = (left + right) * lr
|
out[11] = 0
|
||||||
out[13] = (top + bottom) * bt
|
out[12] = (left + right) * lr
|
||||||
out[14] = 1.0 * nf//(far + near) * nf;
|
out[13] = (top + bottom) * bt
|
||||||
out[15] = 1
|
out[14] = 1.0 * nf//(far + near) * nf;
|
||||||
|
out[15] = 1
|
||||||
return out
|
return out
|
||||||
//f := 0.0
|
//f := 0.0
|
||||||
//return &f
|
//return &f
|
||||||
|
Loading…
Reference in New Issue
Block a user