summaryrefslogtreecommitdiff
path: root/API.md
diff options
context:
space:
mode:
authorjussi2024-11-21 23:25:28 +0200
committerjussi2024-11-21 23:25:28 +0200
commitc9ebe23d6282e96b410dc7687e0be1c4f3ba1b4d (patch)
treedfd26a87fb2b2f702f77728b98a1e6c193684631 /API.md
parentd96e33bb1772c28f630de32e09201c0cdea6f896 (diff)
downloadreilua-enhanced-c9ebe23d6282e96b410dc7687e0be1c4f3ba1b4d.tar.gz
reilua-enhanced-c9ebe23d6282e96b410dc7687e0be1c4f3ba1b4d.tar.bz2
reilua-enhanced-c9ebe23d6282e96b410dc7687e0be1c4f3ba1b4d.zip
RL.config and InitWindow.
Diffstat (limited to 'API.md')
-rw-r--r--API.md21
1 files changed, 17 insertions, 4 deletions
diff --git a/API.md b/API.md
index 717375d..06c70e0 100644
--- a/API.md
+++ b/API.md
@@ -2,12 +2,12 @@
## Functions
-Application needs 'main.lua' or 'main' file as entry point. ReiLua executable will first look it from same directory. Alternatively, path to the folder where "main.lua" is located can be given as argument. There are five Lua functions that the framework will call, 'RL.init', 'RL.update', 'RL.draw', 'RL.event', 'RL.log', and 'RL.exit'.
+Application needs 'main.lua' or 'main' file as entry point. ReiLua executable will first look it from same directory. Alternatively, path to the folder where "main.lua" is located can be given as argument. There are seven Lua functions that the framework will call, 'RL.init', 'RL.update', 'RL.draw', 'RL.event', 'RL.log', 'RL.exit' and 'RL.config'.
---
> function RL.init()
-This function will be called first when 'main.lua' is found
+This function will be called after window has been initialized. Should be used as the main init point.
---
@@ -41,6 +41,12 @@ This function will be called on program close. Cleanup could be done here.
---
+> function RL.config()
+
+This function will be called before InitWindow. Note! Only place where you should call InitWindow manually. Doesn't have OpenGL context at this point.
+
+---
+
## Object unloading
Some objects allocate memory that needs to be freed when object is no longer needed. By default objects like Textures are unloaded by the Lua garbage collector. It is generatty however recommended to handle this manually in more complex projects. You can change the behavior with SetGCUnload.
@@ -3764,6 +3770,13 @@ assignGlobalInt = nil
---
+> 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
+
+---
+
> RL.CloseWindow()
Close window and unload OpenGL context and free all resources
@@ -3850,13 +3863,13 @@ Clear window configuration state flags (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZA
> RL.ToggleFullscreen()
-Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)
+Toggle window state: fullscreen/windowed, resizes monitor to match window resolution
---
> RL.ToggleBorderlessWindowed()
-Toggle window state: borderless windowed (only PLATFORM_DESKTOP)
+Toggle window state: borderless windowed, resizes window to match monitor resolution
---