Raygui textures with SetShapesTexture.

This commit is contained in:
jussi
2023-11-30 02:50:00 +02:00
parent 8882d2ff2c
commit aa03fffcb3
15 changed files with 329 additions and 82 deletions

View File

@@ -1090,7 +1090,7 @@ bool luaCallMain() {
}
void luaCallProcess() {
#ifdef PLATFORM_DESKTOP_SDL
platformSendEvents();
#endif
@@ -1508,6 +1508,7 @@ void luaRegister() {
assingGlobalFunction( "ImageDraw", ltexturesImageDraw );
assingGlobalFunction( "ImageDrawTextEx", ltexturesImageDrawTextEx );
/* Texture loading functions. */
assingGlobalFunction( "GetTextureDefault", ltexturesGetTextureDefault );
assingGlobalFunction( "LoadTexture", ltexturesLoadTexture );
assingGlobalFunction( "LoadTextureFromImage", ltexturesLoadTextureFromImage );
assingGlobalFunction( "LoadTextureCubemap", ltexturesLoadTextureCubemap );

View File

@@ -30,6 +30,7 @@ bool stateInit( int argn, const char **argc, const char *exePath ) {
}
state->defaultFont = GetFontDefault();
state->defaultMaterial = LoadMaterialDefault();
state->defaultTexture = (Texture){ 1, 1, 1, 1, 7 };
state->RLGLcurrentShaderLocs = malloc( RL_MAX_SHADER_LOCATIONS * sizeof( int ) );
int *defaultShaderLocs = rlGetShaderLocsDefault();

View File

@@ -162,9 +162,11 @@ bool wordWrap, Color *tints, int tintCount, Color *backTints, int backTintCount
*/
/*
> RL.GetFontDefault()
> font = RL.GetFontDefault()
Get the default Font. Return as lightuserdata
- Success return Font
*/
int ltextGetFontDefault( lua_State *L ) {
lua_pushlightuserdata( L, &state->defaultFont );

View File

@@ -1035,6 +1035,19 @@ int ltexturesImageDrawTextEx( lua_State *L ) {
## Textures - Texture loading functions
*/
/*
> texture = RL.GetTextureDefault()
Get default texture. Return as lightuserdata
- Success return Texture
*/
int ltexturesGetTextureDefault( lua_State *L ) {
lua_pushlightuserdata( L, &state->defaultTexture );
return 1;
}
/*
> texture = RL.LoadTexture( string fileName )