loveshape: draw geometric shapes in retained mode

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
BurrickSlayer
Prole
Posts: 15
Joined: Sat Dec 21, 2013 4:28 pm

loveshape: draw geometric shapes in retained mode

Post by BurrickSlayer »

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:
screenshot.png
screenshot.png (84.35 KiB) Viewed 10823 times
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
BurrickSlayer
Prole
Posts: 15
Joined: Sat Dec 21, 2013 4:28 pm

Re: loveshape: draw geometric shapes in retained mode

Post by BurrickSlayer »

Hello all,

I released version 1.1.0 with the following major changes:
  • Unit tests added. During the tests I discovered some issues and inconsistencies which I fixed along the way.
  • Elliptical shapes added. Not that I badly needed them, but the library felt incomplete without them. ;)
  • Soft edges added. These can be used for both, simple anti-aliasing and some interesting visual effects.
  • Revised LÖVE demo (you can see a screenshot of it in the initial post, which I updated)
You can see the full list of changes in the changelog: https://github.com/binaryfs/loveshape/b ... CHANGES.md

And this is what the soft edges look like:

soft-edges.png
soft-edges.png (13.5 KiB) Viewed 10820 times

I thought about implementing straight lines as well, but currently I have no use for them and technically they can be represented by rectangles. So at the moment I have no plans to add them.

Best regards
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests