Added empty constructors to be able to define objects without instanciating them.

This commit is contained in:
Fabian Klemp 2014-10-24 10:48:45 +02:00
parent c747968b91
commit 11229430cb
10 changed files with 21 additions and 0 deletions

View File

@ -3,5 +3,8 @@
Entity::Entity(glm::vec3 position, glm::vec3 rotation) { Entity::Entity(glm::vec3 position, glm::vec3 rotation) {
} }
Entity::Entity(){
}
Entity::~Entity(){ Entity::~Entity(){
} }

View File

@ -6,6 +6,7 @@
class Entity { class Entity {
public: public:
Entity(glm::vec3 position, glm::vec3 rotation); Entity(glm::vec3 position, glm::vec3 rotation);
Entity();
~Entity(); ~Entity();
void setPosition(glm::vec3 positon); void setPosition(glm::vec3 positon);
void setRotation(glm::vec3 rotation); void setRotation(glm::vec3 rotation);

View File

@ -5,6 +5,9 @@ Model::Model(std::string filePath) {
reference->bind(); reference->bind();
} }
Model::Model(){
}
Model::~Model() { Model::~Model() {
} }

View File

@ -7,6 +7,7 @@
class Model { class Model {
public: public:
Model(std::string filePath); Model(std::string filePath);
Model();
~Model(); ~Model();
ACGL::OpenGL::SharedVertexArrayObject getReference(); ACGL::OpenGL::SharedVertexArrayObject getReference();
private: private:

View File

@ -10,9 +10,13 @@ Object::Object(Model model, Texture texture, glm::vec3 position, glm::vec3 rotat
this->shader = shader.getReference(); this->shader = shader.getReference();
} }
Object::Object() {
}
Object::~Object() { Object::~Object() {
} }
void Object::render() { void Object::render() {
shader->setTexture("uTexture", texture, 0); shader->setTexture("uTexture", texture, 0);
model->render();
} }

View File

@ -14,6 +14,7 @@ class Object : Entity {
public: public:
Object(Model model, Texture texture, glm::vec3 position, glm::vec3 rotation, Object(Model model, Texture texture, glm::vec3 position, glm::vec3 rotation,
glm::vec3 velocity, glm::vec3 angularVelocity, Shader shader); glm::vec3 velocity, glm::vec3 angularVelocity, Shader shader);
Object();
~Object(); ~Object();
void render(); void render();
private: private:

View File

@ -6,6 +6,9 @@ Shader::Shader(std::string filePath, Model model) {
reference->use(); reference->use();
} }
Shader::Shader() {
}
Shader::~Shader() { Shader::~Shader() {
} }

View File

@ -8,6 +8,7 @@
class Shader { class Shader {
public: public:
Shader(std::string filePath, Model model); Shader(std::string filePath, Model model);
Shader();
ACGL::OpenGL::SharedShaderProgram getReference(); ACGL::OpenGL::SharedShaderProgram getReference();
~Shader(); ~Shader();
private: private:

View File

@ -4,6 +4,9 @@ Texture::Texture(std::string filePath) {
reference = ACGL::OpenGL::Texture2DFileManager::the()->get(ACGL::OpenGL::Texture2DCreator(filePath)); reference = ACGL::OpenGL::Texture2DFileManager::the()->get(ACGL::OpenGL::Texture2DCreator(filePath));
} }
Texture::Texture() {
}
Texture::~Texture() { Texture::~Texture() {
} }

View File

@ -9,6 +9,7 @@
class Texture{ class Texture{
public: public:
Texture(std::string filePath); Texture(std::string filePath);
Texture();
ACGL::OpenGL::SharedTexture2D getReference(); ACGL::OpenGL::SharedTexture2D getReference();
~Texture(); ~Texture();
private: private: