Reintroducing Unload functions. Is*Ready functions. GC_UNLOAD setting and check function.

This commit is contained in:
jussi
2023-10-30 22:40:20 +02:00
parent 6e0d577d63
commit c3295e014d
37 changed files with 853 additions and 646 deletions

View File

@@ -11,10 +11,10 @@
/*
> RL.GetFontDefault()
Get the default Font
Get the default Font. Return as lightuserdata
*/
int ltextGetFontDefault( lua_State *L ) {
uluaPushFont( L, GetFontDefault() );
lua_pushlightuserdata( L, &state->defaultFont );
return 1;
}
@@ -96,6 +96,34 @@ int ltextLoadFontFromImage( lua_State *L ) {
return 1;
}
/*
> isReady = RL.IsFontReady( Font font )
Check if a font is ready
- Success return bool
*/
int ltextIsFontReady( lua_State *L ) {
Font *font = uluaGetFont( L, 1 );
lua_pushboolean( L, IsFontReady( *font ) );
return 1;
}
/*
> RL.UnloadFont( Font font )
Unload font from GPU memory (VRAM)
*/
int ltextUnloadFont( lua_State *L ) {
Font *font = uluaGetFont( L, 1 );
UnloadFont( *font );
return 0;
}
/*
## Text - Draw
*/
@@ -218,14 +246,15 @@ int ltextGetFontGlyphPadding( lua_State *L ) {
/*
> texture = RL.GetFontTexture( Font font )
Get font texture atlas containing the glyphs.
Get font texture atlas containing the glyphs. Returns as lightuserdata
- Success return Texture
*/
int ltextGetFontTexture( lua_State *L ) {
Font *font = uluaGetFont( L, 1 );
uluaPushTexture( L, font->texture );
// uluaPushTexture( L, font->texture );
lua_pushlightuserdata( L, &font->texture );
return 1;
}