fixing issue when destroying an image in the loop hook, begenning single time command buffers manager

This commit is contained in:
Kbz-8
2023-12-15 21:08:46 +01:00
parent 8e33b2fa30
commit b28b144edb
12 changed files with 127 additions and 12 deletions

View File

@@ -74,8 +74,16 @@ namespace mlx::core
void Application::texturePut(void* win, void* img, int x, int y)
{
if(img == nullptr)
{
core::error::report(e_kind::error, "wrong texture (NULL)");
return;
}
Texture* texture = static_cast<Texture*>(img);
_graphics[*static_cast<int*>(win)]->texturePut(texture, x, y);
if(!texture->isInit())
core::error::report(e_kind::error, "trying to put a texture that has been destroyed");
else
_graphics[*static_cast<int*>(win)]->texturePut(texture, x, y);
}
int Application::getTexturePixel(void* img, int x, int y)