diff --git a/gl/buffer.cpp b/gl/buffer.cpp index 0321a70b..8b8bd486 100644 --- a/gl/buffer.cpp +++ b/gl/buffer.cpp @@ -61,19 +61,19 @@ gl::buffer::~buffer() glDeleteBuffers(1, *this); } -void gl::buffer::allocate(targets target, int size, GLenum hint) +void gl::buffer::allocate(targets target, GLsizeiptr size, GLenum hint) { bind(target); glBufferData(glenum_target(target), size, nullptr, hint); } -void gl::buffer::upload(targets target, const void *data, int offset, int size) +void gl::buffer::upload(targets target, const void *data, int offset, GLsizeiptr size) { bind(target); glBufferSubData(glenum_target(target), offset, size, data); } -void gl::buffer::download(targets target, void *data, int offset, int size) +void gl::buffer::download(targets target, void *data, int offset, GLsizeiptr size) { bind(target); if (GLAD_GL_VERSION_3_3) diff --git a/gl/buffer.h b/gl/buffer.h index ee5d91e5..8b4e7d9c 100644 --- a/gl/buffer.h +++ b/gl/buffer.h @@ -39,8 +39,8 @@ namespace gl static void unbind(targets target); static void unbind(); - void allocate(targets target, int size, GLenum hint); - void upload(targets target, const void *data, int offset, int size); - void download(targets target, void *data, int offset, int size); + void allocate(targets target, GLsizeiptr size, GLenum hint); + void upload(targets target, const void *data, int offset, GLsizeiptr size); + void download(targets target, void *data, int offset, GLsizeiptr size); }; } diff --git a/gl/ubo.cpp b/gl/ubo.cpp index 1ef45198..cecf84f0 100644 --- a/gl/ubo.cpp +++ b/gl/ubo.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "ubo.h" -gl::ubo::ubo(int size, int idx, GLenum hint) +gl::ubo::ubo(size_t size, int idx, GLenum hint) { allocate(buffer::UNIFORM_BUFFER, size, hint); index = idx; @@ -13,7 +13,7 @@ void gl::ubo::bind_uniform() bind_base(buffer::UNIFORM_BUFFER, index); } -void gl::ubo::update(const uint8_t *data, int offset, int size) +void gl::ubo::update(const uint8_t *data, int offset, GLsizeiptr size) { upload(buffer::UNIFORM_BUFFER, data, offset, size); } diff --git a/gl/ubo.h b/gl/ubo.h index 8bac33b7..44e13708 100644 --- a/gl/ubo.h +++ b/gl/ubo.h @@ -13,11 +13,11 @@ namespace gl int index; public: - ubo(int size, int index, GLenum hint = GL_DYNAMIC_DRAW); + ubo(size_t size, int index, GLenum hint = GL_DYNAMIC_DRAW); void bind_uniform(); - void update(const uint8_t *data, int offset, int size); + void update(const uint8_t *data, int offset, GLsizeiptr size); template void update(const T &data, size_t offset = 0) { update(reinterpret_cast(&data), offset, sizeof(data));