summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Goodliffe <dan.goodliffe@octal.co.uk>2026-01-07 16:14:30 +0000
committerDan Goodliffe <dan.goodliffe@octal.co.uk>2026-01-07 16:14:30 +0000
commitec5fa075e5e69edfe6c301f7088a164d5651d278 (patch)
tree575e69f6ffc0cceb775216e5dd46234fb553fac0 /lib
parentDon't define new diagnostic variants locally (diff)
downloadilt-ec5fa075e5e69edfe6c301f7088a164d5651d278.tar.bz2
ilt-ec5fa075e5e69edfe6c301f7088a164d5651d278.tar.xz
ilt-ec5fa075e5e69edfe6c301f7088a164d5651d278.zip
Always GL_DYNAMIC_DRAW in glMappedBufferWriter
Addresses performance warning from using GL_STATIC_DRAW.
Diffstat (limited to 'lib')
-rw-r--r--lib/glMappedBufferWriter.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/glMappedBufferWriter.h b/lib/glMappedBufferWriter.h
index f97d7e1..05540e4 100644
--- a/lib/glMappedBufferWriter.h
+++ b/lib/glMappedBufferWriter.h
@@ -9,10 +9,10 @@ template<typename T> class glMappedBufferWriter {
public:
using difference_type = std::ptrdiff_t;
- glMappedBufferWriter(GLenum target, GLuint buffer, size_t count, GLenum usage = GL_STATIC_DRAW) :
+ glMappedBufferWriter(GLenum target, GLuint buffer, size_t count) :
target {target}, data {[&]() {
glBindBuffer(target, buffer);
- glBufferData(target, static_cast<GLsizeiptr>(sizeof(T) * count), nullptr, usage);
+ glBufferData(target, static_cast<GLsizeiptr>(sizeof(T) * count), nullptr, GL_DYNAMIC_DRAW);
return static_cast<T *>(glMapBuffer(target, GL_WRITE_ONLY));
}()}
{