-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added managers for Shader programs and Meshes. Improved Actor.
Actor now can be drawn without a mesh.
- Loading branch information
1 parent
83c5ea5
commit 3dbe695
Showing
16 changed files
with
183 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* File Manager.h in project ThreeEngine | ||
* | ||
* Copyright (C) Ricardo Rodrigues 2017 - All Rights Reserved | ||
*/ | ||
#ifndef THREEENGINE_MANAGER_H | ||
#define THREEENGINE_MANAGER_H | ||
|
||
#include <map> | ||
#include <string> | ||
#include "singleton.h" | ||
|
||
namespace ThreeEngine { | ||
template<typename T> | ||
class Manager { | ||
SINGLETON_HEADER_ONLY(Manager) | ||
|
||
private: | ||
std::map<std::string, T> objects{}; | ||
|
||
public: | ||
inline void Add(std::string name, T const& object) { | ||
objects[name] = object; | ||
} | ||
|
||
inline T Get(std::string name) { | ||
return objects[name]; | ||
} | ||
|
||
inline void Clear() { | ||
objects.clear(); | ||
} | ||
}; | ||
|
||
template<typename T> | ||
SINGLETON_HEADER_ONLY_AFTERCLASS(Manager<T>) | ||
} | ||
|
||
#endif //THREEENGINE_MANAGER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* File Managers.h in project ThreeEngine | ||
* | ||
* Copyright (C) Ricardo Rodrigues 2017 - All Rights Reserved | ||
*/ | ||
#ifndef THREEENGINE_MANAGERS_H | ||
#define THREEENGINE_MANAGERS_H | ||
|
||
#include <memory> | ||
#include "Manager.h" | ||
#include "../Shader/ShaderProgram.h" | ||
#include "../Shapes/Mesh.h" | ||
|
||
namespace ThreeEngine { | ||
typedef Manager<std::shared_ptr<ShaderProgram>> ShaderProgramManager; | ||
typedef Manager<std::shared_ptr<Mesh>> MeshManager; | ||
} | ||
|
||
#endif //THREEENGINE_MANAGERS_H |
Oops, something went wrong.