node-raylib icon indicating copy to clipboard operation
node-raylib copied to clipboard

TriangleStrip and TriangleFan

Open armageddon421 opened this issue 5 years ago • 2 comments

Can you please provide an example on how to pass the Vector2 *points in there?

I tried this, but the application just closes without any error message:

let p = [
                    r.Vector2(x,y),
                    r.Vector2(x + h,y + h),
                    r.Vector2(x + w,y),
                    r.Vector2(x + w + h, y + h)
                ]
                
                r.DrawTriangleStrip(p, 4, color)

I'm testing on Windows right now, npm installed just today. I also tried different vertex orders.

armageddon421 avatar Apr 29 '20 22:04 armageddon421

Is there an example in raylib that has one? We could port it over and adapt the code as needed. For a few of the pointer-based methods, I had to make wrapper functions.

RobLoach avatar Apr 30 '20 01:04 RobLoach

I just found this issue on raylib, it's probably related. It seems to exit without error there, too.

https://github.com/raysan5/raylib/issues/1223

Looking at the last comment from raysan, I'll probably not take too much of a performance hit by using separate triangles for everything for now. We should review this issue after node-raylib has been updated to the latest raylib.

armageddon421 avatar Apr 30 '20 08:04 armageddon421