First texture rendering (if broken)

This commit is contained in:
2026-02-06 12:48:49 -06:00
parent 0d56859d94
commit aa5b41fe31
23 changed files with 226 additions and 179 deletions

View File

@@ -75,32 +75,7 @@ errorret_t sceneSet(const char_t *script) {
// Create a new script context.
errorChain(scriptContextInit(&SCENE.scriptContext));
// errorChain(scriptContextExecFile(&SCENE.scriptContext, script));
errorChain(scriptContextExec(&SCENE.scriptContext,
"module('spritebatch')\n"
"module('camera')\n"
"module('color')\n"
"module('text')\n"
"module('screen')\n"
"module('time')\n"
"module('map')\n"
"module('glm')\n"
"screenSetBackground(colorLime())\n"
"mapCamera = cameraCreate()\n"
"text = 'Hello World'\n"
"function sceneDispose()\n"
"end\n"
"function sceneUpdate()\n"
"end\n"
"function sceneRender()\n"
" mapCamera.position = vec3(32, 32, 32)\n"
" cameraPushMatrix(mapCamera)\n"
" spriteBatchPush(nil, -10, -10, 10, 10, colorBlue())\n"
" spriteBatchFlush()\n"
" cameraPopMatrix()\n"
"end\n"
));
errorChain(scriptContextExecFile(&SCENE.scriptContext, script));
errorOk();
}
@@ -111,6 +86,7 @@ void sceneDispose(void) {
const char_t *strErr = lua_tostring(SCENE.scriptContext.luaState, -1);
lua_pop(SCENE.scriptContext.luaState, 1);
debugPrint("Failed to call function '%s': %s\n", "sceneDispose", strErr);
debugFlush();
}
} else {
lua_pop(SCENE.scriptContext.luaState, 1);