loveshape: draw geometric shapes in retained mode
Posted: Sun Nov 12, 2023 11:59 pm
Hi all,
I have created a simple library for drawing several geometric shapes (like rectangles or convex polygons) in retained mode instead of immediate mode. So instead of using the love.graphics.* functions to set the color and size of your shapes, you create objects, set their visual properties and then draw them on the screen. The shape objects are based on meshes, so you can texture them, transform them and whatnot.
Personally, I will use this library to draw elements in a classic retained mode GUI, but you might find it useful for other applications as well.
This is what the demo looks like:
Shape borders are smoothed in a similar way as implemented in the LÖVE drawing functions. I plan to use this smoothing technique for the shapes themselves as well in a future release, to further improve the rendering quality.
Oh, and I haven't implemented ellipses yet, but it's on my list.
Repository: https://github.com/binaryfs/loveshape
Best regards
I have created a simple library for drawing several geometric shapes (like rectangles or convex polygons) in retained mode instead of immediate mode. So instead of using the love.graphics.* functions to set the color and size of your shapes, you create objects, set their visual properties and then draw them on the screen. The shape objects are based on meshes, so you can texture them, transform them and whatnot.
Personally, I will use this library to draw elements in a classic retained mode GUI, but you might find it useful for other applications as well.
This is what the demo looks like:
Shape borders are smoothed in a similar way as implemented in the LÖVE drawing functions. I plan to use this smoothing technique for the shapes themselves as well in a future release, to further improve the rendering quality.
Oh, and I haven't implemented ellipses yet, but it's on my list.
Repository: https://github.com/binaryfs/loveshape
Best regards