fix issue with non const update functions

main
Brett 2025-03-18 19:04:16 -04:00
parent 8a98d76767
commit ac79aa80df
3 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.25)
include(FetchContent)
set(BLT_GRAPHICS_VERSION 1.1.6)
set(BLT_GRAPHICS_VERSION 1.1.7)
set(BLT_GRAPHICS_TEST_VERSION 0.0.1)
project(BLT_WITH_GRAPHICS VERSION ${BLT_GRAPHICS_VERSION})

View File

@ -61,9 +61,9 @@ namespace blt::gfx
allocate(size, mem_type, static_cast<const void*>(data));
}
void sub_update(GLsizeiptr offset, GLsizeiptr size, void* data) const;
void sub_update(GLsizeiptr offset, GLsizeiptr size, const void* data) const;
void update(GLsizeiptr size, void* data);
void update(GLsizeiptr size, const void* data);
void destroy();
};

View File

@ -84,7 +84,7 @@ namespace blt::gfx
memory_type = mem_type;
}
void vertex_buffer_t::update(GLsizeiptr size, void* data)
void vertex_buffer_t::update(GLsizeiptr size, const void* data)
{
if (size <= size_)
sub_update(0, size, data);
@ -93,7 +93,7 @@ namespace blt::gfx
size_ = size;
}
void vertex_buffer_t::sub_update(GLsizeiptr offset, GLsizeiptr size, void* data) const
void vertex_buffer_t::sub_update(GLsizeiptr offset, GLsizeiptr size, const void* data) const
{
bind();
glBufferSubData(buffer_type, offset, size, data);