From 3343369732bc6ee9b916c556416362c88c49efa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20F=C3=BCndgens?= Date: Fri, 14 Nov 2014 17:34:50 +0100 Subject: [PATCH] Added constructor with SharedVertexArrayObject argument --- model.cc | 8 +++----- model.hh | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/model.cc b/model.cc index 1800572..22e0e7c 100644 --- a/model.cc +++ b/model.cc @@ -2,14 +2,12 @@ Model::Model(std::string filePath, float scale) { reference = ACGL::OpenGL::VertexArrayObjectCreator(filePath).create(); - reference->bind(); this->scale = scale; } -Model::Model(std::string filePath) { - reference = ACGL::OpenGL::VertexArrayObjectCreator(filePath).create(); - reference->bind(); - this->scale = 1.0f; +Model::Model(ACGL::OpenGL::SharedVertexArrayObject vao, float scale){ + reference = vao; + this->scale = scale; } Model::Model(){ diff --git a/model.hh b/model.hh index 70391d6..e73c4e9 100644 --- a/model.hh +++ b/model.hh @@ -6,8 +6,8 @@ class Model { public: - Model(std::string filePath, float scale); - Model(std::string filePath); + Model(std::string filePath, float scale=1.0f); + Model(ACGL::OpenGL::SharedVertexArrayObject vao, float scale=1.0f); Model(); ~Model(); ACGL::OpenGL::SharedVertexArrayObject getReference();