Rendering a moving square entirely from lua.
Some checks failed
Build Dusk / build-linux (push) Has been cancelled
Build Dusk / build-psp (push) Has been cancelled
Build Dusk / run-tests (push) Has been cancelled

This commit is contained in:
2026-01-28 11:01:07 -06:00
parent 6bdb4ae30d
commit 32b41c98e1
7 changed files with 194 additions and 1 deletions

View File

@@ -7,11 +7,18 @@
#include "assert/assert.h"
#include "util/memory.h"
#include "display/camera.h"
#include "display/screen.h"
scene_t SCENE;
camera_t cam;
errorret_t sceneInit(void) {
memoryZero(&SCENE, sizeof(scene_t));
cameraInitOrthographic(&cam);
errorChain(scriptContextInit(&SCENE.scriptContext));
errorOk();
}
@@ -32,9 +39,16 @@ void sceneRender(void) {
return;
}
cam.orthographic.right = SCREEN.width;
cam.orthographic.bottom = SCREEN.height;
cam.orthographic.left = 0.0f;
cam.orthographic.top = 0.0f;
cameraPushMatrix(&cam);
errorret_t err = scriptContextCallFunc(
&SCENE.scriptContext, "sceneRender", NULL, 0, NULL
);
cameraPopMatrix();
errorCatch(errorPrint(err));
}