Several years ago when I started working with the iOS platform there were no good 2d render engines available and like most developers each project was built with just the bare minimum of what was need to get the project done. After a couple project each using there own set of tech (open GL, UIKit) I decided to create a small and light weight 2d render engine that I could use in multiple projects. Electric2D is the result of that effort.
As the project has sat idle and there are a number of years and I always had the intention of open sourcing the project at some point. I have decide to release the project, please feel to use it for reference but I would suggest that there are some much nicer and well maintained projects out there that would be better suited for your own projects. I have been using cocos2d / cocos2d-x for the last while for work and my personal projects as well as Unity3D.
The render was built using Open GL 1.1 as I had no need to support shaders at the time, the project does include a nice bash script for creating a SDK. This was to make it very easy to integrate into a project by just including it in the project settings, it also removed the need to compile the lib all the time and let me keep the project separate from my game projects. This script is run using a target and does a command line build of the project. It will also package up the result into dmg if my memory serves me.
The Core render manager is In the class GLEngine, this will setup the render system and provides and interface to add and remove render objects. The render supports up to 10 layers the top most being the UI layer which will not be affected by the camera position. It also supports multiple orientations including an iPhoneUI which changes the screen origin to be the same as UIKit i.e. zero zero at the top left not the bottom left like OpenGL normally has.
The rest of the render engine is hidden under this class and is not exposed to the end user.
- GLImage : Simple image object to render a texture.
- GLLabel : Text render that uses the built in fronts.
- GLLine : Line render.
- GLModel : 2d poly model support.
- GLObject : Base class for all render able objects.
- GLObjectHierarchy : Container object for the creation of object collection.
- GLSprite : Uses a texture like a sprite sheet, the sprite layout is defined using a posit,
- GLImageBatch : A batch render object for rendering the same image multiple times efficiently.
- GLSpriteBatch : A batch render object for rendering the same sprite multiple times efficiently.
- GLBackground : Used to render a full screen quad and permits the removal of the clear command.
- GLCamera : Permits the positioning of the render view in the game world.
- GLColor : 4 value color container.
- GLFPS : Debug fps counter.
- GLVert : Vert container class.
- Maths : Maths functions.
- ObjectPool : Template class to create a pool of reusable objects.