X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fbuffer.cpp;fp=source%2Fcore%2Fbuffer.cpp;h=71ab6e2387a4d451e3a70c8d76a828cd6a598176;hb=6065f6622cc275dc0b20baaf7c267e71169d18f3;hp=78e85af0456b721a27316d9622849f00a2b37c3e;hpb=c4aeeced7b397d46772577775bd3a0d6c4706cba;p=libs%2Fgl.git diff --git a/source/core/buffer.cpp b/source/core/buffer.cpp index 78e85af0..71ab6e23 100644 --- a/source/core/buffer.cpp +++ b/source/core/buffer.cpp @@ -2,13 +2,12 @@ #include #include #include +#include #include +#include #include #include "buffer.h" -#include "deviceinfo.h" #include "error.h" -#include "misc.h" -#include "vertexsetup.h" using namespace std; @@ -74,10 +73,6 @@ void Buffer::allocate() data(0); } -void Buffer::set_usage(BufferUsage) -{ -} - void Buffer::data(const void *d) { if(size==0) @@ -87,26 +82,16 @@ void Buffer::data(const void *d) return sub_data(0, size, d); if(ARB_direct_state_access) - glNamedBufferData(id, size, d, STATIC_DRAW); + glNamedBufferData(id, size, d, GL_STATIC_DRAW); else { bind_scratch(); - glBufferData(GL_ARRAY_BUFFER, size, d, STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, size, d, GL_STATIC_DRAW); } allocated = true; } -void Buffer::data(unsigned sz, const void *d) -{ - if(size==0) - storage(sz); - else if(sz!=size) - throw incompatible_data("Buffer::data"); - - data(d); -} - void Buffer::sub_data(unsigned off, unsigned sz, const void *d) { if(size==0)