args = ...
collectgarbage('stop')
main 					= {}
ffi = require "ffi"
bit = require "bit"

-- if not pcall(require,'source/load/os') then 
-- 	local wd = ffi.string(rl.GetWorkingDirectory()).."/"
-- 	require = function(file)
-- 		if file == "ffi" then return ffi end
-- 		local path = wd..file:gsub("%.","/")
-- 		local ext = isFile(path) and "/init.lua" or ".lua"
-- 		print(path,ext)
-- 		local succ, loaded = pcall(dofile,path..ext)
-- 		print(succ)
-- 		return loaded
-- 	end
-- end

require 			('source/load/os')()


main_dt  			= 0
time 	 				= 0
pi 		 				= 3.14159265359
math.randomseed(os.time())

ZIP_MODE 			= false
VECTOR_TYPE = 'float'

useFFI 			= true
render3d 		= true
renderWire 	= false
dds 				= true

empty 			= {}
_no_copy 		= {}
_canvases 	= {}
splashScreen= {}

nothing 		= function() end

fonts 	= {
	Inconsolata = {sizes={}, file=LOVR and "fonts/Inconsolata-dz.ttf" or "fonts/Inconsolata.ttf"},
	mplus = {sizes={}, file="fonts/Inconsolata.ttf"}
}


io.stdout:setvbuf 	("no")
cpml = require("source/libs/cpml")
lume 					= require("source/libs/lume")
fuzzy 				= require('source/libs/fuzzy')
-- polywell 			= require("source/libs/polywell")
-- utf8 					= require("source/libs/polywell.utf8")
-- fs_for 				= require("source/libs/polywell.fs")
loveZip 			= love and require("source/libs/love-zip")
bitser 				= require("source/libs/bitser")
iqm   				= love and require("source/libs/iqm")
anim9 				= love and require("source/libs/anim9") or nil
inspect 			= require('source/libs/inspect')
ik 						= require('source/libs/fabrik')
bezier 				= require('source/libs/bezier')
Tserial       = require('source/libs/Tserial')
obj = {load=require "source/libs/obj/modelLoader"}
require('source/libs/color')
require('source/libs/catmull')


-- probe 				= require("source/libs/probe")
-- poly2tri = assert(package.loadlib("source/libs/poly2tri.dylib", 'luaopen_poly2tri'))()
-- require('strict')

require("source/load/engine")
require("source/load/branch")
require ('source/load/init')


engine.run(args)