I am making a 2D graphics library in Python designed to make 2D easy and fast. Internally it uses OpenGL. The library does cover a bit more then a graphics library, it also includes windowing and sound (and all necessary features to get working, like texture loading).
I've got a good beginning working with good performance, and I'd like to expand and refine my feature set.
Now I'm wondering, what features should a 2D graphics library have? After some brainstorming I made a little list:
- Fast sprite class for displaying rotated, scaled, colored and translated textures
- Sprite batching
- Drawing geometry: lines, polygons, circles, etc
- Alpha with blending modes on all of the above
- Easy texture loading (from file and memory)
- Texture regions (and texture atlases)
- Blitting texture(regions) into other textures
- Particle systems
- Off-screen rendering surfaces (FBO's?)
But I feel I have only scratched the surface of features. What am I missing?
One thing you must keep in mind that all of this in Python with C extensions. Any work in the library is fast, any work the user must do is relatively much slower. In addition to that Python calls are quite expensive, so the library largely benefits from batching.
(In case anyone cares, the library in question is pygrafix and can be found here: http://github.com/nightcracker/pygrafix)