summaryrefslogtreecommitdiff
path: root/gfx/models
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/models')
-rw-r--r--gfx/models/mesh.cpp7
-rw-r--r--gfx/models/mesh.h3
-rw-r--r--gfx/models/stb_image.impl.c2
3 files changed, 3 insertions, 9 deletions
diff --git a/gfx/models/mesh.cpp b/gfx/models/mesh.cpp
index 1f4dc09..e7474ca 100644
--- a/gfx/models/mesh.cpp
+++ b/gfx/models/mesh.cpp
@@ -1,7 +1,4 @@
#include "mesh.h"
-#include "glArrays.h"
-#include "vertex.h"
-#include <cstddef>
MeshBase::MeshBase(GLsizei m_numIndices, GLenum mode) : m_numIndices {m_numIndices}, mode {mode} { }
@@ -16,11 +13,11 @@ MeshBase::Draw() const
}
void
-MeshBase::DrawInstanced(GLuint vao, GLsizei count) const
+MeshBase::DrawInstanced(GLuint vao, GLsizei count, GLuint base) const
{
glBindVertexArray(vao);
- glDrawElementsInstanced(mode, m_numIndices, GL_UNSIGNED_INT, nullptr, count);
+ glDrawElementsInstancedBaseInstance(mode, m_numIndices, GL_UNSIGNED_INT, nullptr, count, base);
glBindVertexArray(0);
}
diff --git a/gfx/models/mesh.h b/gfx/models/mesh.h
index 71f6dce..248cb8f 100644
--- a/gfx/models/mesh.h
+++ b/gfx/models/mesh.h
@@ -3,7 +3,6 @@
#include "gfx/gl/vertexArrayObject.h"
#include <glArrays.h>
#include <glad/gl.h>
-#include <memory>
#include <span>
#include <stdTypeDefs.h>
@@ -12,7 +11,7 @@ class Vertex;
class MeshBase {
public:
void Draw() const;
- void DrawInstanced(GLuint vao, GLsizei count) const;
+ void DrawInstanced(GLuint vao, GLsizei count, GLuint base = 0) const;
protected:
MeshBase(GLsizei m_numIndices, GLenum mode);
diff --git a/gfx/models/stb_image.impl.c b/gfx/models/stb_image.impl.c
deleted file mode 100644
index 38c72e9..0000000
--- a/gfx/models/stb_image.impl.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#define STB_IMAGE_IMPLEMENTATION
-#include "stb/stb_image.h"