summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-01-18 02:08:01 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-01-18 02:08:01 +0000
commit627aa88ad2559f41d5be62d36cdbf536a97e4246 (patch)
tree0e98c2e9c39db6ecc88ecf1914af608241d7c18e /gfx
parentHelpers can be static (diff)
downloadilt-627aa88ad2559f41d5be62d36cdbf536a97e4246.tar.bz2
ilt-627aa88ad2559f41d5be62d36cdbf536a97e4246.tar.xz
ilt-627aa88ad2559f41d5be62d36cdbf536a97e4246.zip
Factor to support worlds, objects, windows etc
Diffstat (limited to 'gfx')
-rw-r--r--gfx/gl/transform.h6
-rw-r--r--gfx/models/mesh.cpp2
-rw-r--r--gfx/models/mesh.h2
3 files changed, 8 insertions, 2 deletions
diff --git a/gfx/gl/transform.h b/gfx/gl/transform.h
index 07040ae..70fe38f 100644
--- a/gfx/gl/transform.h
+++ b/gfx/gl/transform.h
@@ -19,6 +19,12 @@ public:
return pos;
}
+ [[nodiscard]] inline const glm::vec3 &
+ GetPos() const
+ {
+ return pos;
+ }
+
[[nodiscard]] inline glm::vec3 &
GetRot()
{
diff --git a/gfx/models/mesh.cpp b/gfx/models/mesh.cpp
index 8c304b3..df48e8d 100644
--- a/gfx/models/mesh.cpp
+++ b/gfx/models/mesh.cpp
@@ -65,7 +65,7 @@ Mesh::~Mesh()
}
void
-Mesh::Draw()
+Mesh::Draw() const
{
glBindVertexArray(m_vertexArrayObject);
diff --git a/gfx/models/mesh.h b/gfx/models/mesh.h
index 453e54a..6dc5c32 100644
--- a/gfx/models/mesh.h
+++ b/gfx/models/mesh.h
@@ -22,7 +22,7 @@ public:
NO_COPY(Mesh);
NO_MOVE(Mesh);
- void Draw();
+ void Draw() const;
private:
static constexpr unsigned int NUM_BUFFERS {4};