refactor a bit into pxl8 sys struct
This commit is contained in:
parent
b2682a2d40
commit
f19b06d705
10 changed files with 217 additions and 148 deletions
|
|
@ -13,7 +13,7 @@ local world = require("pxl8.world")
|
|||
local transition = require("pxl8.transition")
|
||||
local anim = require("pxl8.anim")
|
||||
|
||||
core.init(_pxl8_game, _pxl8_gfx, _pxl8_input, _pxl8_ui)
|
||||
core.init(_pxl8_gfx, _pxl8_input, _pxl8_sys, _pxl8_ui)
|
||||
|
||||
local pxl8 = {}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,15 +3,15 @@ local C = ffi.C
|
|||
|
||||
local core = {}
|
||||
|
||||
function core.init(game_ptr, gfx_ptr, input_ptr, ui_ptr)
|
||||
core.game = game_ptr
|
||||
function core.init(gfx_ptr, input_ptr, sys_ptr, ui_ptr)
|
||||
core.gfx = gfx_ptr
|
||||
core.input = input_ptr
|
||||
core.sys = sys_ptr
|
||||
core.ui = ui_ptr
|
||||
end
|
||||
|
||||
function core.get_fps()
|
||||
return C.pxl8_game_get_fps(core.game)
|
||||
return C.pxl8_get_fps(core.sys)
|
||||
end
|
||||
|
||||
function core.get_width()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue