fix issue with non const update functions
parent
8a98d76767
commit
ac79aa80df
|
@ -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})
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue