This file contains hidden or 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
enum { | |
ERROR_NONE, | |
ERROR_DEBUG, | |
ERROR_INFO, | |
ERROR_WARN, | |
ERROR_FATAL | |
}; | |
class Error { | |
public: |
This file contains hidden or 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
ShaderLoader* ShaderLoader::GetInstance() { | |
if(!m_instance) { | |
m_instance = new ShaderLoader(); | |
} | |
return((ShaderLoader*)m_instance); | |
} | |
int ShaderLoader::Load(char* shader) { | |
// Try to find the shader program in our resource cache first |
This file contains hidden or 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
class ShaderLoader : public Loader<int> { | |
public: | |
// Load the shaders (don't give the file extension) | |
int Load(char* shader); | |
public: | |
static ShaderLoader* GetInstance(); | |
}; |
This file contains hidden or 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
#include <string.h> | |
template<class T> | |
class Loader { | |
public: | |
Loader(); | |
~Loader(); | |
// Load a resource from a filename | |
T Find(char* filename); |
This file contains hidden or 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
template<class T> | |
class Resource { | |
public: | |
Resource(); | |
~Resource(); | |
public: | |
char* filename; | |
T resource; | |
This file contains hidden or 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
/* INCLUDES */ | |
#include <GLFW/glfw3.h> | |
#include <component.h> | |
#include <system.h> | |
#include <rendersystem.h> | |
/* GLOBAL VARIABLES */ |
This file contains hidden or 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
#include <GL/glew.h> | |
#include <GLFW/glfw3.h> | |
#include <glm/glm.hpp> | |
#include <glm/gtc/quaternion.hpp> | |
#include <error.h> | |
#include <component.h> | |
#include <system.h> | |
#include <rendersystem.h> | |
#include <renderable.h> |
This file contains hidden or 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
class RenderSystem : System { | |
public: | |
RenderSystem(); | |
~RenderSystem(); | |
// Initialize/shut down the render system | |
void Initialize(); | |
void Shutdown(); | |
// Our main update function |
This file contains hidden or 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
class Renderable : public Component { | |
public: | |
Renderable(); | |
~Renderable(); | |
public: | |
// Position in world space | |
glm::vec3 position; | |
// Local rotation |
This file contains hidden or 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
Renderable* renderable = (Renderable*)entity->GetComponent<Renderable>(); |