From c9ebe23d6282e96b410dc7687e0be1c4f3ba1b4d Mon Sep 17 00:00:00 2001 From: jussi Date: Thu, 21 Nov 2024 23:25:28 +0200 Subject: RL.config and InitWindow. --- src/core.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/core.c') diff --git a/src/core.c b/src/core.c index c3c07c5..3ca5a3e 100644 --- a/src/core.c +++ b/src/core.c @@ -28,6 +28,21 @@ void unloadBuffer( Buffer* buffer ) { ## Core - Window-related functions */ +/* +> RL.InitWindow( Vector2 size, string title ) + +Initialize window and OpenGL context. Note! Should be called only in RL.config. +InitWindow will still be called automatically before RL.init +*/ +int lcoreInitWindow( lua_State* L ) { + Vector2 size = uluaGetVector2( L, 1 ); + const char* title = lua_tostring( L, 2 ); + + InitWindow( (int)size.x, (int)size.y, title ); + + return 0; +} + /* > RL.CloseWindow() @@ -176,7 +191,7 @@ int lcoreClearWindowState( lua_State* L ) { /* > RL.ToggleFullscreen() -Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP) +Toggle window state: fullscreen/windowed, resizes monitor to match window resolution */ int lcoreToggleFullscreen( lua_State* L ) { ToggleFullscreen(); @@ -187,7 +202,7 @@ int lcoreToggleFullscreen( lua_State* L ) { /* > RL.ToggleBorderlessWindowed() -Toggle window state: borderless windowed (only PLATFORM_DESKTOP) +Toggle window state: borderless windowed, resizes window to match monitor resolution */ int lcoreToggleBorderlessWindowed( lua_State* L ) { ToggleBorderlessWindowed(); -- cgit v1.2.3