edubart/sokol_gp

Line thickness?

ib00 opened this issue · 1 comments

ib00 commented

Two questions:

  1. Is there a way to specify line thickness?
  2. If yes, are those lines antialiased?
  1. Is there a way to specify line thickness?

There is no cross-platform way to specify line thickness that would work in all backends. This is a limitation for most graphical backends and line thickness is hard fixed to 1 pixel wide (the default thickness for most graphical backends). Some graphical backends do support changing line thickness but I recommend not doing that, because the library automatic batching algorithm will not consider that.

You can still draw thick lines yourself by drawing a rectangle, though the corners wouldn't be round. Or you could make a pixel shader yourself to draw an antialiasing and rounded corner line, though this is not straightforward.

  1. If yes, are those lines antialiased?

Antialiasing is something the graphical backend handles, and again there is no cross platform way to configure it.  You can checkout the underlying graphical backend documentation on how to configure antialiasing for it. Though most graphical backends come with a sane default antialiasing configuration that applies a fair-looking antialiasing for both rectangles and lines.