From: Mikko Rasa Date: Tue, 26 Jan 2021 23:49:00 +0000 (+0200) Subject: Remove the usage member from Buffer entirely X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=344dd6a52b55d847f3346e94ec266a8864764b9d;p=libs%2Fgl.git Remove the usage member from Buffer entirely --- diff --git a/source/buffer.cpp b/source/buffer.cpp index 46afb273..56705b87 100644 --- a/source/buffer.cpp +++ b/source/buffer.cpp @@ -18,7 +18,6 @@ BufferType buffer_types[] = { ARRAY_BUFFER, ELEMENT_ARRAY_BUFFER, PIXEL_PACK_BUF Buffer::Buffer(BufferType t): type(t), - usage(STATIC_DRAW), size(0) { require_buffer_type(type); @@ -67,10 +66,8 @@ void Buffer::storage(unsigned sz) } } -void Buffer::set_usage(BufferUsage u) +void Buffer::set_usage(BufferUsage) { - // TODO OpenGL ES 2.0 doesn't support read or copy usages - usage = u; } void Buffer::data(const void *d) @@ -82,11 +79,11 @@ void Buffer::data(const void *d) return sub_data(0, size, d); if(ARB_direct_state_access) - glNamedBufferData(id, size, d, usage); + glNamedBufferData(id, size, d, STATIC_DRAW); else { BindRestore _bind(this, type); - glBufferData(type, size, d, usage); + glBufferData(type, size, d, STATIC_DRAW); } } diff --git a/source/buffer.h b/source/buffer.h index b0f23ef2..cc5e5874 100644 --- a/source/buffer.h +++ b/source/buffer.h @@ -63,7 +63,6 @@ class Buffer private: BufferType type; - BufferUsage usage; unsigned id; unsigned size;