diff --git a/compiler/parser.v b/compiler/parser.v index 5265f40de6..c638e9888f 100644 --- a/compiler/parser.v +++ b/compiler/parser.v @@ -2287,8 +2287,8 @@ fn (p mut Parser) array_init() string { // println('GOT TYP after [] $typ') } // ! after array => no malloc and no copy - no_copy := p.tok == NOT - if no_copy { + no_alloc := p.tok == NOT + if no_alloc { p.next() } // [1,2,3]!! => [3]int{1,2,3} @@ -2312,8 +2312,8 @@ fn (p mut Parser) array_init() string { // typ += '_ptr" // } mut new_arr := 'new_array_from_c_array' - if no_copy { - new_arr += '_no_copy' + if no_alloc { + new_arr += '_no_alloc' } p.gen(' })') // p.gen('$new_arr($vals.len, $vals.len, sizeof($typ), ($typ[]) $c_arr );') diff --git a/gl/gl.v b/gl/gl.v index 8fe6674e4e..2bfc74ca68 100644 --- a/gl/gl.v +++ b/gl/gl.v @@ -13,8 +13,13 @@ import const ( GL_DEPTH_TEST ) +// TODO: windows support +#flag linux -I$HOME/code/v/thirdparty/glad +#flag darwin -I$HOME/code/v/thirdparty/glad + #include "glad.h" #include "glad.c" + fn init_glad() { ok := C.gladLoadGL() if !ok { diff --git a/glm/glm.v b/glm/glm.v index 81b4906200..e2b183cf55 100644 --- a/glm/glm.v +++ b/glm/glm.v @@ -129,6 +129,10 @@ fn rotate(m Mat4, angle float, vec Vec3) Mat4 { return Mat4{} } */ + +fn float_calloc(n int) *float { + return *float(calloc(n * sizeof(float))) +} // fn translate(vec Vec3) *float { fn translate(m Mat4, v Vec3) Mat4 { // # return glm__mat4(myglm_translate(vec.x,vec.y,vec.z) );