Render text working.

This commit is contained in:
2025-09-02 22:47:07 -05:00
parent 87f18d0e13
commit 1af2b8f47b
19 changed files with 340 additions and 157 deletions

View File

@@ -12,13 +12,25 @@
#include "display/scene/scenemanager.h"
#include "display/mesh/quad.h"
#include "asset/assetmanager.h"
#include "display/ui/rendertext.h"
camera_t SCENE_OVERWORLD_CAMERA;
asset_t *testAsset;
void sceneOverworldInit(void) {
cameraInit(&SCENE_OVERWORLD_CAMERA);
glm_vec3_copy((vec3){32.0f, 32.0f, 32.0f}, SCENE_OVERWORLD_CAMERA.lookat.position);
// glm_vec3_copy((vec3){32.0f, 32.0f, 32.0f}, SCENE_OVERWORLD_CAMERA.lookat.position);
SCENE_OVERWORLD_CAMERA.projType = CAMERA_PROJECTION_TYPE_ORTHOGRAPHIC;
SCENE_OVERWORLD_CAMERA.orthographic.left = 0.0f;
SCENE_OVERWORLD_CAMERA.orthographic.right = 128.0f;
SCENE_OVERWORLD_CAMERA.orthographic.top = 0.0f;
SCENE_OVERWORLD_CAMERA.orthographic.bottom = 72.0f;
SCENE_OVERWORLD_CAMERA.nearClip = -1.0f;
SCENE_OVERWORLD_CAMERA.farClip = 1000.0f;
SCENE_OVERWORLD_CAMERA.viewType = CAMERA_VIEW_TYPE_MATRIX;
glm_mat4_identity(SCENE_OVERWORLD_CAMERA.view);
scene_t *scene = &SCENE_MANAGER_SCENES[SCENE_TYPE_OVERWORLD];
scene->flags |= SCENE_FLAG_ACTIVE | SCENE_FLAG_VISIBLE;
@@ -39,13 +51,14 @@ void sceneOverworldRender(void) {
// Draw entities
// Draw overlay layer.
renderTextDraw(0.0f, 0.0f, "Hello World", 0xFF, 0xFF, 0xFF);
spriteBatchPush(
&testAsset->paletteImage.texture,
0.0f, 0.0f, 12.0f, 12.0f,
0xFF, 0xFF, 0xFF, 0xFF,
0.0f, 0.0f, 1.0f, 1.0f
);
// spriteBatchPush(
// &testAsset->paletteImage.texture,
// 0.0f, 0.0f, 12.0f, 12.0f,
// 0xFF, 0xFF, 0xFF, 0xFF,
// 0.0f, 0.0f, 1.0f, 1.0f
// );
spriteBatchFlush();
cameraPopMatrix();