Synodic-Software / Soul-Engine

Physically based renderer and simulation engine for real-time applications.
GNU General Public License v3.0
42 stars 24 forks source link

Creating the Engine `Frame` Foundation #114

Closed Behemyth closed 6 years ago

Behemyth commented 6 years ago

One of the more recent trends in engine development is to think of a game frame, not as an image, but instead as the data representing that image. Such a data oriented design allows us to sneak in some extra multithreading where you least expect it.

To implement this concept, start by creating a Frame class in Frame.h/cpp found in EngineCore/Frame/. Also create the files FrameManager.h/cpp with a namespace FrameManager and a nested detail namespace. The detail namespace should have one variable Frame currentFrame.

Once the foundation is created, add a Step function to the FrameManager namespace which increments a member variable of currentFrame frameCount by one. frameCount should obviously be initialized to 0 when the object is created.