edubart/sokol_gp

How to do circle drawing right with sokol_gp?

morew4rd opened this issue · 1 comments

Both line and filled variations. I have something working with multiple lines and filled triangles but it doesn't look good enough IMO. Small radii (a small number of pixels) are an issue as well as blending modes.

Anyone have thoughts on this? Should it be part of the library?

You can draw circles using a strip o triangles, check the polygon example at https://github.com/edubart/sokol_gp/blob/master/samples/sample-primitives.c#L78 main difference is that you need to do more steps to make it look like a circle.

Another method to draw pixel perfect circles is through a SDF shader, though this is more work but also doable with this library.

Should it be part of the library?

No, this should not be part of this library. The library goal is to expose accelerated graphics APIs for drawing basic 2D primitives. You can draw more complex primitives using the basic primitives.