mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-12 23:23:34 +00:00
fixing issue with fonts vulkan descriptor destroyed
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/10/04 22:10:52 by maldavid #+# #+# */
|
||||
/* Updated: 2024/01/07 01:31:44 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/12/27 21:30:10 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -38,19 +38,12 @@ namespace mlx::core
|
||||
{
|
||||
_in->update();
|
||||
|
||||
Render_Core::get().getSingleTimeCmdManager().updateSingleTimesCmdBuffersSubmitState();
|
||||
|
||||
if(_loop_hook)
|
||||
_loop_hook(_param);
|
||||
|
||||
for(auto& gs : _graphics)
|
||||
gs->render();
|
||||
}
|
||||
for(auto& gs : _graphics)
|
||||
{
|
||||
for(int i = 0; i < MAX_FRAMES_IN_FLIGHT; i++)
|
||||
gs->getRenderer().getCmdBuffer(i).waitForExecution();
|
||||
}
|
||||
}
|
||||
|
||||
void* Application::newTexture(int w, int h)
|
||||
@@ -71,16 +64,9 @@ namespace mlx::core
|
||||
|
||||
void Application::destroyTexture(void* ptr)
|
||||
{
|
||||
if(ptr == nullptr)
|
||||
{
|
||||
core::error::report(e_kind::error, "wrong texture (NULL)");
|
||||
return;
|
||||
}
|
||||
vkDeviceWaitIdle(Render_Core::get().getDevice().get()); // TODO : synchronize with another method than stopping all the GPU process
|
||||
Texture* texture = static_cast<Texture*>(ptr);
|
||||
if(!texture->isInit())
|
||||
core::error::report(e_kind::error, "trying to destroy a texture that has already been destroyed");
|
||||
else
|
||||
texture->destroy();
|
||||
texture->destroy();
|
||||
}
|
||||
|
||||
Application::~Application()
|
||||
|
||||
@@ -64,6 +64,11 @@ namespace mlx::core
|
||||
_graphics.emplace_back(std::make_unique<GraphicsSupport>(w, h, reinterpret_cast<Texture*>(const_cast<char*>(title)), _graphics.size()));
|
||||
else
|
||||
{
|
||||
if(title == NULL)
|
||||
{
|
||||
core::error::report(e_kind::fatal_error, "invalid window title (NULL)");
|
||||
return nullptr;
|
||||
}
|
||||
_graphics.emplace_back(std::make_unique<GraphicsSupport>(w, h, title, _graphics.size()));
|
||||
_in->addWindow(_graphics.back()->getWindow());
|
||||
}
|
||||
@@ -91,6 +96,16 @@ namespace mlx::core
|
||||
void Application::stringPut(void* win, int x, int y, int color, char* str)
|
||||
{
|
||||
CHECK_WINDOW_PTR(win);
|
||||
if(str == nullptr)
|
||||
{
|
||||
core::error::report(e_kind::error, "wrong text (NULL)");
|
||||
return;
|
||||
}
|
||||
if(std::strlen(str) == 0)
|
||||
{
|
||||
core::error::report(e_kind::error, "trying to put an empty text");
|
||||
return;
|
||||
}
|
||||
_graphics[*static_cast<int*>(win)]->stringPut(x, y, color, str);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user