Added empty constructors to be able to define objects without instanciating them.
This commit is contained in:
parent
c747968b91
commit
11229430cb
@ -3,5 +3,8 @@
|
||||
Entity::Entity(glm::vec3 position, glm::vec3 rotation) {
|
||||
}
|
||||
|
||||
Entity::Entity(){
|
||||
}
|
||||
|
||||
Entity::~Entity(){
|
||||
}
|
||||
|
@ -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);
|
||||
|
3
model.cc
3
model.cc
@ -5,6 +5,9 @@ Model::Model(std::string filePath) {
|
||||
reference->bind();
|
||||
}
|
||||
|
||||
Model::Model(){
|
||||
}
|
||||
|
||||
Model::~Model() {
|
||||
}
|
||||
|
||||
|
1
model.hh
1
model.hh
@ -7,6 +7,7 @@
|
||||
class Model {
|
||||
public:
|
||||
Model(std::string filePath);
|
||||
Model();
|
||||
~Model();
|
||||
ACGL::OpenGL::SharedVertexArrayObject getReference();
|
||||
private:
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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:
|
||||
|
@ -6,6 +6,9 @@ Shader::Shader(std::string filePath, Model model) {
|
||||
reference->use();
|
||||
}
|
||||
|
||||
Shader::Shader() {
|
||||
}
|
||||
|
||||
Shader::~Shader() {
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
class Shader {
|
||||
public:
|
||||
Shader(std::string filePath, Model model);
|
||||
Shader();
|
||||
ACGL::OpenGL::SharedShaderProgram getReference();
|
||||
~Shader();
|
||||
private:
|
||||
|
@ -4,6 +4,9 @@ Texture::Texture(std::string filePath) {
|
||||
reference = ACGL::OpenGL::Texture2DFileManager::the()->get(ACGL::OpenGL::Texture2DCreator(filePath));
|
||||
}
|
||||
|
||||
Texture::Texture() {
|
||||
}
|
||||
|
||||
Texture::~Texture() {
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
class Texture{
|
||||
public:
|
||||
Texture(std::string filePath);
|
||||
Texture();
|
||||
ACGL::OpenGL::SharedTexture2D getReference();
|
||||
~Texture();
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user