diff options
| author | jussi | 2023-10-30 22:40:20 +0200 |
|---|---|---|
| committer | jussi | 2023-10-30 22:40:20 +0200 |
| commit | c3295e014d979c0213b3fb7e4837b5356bc8fdb4 (patch) | |
| tree | 66ee22c7140761a17bf174d71fecfb94c1378b1d /src/textures.c | |
| parent | 6e0d577d63b221797cdc7f392718dd1c4fb384b4 (diff) | |
| download | reilua-enhanced-c3295e014d979c0213b3fb7e4837b5356bc8fdb4.tar.gz reilua-enhanced-c3295e014d979c0213b3fb7e4837b5356bc8fdb4.tar.bz2 reilua-enhanced-c3295e014d979c0213b3fb7e4837b5356bc8fdb4.zip | |
Reintroducing Unload functions. Is*Ready functions. GC_UNLOAD setting and check function.
Diffstat (limited to 'src/textures.c')
| -rw-r--r-- | src/textures.c | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/src/textures.c b/src/textures.c index abfdf01..9f65ab5 100644 --- a/src/textures.c +++ b/src/textures.c @@ -55,6 +55,34 @@ int ltexturesLoadImageFromScreen( lua_State *L ) { } /* +> isReady = RL.IsImageReady( Image image ) + +Check if an image is ready + +- Success return bool +*/ +int ltextureIsImageReady( lua_State *L ) { + Image *image = uluaGetImage( L, 1 ); + + lua_pushboolean( L, IsImageReady( *image ) ); + + return 1; +} + +/* +> RL.UnloadImage( Image image ) + +Unload image from CPU memory (RAM) +*/ +int ltextureUnloadImage( lua_State *L ) { + Image *image = uluaGetImage( L, 1 ); + + UnloadImage( *image ); + + return 0; +} + +/* > success = RL.ExportImage( Image image, string fileName ) Export image data to file, returns true on success @@ -1042,6 +1070,47 @@ int ltexturesIsTextureReady( lua_State *L ) { } /* +> RL.UnloadTexture( Texture texture ) + +Unload texture from GPU memory (VRAM) +*/ +int ltextureUnloadTexture( lua_State *L ) { + Texture *texture = uluaGetTexture( L, 1 ); + + UnloadTexture( *texture ); + + return 0; +} + +/* +> isReady = RL.IsRenderTextureReady( RenderTexture target ) + +Check if a render texture is ready + +- Success return bool +*/ +int ltexturesIsRenderTextureReady( lua_State *L ) { + RenderTexture *target = uluaGetRenderTexture( L, 1 ); + + lua_pushboolean( L, IsRenderTextureReady( *target ) ); + + return 1; +} + +/* +> RL.UnloadRenderTexture( RenderTexture target ) + +Unload render texture from GPU memory (VRAM) +*/ +int ltextureUnloadRenderTexture( lua_State *L ) { + RenderTexture *target = uluaGetRenderTexture( L, 1 ); + + UnloadRenderTexture( *target ); + + return 0; +} + +/* > RL.UpdateTexture( Texture texture, int{} pixels ) Update GPU texture with new data |
