Framebuffer first

This commit is contained in:
2025-08-15 18:39:19 -05:00
parent 3c908dc1ed
commit cbdc271a5e
4 changed files with 84 additions and 51 deletions

View File

@@ -9,7 +9,6 @@
#include "display/render.h"
void cameraUIPush(void) {
// Push the UI camera matrix onto the stack.
glPushMatrix();
glLoadIdentity();
glOrtho(
@@ -20,6 +19,32 @@ void cameraUIPush(void) {
}
void cameraUIPop(void) {
// Pop the UI camera matrix from the stack.
glPopMatrix();
}
void cameraScreenPush(void) {
glPushMatrix();
glLoadIdentity();
#if RENDER_USE_FRAMEBUFFER
int32_t windowWidth, windowHeight;
SDL_GetWindowSize(RENDER_WINDOW, &windowWidth, &windowHeight);
glViewport(0, 0, windowWidth, windowHeight);
glOrtho(
0.0f, (float_t)windowWidth,
(float_t)windowHeight, 0.0f,
-1.0f, 1.0f
);
#else
glOrtho(
0.0f, (float_t)RENDER_WIDTH,
(float_t)RENDER_HEIGHT, 0.0f,
-1.0f, 1.0f
);
#endif
}
void cameraScreenPop(void) {
glPopMatrix();
}