-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.lua
executable file
·30 lines (26 loc) · 1 KB
/
run.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env luajit
local cmdline = require 'ext.cmdline'(...)
--[[ specify GL version first:
require 'gl.setup'() -- for desktop GL. Windows needs this.
--require 'gl.setup' 'OpenGLES1' -- for GLES1 ... but GLES1 has no shaders afaik?
--require 'gl.setup' 'OpenGLES2' -- for GLES2
--require 'gl.setup' 'OpenGLES3' -- for GLES3. Linux or Raspberry Pi can handle this.
--]]
-- [[ pick gl vs gles based on OS (Linux has GLES and includes embedded)
local glfn = nil -- default gl
local ffi = require 'ffi'
if ffi.os == 'Linux' then
glfn = 'OpenGLES3' -- linux / raspi (which is also classified under ffi.os == 'Linux') can use GLES3
end
if cmdline.gl ~= nil then -- allow cmdline override
glfn = cmdline.gl
end
require 'gl.setup'(glfn)
--]]
if not pcall(require, 'socket') then
print("WARNING: can't find luasocket -- you won't be able to submit highscores")
end
local App = require 'sand-attack.app'
App.cfgfilename = cmdline.config or App.cfgfilename
App.skipCustomFont = cmdline.skipCustomFont
return App():run()