Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

385 lines for a triangle: https://github.com/facebook/igl/blob/main/samples/desktop/Ti... When you are trying to sell a wrapper you want your hello world example as small as possible not as comprehensive as possible.


if you just want to draw a triangle, there's higher level libraries for that purpose. this is a low level library built to abstract (but map as close as possible to) modern backends (Vulkan, DX12, etc). the idea with these backends is to give precise control over the pipeline - that kind of precise control does not lend itself to the higher level abstractions you are looking for.

that said, it's not like this scales linearly so that 1,000 triangles is 385,000 lines of code. there's a lot of plumbing to setup the pipeline for your application's specific use case.

again, if your use case does not require the flexibility, look elsewhere.


Good to know I was under the impression that to draw 2 triangles I need to copy paste the whole code twice. I have been a graphics programmer for over 25 years. I'm not even commenting on the API. The toy example certainly can be reduced in code length even given the current API.


... for metal, gl, and Vulkan.

Sorry but this is simply par for the course for any of the above.

You can certainly wrap a lot of that stuff, but you need to make assumptions, and the person that uses likely is writing demanding app, and they want full control over literally everything - but they also would like to cut time to port to Linux by half (say).


The code looks fine to me and a lot is setting up glfw. It's a graphics API abstraction layer like bgfx / sokol / wgpu, not a rendering libraries that would give you stuff like drawTriangle()


ye, it's approaching 50% of LOD of a vulkan hello triangle


but its called tiny!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: