Browse Source

Merge pull request #4 from bjornbytes/ifs

Use ifs to switch between lovr/love;
John Dodis 11 months ago
parent
commit
6ec7bb9e05
2 changed files with 22 additions and 18 deletions
  1. 15 13
      conf.lua
  2. 7 5
      main.lua

+ 15 - 13
conf.lua

@@ -1,14 +1,16 @@
-function love.conf( t )
-	t.window.width = 1300
-	t.window.height = 600
-	t.window.resizable = true
-	t.console = true
-	t.modules.joystick = false
+if love then
+	function love.conf( t )
+		t.window.width = 1300
+		t.window.height = 600
+		t.window.resizable = true
+		t.console = true
+		t.modules.joystick = false
+	end
+else
+	function lovr.conf( t )
+		t.modules.headset = false
+		t.window.resizable = true
+		t.window.width = 1300
+		t.window.height = 600
+	end
 end
 end
-
--- function lovr.conf( t )
--- 	t.headset = false
--- 	t.window.resizable = true
--- 	t.window.width = 1300
--- 	t.window.height = 600
--- end

+ 7 - 5
main.lua

@@ -1,8 +1,10 @@
 -- Bellow are 2 examples per framework (love/lovr)
 -- Bellow are 2 examples per framework (love/lovr)
 -- "minimal" is the minimal ui2d implementation and "demo" is a demonstration of all widgets in the library
 -- "minimal" is the minimal ui2d implementation and "demo" is a demonstration of all widgets in the library
--- Uncomment just one of the requires bellow
 
 
-require "love_demo"
--- require "love_minimal"
--- require "lovr_demo"
--- require "lovr_minimal"
+if lovr then
+	require "lovr_demo"
+	-- require "lovr_minimal"
+else
+	require "love_demo"
+	-- require "love_minimal"
+end