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(){
}
Entity::~Entity(){
}

View File

@ -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);

View File

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

View File

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

View File

@ -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();
}

View File

@ -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:

View File

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

View File

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

View File

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

View File

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