macrolibchange cout prout + movement working
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/10/06 18:28:08 by maldavid #+# #+# */
|
||||
/* Updated: 2023/11/10 08:33:52 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/12/12 22:17:14 by kbz_8 ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -18,7 +18,10 @@ namespace mlx
|
||||
void VBO::setData(uint32_t size, const void* data)
|
||||
{
|
||||
if(size > getSize())
|
||||
{
|
||||
core::error::report(e_kind::error, "Vulkan : trying to store to much data in a vertex buffer (%d bytes in %d bytes)", size, getSize());
|
||||
return;
|
||||
}
|
||||
|
||||
if(data == nullptr)
|
||||
core::error::report(e_kind::warning, "Vulkan : mapping null data in a vertex buffer");
|
||||
@ -28,4 +31,25 @@ namespace mlx
|
||||
std::memcpy(temp, data, static_cast<size_t>(size));
|
||||
unmapMem();
|
||||
}
|
||||
|
||||
void D_VBO::setData(uint32_t size, const void* data)
|
||||
{
|
||||
if(size > getSize())
|
||||
{
|
||||
core::error::report(e_kind::error, "Vulkan : trying to store to much data in a vertex buffer (%d bytes in %d bytes)", size, getSize());
|
||||
return;
|
||||
}
|
||||
|
||||
if(data == nullptr)
|
||||
core::error::report(e_kind::warning, "Vulkan : mapping null data in a vertex buffer");
|
||||
|
||||
Buffer tmp_buf;
|
||||
#ifdef DEBUG
|
||||
tmp_buf.create(Buffer::kind::dynamic, size, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT, "tmp_buffer", data);
|
||||
#else
|
||||
tmp_buf.create(Buffer::kind::dynamic, size, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT, nullptr, data);
|
||||
#endif
|
||||
copyFromBuffer(tmp_buf);
|
||||
tmp_buf.destroy();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user