This commit is contained in:
2025-10-06 15:43:27 -05:00
parent ea50d893d4
commit 12c31ba9d1
6 changed files with 285 additions and 21 deletions

View File

@@ -7,31 +7,49 @@
#pragma once
#include "dusk.h"
#include "display/framebuffer/framebuffer.h"
#include "display/camera.h"
#include "display/mesh/quad.h"
typedef enum {
SCREEN_MODE_BACKBUFFER,
#if DISPLAY_SIZE_DYNAMIC == 1
SCREEN_MODE_ASPECT_RATIO,// Maintains aspect at all cost
SCREEN_MODE_FIXED_HEIGHT, // Fixed height, width expands/contracts as needed
#endif
// SCREEN_MODE_FIXED_ASPECT,
// SCREEN_MODE_FIXED_ASPECT_INTEGER,
// SCREEN_MODE_FIXED_HEIGHT,
// SCREEN_MODE_FIXED_HEIGHT_INTEGER,
// SCREEN_MODE_FIXED_WIDTH,
// SCREEN_MODE_FIXED_WIDTH_INTEGER,
// SCREEN_MODE_SUPER_RESOLUTION_HEIGHT,
// SCREEN_MODE_SUPER_RESOLUTION_WIDTH
} screenmode_t;
typedef enum {
SCREEN_SCALE_MODE_FILL,
SCREEN_SCALE_MODE_INTEGER,
SCREEN_SCALE_MODE_INEGER_OVERFLOW
} screenscalemode_t;
typedef struct {
screenmode_t mode;
screenscalemode_t scaleMode;
// Calculated dimensions of the viewport, to be used by the camera
int32_t width;
int32_t height;
#if DISPLAY_SIZE_DYNAMIC == 1
framebuffer_t framebuffer;
bool_t framebufferReady;
camera_t framebufferCamera;
mesh_t frameBufferMesh;
meshvertex_t frameBufferMeshVertices[QUAD_VERTEX_COUNT];
#endif
union {
struct {
float_t ratio;
} aspectRatio;
struct {
int32_t height;
} fixedHeight;
};
} screen_t;