Ybalrid / Annwvyn

Annwvyn C++ Open Source designed-for-VR game engine and application developement framework
MIT License
41 stars 7 forks source link

Make the main class a singleton class. #30

Closed Ybalrid closed 9 years ago

Ybalrid commented 9 years ago

Make the main class a singleton class.

This assure that it can only be intantiated once, and provide a simple acces to the instance via the AnnEngine::Instance() method.

This class is the only one to folow the singleton pattern. The rest of the engine functionally can be accessed throug the AnnEngine singleton. This solution is inspired by the "Get it from something already global" point of this article : http://gameprogrammingpatterns.com/singleton.html