]> git.tdb.fi Git - libs/gl.git/commitdiff
Remove the usage member from Buffer entirely
authorMikko Rasa <tdb@tdb.fi>
Tue, 26 Jan 2021 23:49:00 +0000 (01:49 +0200)
committerMikko Rasa <tdb@tdb.fi>
Tue, 26 Jan 2021 23:49:00 +0000 (01:49 +0200)
source/buffer.cpp
source/buffer.h

index 46afb273deacde9611ce29801de2684809f1927f..56705b8701b88a00b691bf25725d10042554679a 100644 (file)
@@ -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);
        }
 }
 
index b0f23ef26cbbce70bc3a880fdfb85488e9995f7b..cc5e58741c141f1fd5910e1abda23ec68a650a39 100644 (file)
@@ -63,7 +63,6 @@ class Buffer
 
 private:
        BufferType type;
-       BufferUsage usage;
        unsigned id;
        unsigned size;