Re: Euraylib Released!

new topic     » goto parent     » topic index » view thread      » older message » newer message

Awesome work! Raylib is a great library and I have enjoyed playing around with it immensely in other languages. Unfortunately I am running into a few issues.

Examples using DrawCircleV appear to be behaving strangely. For example Ex4.exw appeared to be drawing the Y coordinate to 0 and passing ball_y as the radius. I was suspicious of something weird going on since it appeared to be shifting arguments over. This made absolutely no sense, but I guessed at the following and it appeared to fix my issue and this is working properly.

The function signature in C is:

void DrawCircleV(Vector2 center, float radius, Color color) 
Current Oe wrapper is:
xDrawCircleV = define_c_proc(ray,"+DrawCircleV",{C_FLOAT,C_FLOAT,C_FLOAT,C_UINT}) 
... 
public procedure DrawCircleV(atom x,atom y,atom rad,atom col) 
 
 c_proc(xDrawCircleV,{x,y,rad,col}) 
	 
end procedure 
My janky fix(?):
xDrawCircleV = define_c_proc(ray,"+DrawCircleV",{C_FLOAT,C_FLOAT,C_FLOAT,C_FLOAT,C_FLOAT,C_UINT}) 
... 
public procedure DrawCircleV(atom x,atom y,atom rad,atom col) 
 
 c_proc(xDrawCircleV,{x,0,y,0,rad,col}) 
	 
end procedure 
 

Why does my "fix" work?

In general it looks like I cannot get functions working properly that utilize a struct. I'm on linux using libraylib.so.2.5.0 from https://github.com/raysan5/raylib/releases.

Should there be something wrapping the Vector2 struct?

Another example is DrawTriangle:

void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color) 
... 
xDrawCircleV = define_c_proc(ray,"+DrawCircleV",{C_FLOAT,C_FLOAT,C_FLOAT,C_UINT}), 
 
Oe Wrapper:
xDrawTriangle = define_c_proc(ray,"+DrawTriangle",{C_FLOAT,C_FLOAT,C_FLOAT,C_FLOAT,C_FLOAT,C_FLOAT,C_UINT}) 
... 
public procedure DrawTriangle(atom x,atom y,atom x2,atom y2,atom x3,atom y3,atom col) 
 
 c_proc(xDrawTriangle,{x,y,x2,y2,x3,y3,col}) 
	 
end procedure 

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu