OpenGL engine project
I worked for 8 weeks on this engine with a team of several other programmers. We made an engine that includes 3D rendering, 2D rendering, 3D physics, 2D physics, and networking. This put together by an architecture in which we had scenes and game objects. The architecture was modular, in which the engine would call the specific parts of the engine that were needed. Every part of the engine was written as a model that would be called by the main loop depending on its needs.
In the game scene you would register objects as game objects of specfic type, for example sprite. These would then put in static lists from which the engine gets the objects behind the scene and would for example render the object and apply physics on the object.
I worked mainly on the 2D rendering and partly on the 2D demo game.
I used for the renderer OpenGL version 3.3 which is entirely different than the old version I used previously. This required some reading up and following articles and tutorials to figure out how to make a 2D renderer in this version.
Above you see the rendering sequence of the 2D renderer. This is done in the draw function of the 2D renderer which gets called by the engine update. It starts with getting the sprite objects that are registered by the engine. Then it loops through every component and draws them according to the OpenGL conventions. First, it will get the transform of the object, then it will calculate the position, rotation and scale put it in a matrix. It will then send this to the shader which will use it for the position of the object. After that it will bind the texture and draw the object.
I also made a primitive component so that the 2D physics programmer could draw lines for his calculations. There was also a text component in the engine that I made. This renders text on screen. Lastly, I helped build the 2D demo game to demonstrate the engine.