zengine
zengine copied to clipboard
2D Drawing API
Taking about some future ideas here (also maybe something to do before v1.0). Any plans on 2D drawing other than rendering sprites & textures?
Having functions to do 2D drawing isn't really necessary for a game dev library, but it can be really handy. I see that there is some stuff in primitives.nim, but not much.
- Would we want to design our own API?
- Model it after something else? (e.g. like how NanoVG is modeled after HTML5's Canvas API)
- Would we want to implement it ourselves?
- Or is there something off the shelf that we can integrate (e.g. cairo)? a. Maybe provide an abstraction layer over a 3rd party library?
I very much would like to do option no. 4, since it would be a lot less work for us (among other things). But options 1-3 look a little more fun, and possibly better since we would have more control, understanding, and portability if we had something in pure Nim rather than binding an existing C library.
What are your thoughts? This isn't an immediate thing to work on, but a nice little cherry on the top.
How about NanoVG?
https://github.com/memononen/nanovg
I've implemented this before. It's nice...
Got sample code?
(EDIT, I meant to write "NanoVG," instead of "OpenVG," in the OP)
Not really - I never did any higher level wrapper around NanoVG but I have bindings here - https://github.com/zacharycarter/nanovg.nim
Using it pretty much means using the NanoVG API at the moment.
We could introduce a thin wrapper around NanoVG if you'd be game for that.