diff options
| author | jussi | 2023-11-30 02:50:00 +0200 |
|---|---|---|
| committer | jussi | 2023-11-30 02:50:00 +0200 |
| commit | aa03fffcb32e4a04589d74273c81316b39afacd9 (patch) | |
| tree | 862f1ebed684982a68221aae94e5384ff4473480 /src | |
| parent | 8882d2ff2c4c77c08a5c5b0931a70ff906ecbdb5 (diff) | |
| download | reilua-enhanced-aa03fffcb32e4a04589d74273c81316b39afacd9.tar.gz reilua-enhanced-aa03fffcb32e4a04589d74273c81316b39afacd9.tar.bz2 reilua-enhanced-aa03fffcb32e4a04589d74273c81316b39afacd9.zip | |
Raygui textures with SetShapesTexture.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lua_core.c | 3 | ||||
| -rw-r--r-- | src/state.c | 1 | ||||
| -rw-r--r-- | src/text.c | 4 | ||||
| -rw-r--r-- | src/textures.c | 13 |
4 files changed, 19 insertions, 2 deletions
diff --git a/src/lua_core.c b/src/lua_core.c index 56162c1..ecd5f75 100644 --- a/src/lua_core.c +++ b/src/lua_core.c @@ -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 ); diff --git a/src/state.c b/src/state.c index 0b4dae8..716bf4e 100644 --- a/src/state.c +++ b/src/state.c @@ -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(); @@ -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 ); diff --git a/src/textures.c b/src/textures.c index ef1e76e..717db91 100644 --- a/src/textures.c +++ b/src/textures.c @@ -1036,6 +1036,19 @@ int ltexturesImageDrawTextEx( lua_State *L ) { */ /* +> 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 ) Load texture from file into GPU memory ( VRAM ) |
