mirror of
https://github.com/raysan5/raylib.git
synced 2025-10-03 08:28:30 +00:00
ADDED: IsModelReady(), IsMaterialReady(), IsTextureReady(), IsRenderTextureReady() (#2895)
This commit is contained in:
@@ -505,7 +505,7 @@ Image LoadImageFromScreen(void)
|
||||
// Check if an image is ready
|
||||
bool IsImageReady(Image image)
|
||||
{
|
||||
return image.data != NULL;
|
||||
return image.data != NULL && image.width > 0 && image.height > 0 && image.format > 0;
|
||||
}
|
||||
|
||||
// Unload image from CPU memory (RAM)
|
||||
@@ -3330,6 +3330,12 @@ RenderTexture2D LoadRenderTexture(int width, int height)
|
||||
return target;
|
||||
}
|
||||
|
||||
// Check if a texture is ready
|
||||
bool IsTextureReady(Texture2D texture)
|
||||
{
|
||||
return texture.id > 0 && texture.width > 0 && texture.height > 0 && texture.format > 0;
|
||||
}
|
||||
|
||||
// Unload texture from GPU memory (VRAM)
|
||||
void UnloadTexture(Texture2D texture)
|
||||
{
|
||||
@@ -3341,6 +3347,12 @@ void UnloadTexture(Texture2D texture)
|
||||
}
|
||||
}
|
||||
|
||||
// Check if a render texture is ready
|
||||
bool IsRenderTextureReady(RenderTexture2D target)
|
||||
{
|
||||
return target.id > 0 && IsTextureReady(target.depth) && IsTextureReady(target.texture);
|
||||
}
|
||||
|
||||
// Unload render texture from GPU memory (VRAM)
|
||||
void UnloadRenderTexture(RenderTexture2D target)
|
||||
{
|
||||
|
Reference in New Issue
Block a user