summaryrefslogtreecommitdiff
path: root/src/core.c
diff options
context:
space:
mode:
authorjussi2024-11-21 23:25:28 +0200
committerjussi2024-11-21 23:25:28 +0200
commitc9ebe23d6282e96b410dc7687e0be1c4f3ba1b4d (patch)
treedfd26a87fb2b2f702f77728b98a1e6c193684631 /src/core.c
parentd96e33bb1772c28f630de32e09201c0cdea6f896 (diff)
downloadreilua-enhanced-c9ebe23d6282e96b410dc7687e0be1c4f3ba1b4d.tar.gz
reilua-enhanced-c9ebe23d6282e96b410dc7687e0be1c4f3ba1b4d.tar.bz2
reilua-enhanced-c9ebe23d6282e96b410dc7687e0be1c4f3ba1b4d.zip
RL.config and InitWindow.
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/core.c b/src/core.c
index c3c07c5..3ca5a3e 100644
--- a/src/core.c
+++ b/src/core.c
@@ -29,6 +29,21 @@ void unloadBuffer( Buffer* buffer ) {
*/
/*
+> 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()
Close window and unload OpenGL context and free all resources
@@ -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();