adding multiple mapping support on textures

This commit is contained in:
kbz_8
2023-04-23 22:11:44 +02:00
parent 77f707ca7a
commit 4edd619841
20 changed files with 133 additions and 89 deletions

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 22:10:52 by maldavid #+# #+# */
/* Updated: 2023/04/21 19:24:35 by maldavid ### ########.fr */
/* Updated: 2023/04/22 19:39:59 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -37,14 +37,12 @@ namespace mlx::core
void* Application::newTexture(int w, int h)
{
_textures.emplace_front().create(nullptr, w, h, VK_FORMAT_R8G8B8A8_UNORM);
_textures.front().openCPUmap();
return &_textures.front();
}
void* Application::newStbTexture(char* file, int* w, int* h)
{
_textures.emplace_front(stbTextureLoad(file, w, h));
_textures.front().openCPUmap();
return &_textures.front();
}
@@ -55,7 +53,7 @@ namespace mlx::core
*bits_per_pixel = 32;
*size_line = img->getWidth() * 4;
*endian = endianness;
return static_cast<char*>(img->getMap());
return static_cast<char*>(img->openCPUmap());
}
void Application::destroyTexture(void* ptr)