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

@@ -139,7 +139,7 @@ errorret_t displayInit(void) {
quadInit();
frameBufferInitBackbuffer();
spriteBatchInit();
// errorChain(textInit());
errorChain(textInit());
screenInit();
errorOk();
@@ -193,46 +193,6 @@ errorret_t displayUpdate(void) {
);
errorChain(sceneRender());
texture_t texture;
// color_t colors[4 * 4] = {
// COLOR_RED_4B, COLOR_GREEN_4B, COLOR_BLUE_4B, COLOR_YELLOW_4B,
// COLOR_CYAN_4B, COLOR_MAGENTA_4B, COLOR_WHITE_4B, COLOR_BLACK_4B,
// COLOR_ORANGE_4B, COLOR_PURPLE_4B, COLOR_GRAY_4B, COLOR_BROWN_4B,
// COLOR_PINK_4B, COLOR_LIME_4B, COLOR_NAVY_4B, COLOR_TEAL_4B
// };
// texturedata_t data = {
// .rgba = { .colors = colors }
// };
// textureInit(&texture, 4, 4, TEXTURE_FORMAT_RGBA, data);
uint8_t alphaData[8 * 4] = {
255, 255, 255, 255, 255, 255, 255, 255,
0, 0, 255, 0, 0, 255, 0, 0,
255, 255, 255, 255, 255, 255, 255, 255,
0, 0, 0, 255, 255, 0, 0, 0,
};
texturedata_t data = {
.alpha = { .data = alphaData }
};
textureInit(&texture, 8, 4, TEXTURE_FORMAT_ALPHA, data);
camera_t camera;
cameraInit(&camera);
cameraPushMatrix(&camera);
spriteBatchClear();
spriteBatchPush(
&texture,
-1, -1,
1, 1,
COLOR_WHITE_4B,
0, 0,
1, 1
);
spriteBatchFlush();
cameraPopMatrix();
// Render UI
// uiRender();
@@ -255,8 +215,6 @@ errorret_t displayUpdate(void) {
// if(DISPLAY.screenMode->viTVMode & VI_NON_INTERLACE) VIDEO_WaitVSync();
#endif
textureDispose(&texture);
// For now, we just return an OK error.
errorOk();
}