Getting shaders working with lua.

This commit is contained in:
2026-03-28 21:50:59 -05:00
parent cbb68a399d
commit dbb7e9f53c
49 changed files with 305 additions and 114 deletions

View File

@@ -9,6 +9,7 @@ module('text')
module('tileset')
module('texture')
module('input')
module('shader')
CELL_STATE_DEFAULT = 0
CELL_STATE_HOVER = 1
@@ -179,19 +180,23 @@ end
function sceneUpdate()
x = x + inputAxis(INPUT_ACTION_LEFT, INPUT_ACTION_RIGHT)
y = y + inputAxis(INPUT_ACTION_UP, INPUT_ACTION_DOWN)
y = y - inputAxis(INPUT_ACTION_UP, INPUT_ACTION_DOWN)
end
function sceneRender()
-- Update camera
cameraPushMatrix(camera)
camera.bottom = screenGetHeight()
camera.right = screenGetWidth()
shaderBind(SHADER_UNLIT)
proj = cameraGetProjectionMatrix(camera)
shaderSetMatrix(SHADER_UNLIT, SHADER_UNLIT_PROJECTION, proj)
view = cameraGetViewMatrix(camera)
shaderSetMatrix(SHADER_UNLIT, SHADER_UNLIT_VIEW, view)
spriteBatchPush(
nil,
x, y, x + 32, y + 32,
x, y,
x + 32, y + 32,
colorWhite()
)
@@ -251,6 +256,4 @@ function sceneRender()
-- end
-- end
spriteBatchFlush()
cameraPopMatrix()
end