summaryrefslogtreecommitdiff
path: root/honey/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'honey/init.lua')
-rw-r--r--honey/init.lua29
1 files changed, 29 insertions, 0 deletions
diff --git a/honey/init.lua b/honey/init.lua
new file mode 100644
index 0000000..c3dda37
--- /dev/null
+++ b/honey/init.lua
@@ -0,0 +1,29 @@
+local glfw = honey.glfw
+local gl = honey.gl
+local window = require 'honey.window'
+
+local hinit = {}
+setmetatable(hinit, {__index=_G})
+setfenv(1, hinit)
+
+
+function init(width, height, title)
+ local width = width or 640
+ local height = height or 480
+ local title = title or "honey3d"
+
+ glfw.Init()
+ local window = honey.Window(width, height, title)
+ glfw.MakeContextCurrent(window.win)
+ gl.InitGlad()
+
+ return window
+end
+
+
+function terminate()
+ glfw.Terminate()
+end
+
+
+return hinit