Successful DirectX context through GLFW, praise Gaben!

This commit is contained in:
2015-10-12 14:31:48 +02:00
parent 16ecdb76d3
commit a782e6b40a
16 changed files with 564 additions and 6 deletions
+34
View File
@@ -0,0 +1,34 @@
#ifndef DD_STATICSYSTEM_H__
#define DD_STATICSYSTEM_H__
#include <unordered_map>
namespace dd
{
class StaticSystem
{
private:
StaticSystem();
public:
template <typename T>
static T* Get()
{
return static_cast<T*>(Instances.at(typeid(T).hash_code()));
}
template <typename T>
static void Set(T* ptr)
{
Instances[typeid(T).hash_code()] = static_cast<void*>(ptr);
}
private:
static std::unordered_map<size_t, void*> Instances;
};
}
#endif