From be39fd96344ee1f4f85ac5c63b4e5f9daf6e5171 Mon Sep 17 00:00:00 2001 From: jussi Date: Tue, 31 Oct 2023 15:24:11 +0200 Subject: GlyphInfo type. Some new text and core functions. --- src/lua_core.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src/lua_core.c') diff --git a/src/lua_core.c b/src/lua_core.c index cb91583..90ed9ba 100644 --- a/src/lua_core.c +++ b/src/lua_core.c @@ -1504,6 +1504,8 @@ void luaRegister() { assingGlobalFunction( "SetWindowMonitor", lcoreSetWindowMonitor ); assingGlobalFunction( "SetWindowPosition", lcoreSetWindowPosition ); assingGlobalFunction( "SetWindowSize", lcoreSetWindowSize ); + assingGlobalFunction( "SetWindowOpacity", lcoreSetWindowOpacity ); + assingGlobalFunction( "GetWindowHandle", lcoreGetWindowHandle ); assingGlobalFunction( "SetWindowMinSize", lcoreSetWindowMinSize ); assingGlobalFunction( "GetMonitorPosition", lcoreGetMonitorPosition ); assingGlobalFunction( "GetMonitorSize", lcoreGetMonitorSize ); @@ -1514,6 +1516,7 @@ void luaRegister() { assingGlobalFunction( "ClearWindowState", lcoreClearWindowState ); assingGlobalFunction( "IsWindowResized", lcoreIsWindowResized ); assingGlobalFunction( "SetWindowIcon", lcoreSetWindowIcon ); + assingGlobalFunction( "SetWindowIcons", lcoreSetWindowIcons ); assingGlobalFunction( "SetWindowTitle", lcoreSetWindowTitle ); assingGlobalFunction( "GetMonitorCount", lcoreGetMonitorCount ); assingGlobalFunction( "GetCurrentMonitor", lcoreGetCurrentMonitor ); @@ -1936,9 +1939,15 @@ void luaRegister() { /* Drawing. */ assingGlobalFunction( "DrawFPS", ltextDrawFPS ); assingGlobalFunction( "DrawText", ltextDrawText ); + assingGlobalFunction( "DrawTextEx", ltextDrawTextEx ); assingGlobalFunction( "DrawTextPro", ltextDrawTextPro ); - /* Misc. */ + assingGlobalFunction( "DrawTextCodepoint", ltextDrawTextCodepoint ); + assingGlobalFunction( "DrawTextCodepoints", ltextDrawTextCodepoints ); + /* Font info functions. */ assingGlobalFunction( "MeasureText", ltextMeasureText ); + assingGlobalFunction( "GetGlyphIndex", ltextGetGlyphIndex ); + assingGlobalFunction( "GetGlyphInfo", ltextGetGlyphInfo ); + assingGlobalFunction( "GetGlyphAtlasRec", ltextGetGlyphAtlasRec ); assingGlobalFunction( "GetFontBaseSize", ltextGetFontBaseSize ); assingGlobalFunction( "GetFontGlyphCount", ltextGetFontGlyphCount ); assingGlobalFunction( "GetFontGlyphPadding", ltextGetFontGlyphPadding ); @@ -3129,6 +3138,20 @@ void uluaPushBoundingBox( lua_State *L, BoundingBox box ) { lua_rawseti( L, -2, 2 ); } +void uluaPushGlyphInfo( lua_State *L, GlyphInfo glyphInfo, Image *image ) { + lua_createtable( L, 4, 0 ); + lua_pushinteger( L, glyphInfo.value ); + lua_setfield( L, -2, "value" ); + lua_pushinteger( L, glyphInfo.offsetX ); + lua_setfield( L, -2, "offsetX" ); + lua_pushinteger( L, glyphInfo.offsetY ); + lua_setfield( L, -2, "offsetY" ); + lua_pushinteger( L, glyphInfo.advanceX ); + lua_setfield( L, -2, "advanceX" ); + lua_pushlightuserdata( L, image ); + lua_setfield( L, -2, "image" ); +} + void uluaPushBuffer( lua_State *L, Buffer buffer ) { Buffer *bufferP = lua_newuserdata( L, sizeof( Buffer ) ); *bufferP = buffer; -- cgit v1.2.3