Initial commit
This commit is contained in:
commit
ee4762673a
14 changed files with 410 additions and 0 deletions
15
game/platform/dos.lua
Normal file
15
game/platform/dos.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
local platform = {}
|
||||
|
||||
function platform.init()
|
||||
-- TODO: NOOP
|
||||
end
|
||||
|
||||
function platform.drawStart()
|
||||
-- TODO: NOOP
|
||||
end
|
||||
|
||||
function platform.drawEnd()
|
||||
-- TODO: NOOP
|
||||
end
|
||||
|
||||
return platform
|
||||
24
game/platform/native.lua
Normal file
24
game/platform/native.lua
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
local platform = {}
|
||||
|
||||
local screenWidth = 320
|
||||
local screenHeight = 200
|
||||
local screenScale = 2
|
||||
local canvas
|
||||
|
||||
function platform.init()
|
||||
love.graphics.setDefaultFilter("nearest")
|
||||
|
||||
love.window.setMode(screenWidth * screenScale, screenHeight * screenScale, { resizable = false, vsync = true })
|
||||
canvas = love.graphics.newCanvas(screenWidth, screenHeight)
|
||||
end
|
||||
|
||||
function platform.drawStart()
|
||||
love.graphics.setCanvas(canvas)
|
||||
end
|
||||
|
||||
function platform.drawEnd()
|
||||
love.graphics.setCanvas()
|
||||
love.graphics.draw(canvas, 0, 0, 0, screenScale, screenScale)
|
||||
end
|
||||
|
||||
return platform
|
||||
6
game/platform/platform.lua
Normal file
6
game/platform/platform.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
local os = love.system.getOS()
|
||||
if os == 'DOS' then
|
||||
return require 'platform.dos'
|
||||
else
|
||||
return require 'platform.native'
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue