From 11229430cbb204c8c416f0bf2da9ef91bc5abc4a Mon Sep 17 00:00:00 2001 From: Fabian Klemp Date: Fri, 24 Oct 2014 10:48:45 +0200 Subject: [PATCH] Added empty constructors to be able to define objects without instanciating them. --- entity.cc | 3 +++ entity.hh | 1 + model.cc | 3 +++ model.hh | 1 + object.cc | 4 ++++ object.hh | 1 + shader.cc | 3 +++ shader.hh | 1 + texture.cc | 3 +++ texture.hh | 1 + 10 files changed, 21 insertions(+) diff --git a/entity.cc b/entity.cc index b542d69..a0a9101 100644 --- a/entity.cc +++ b/entity.cc @@ -3,5 +3,8 @@ Entity::Entity(glm::vec3 position, glm::vec3 rotation) { } +Entity::Entity(){ +} + Entity::~Entity(){ } diff --git a/entity.hh b/entity.hh index d0d6dab..9ec1431 100644 --- a/entity.hh +++ b/entity.hh @@ -6,6 +6,7 @@ class Entity { public: Entity(glm::vec3 position, glm::vec3 rotation); + Entity(); ~Entity(); void setPosition(glm::vec3 positon); void setRotation(glm::vec3 rotation); diff --git a/model.cc b/model.cc index d82d4b2..17218a2 100644 --- a/model.cc +++ b/model.cc @@ -5,6 +5,9 @@ Model::Model(std::string filePath) { reference->bind(); } +Model::Model(){ +} + Model::~Model() { } diff --git a/model.hh b/model.hh index ab777b3..6b728b7 100644 --- a/model.hh +++ b/model.hh @@ -7,6 +7,7 @@ class Model { public: Model(std::string filePath); + Model(); ~Model(); ACGL::OpenGL::SharedVertexArrayObject getReference(); private: diff --git a/object.cc b/object.cc index 7782e38..65cd7da 100644 --- a/object.cc +++ b/object.cc @@ -10,9 +10,13 @@ Object::Object(Model model, Texture texture, glm::vec3 position, glm::vec3 rotat this->shader = shader.getReference(); } +Object::Object() { +} + Object::~Object() { } void Object::render() { shader->setTexture("uTexture", texture, 0); + model->render(); } diff --git a/object.hh b/object.hh index b698c69..111c2a3 100644 --- a/object.hh +++ b/object.hh @@ -14,6 +14,7 @@ class Object : Entity { public: Object(Model model, Texture texture, glm::vec3 position, glm::vec3 rotation, glm::vec3 velocity, glm::vec3 angularVelocity, Shader shader); + Object(); ~Object(); void render(); private: diff --git a/shader.cc b/shader.cc index d62f28a..159d02c 100644 --- a/shader.cc +++ b/shader.cc @@ -6,6 +6,9 @@ Shader::Shader(std::string filePath, Model model) { reference->use(); } +Shader::Shader() { +} + Shader::~Shader() { } diff --git a/shader.hh b/shader.hh index d7ad0df..9c264ce 100644 --- a/shader.hh +++ b/shader.hh @@ -8,6 +8,7 @@ class Shader { public: Shader(std::string filePath, Model model); + Shader(); ACGL::OpenGL::SharedShaderProgram getReference(); ~Shader(); private: diff --git a/texture.cc b/texture.cc index 36dd1af..69aa5d0 100644 --- a/texture.cc +++ b/texture.cc @@ -4,6 +4,9 @@ Texture::Texture(std::string filePath) { reference = ACGL::OpenGL::Texture2DFileManager::the()->get(ACGL::OpenGL::Texture2DCreator(filePath)); } +Texture::Texture() { +} + Texture::~Texture() { } diff --git a/texture.hh b/texture.hh index 65f7385..3de1717 100644 --- a/texture.hh +++ b/texture.hh @@ -9,6 +9,7 @@ class Texture{ public: Texture(std::string filePath); + Texture(); ACGL::OpenGL::SharedTexture2D getReference(); ~Texture(); private: