Added screen

This commit is contained in:
2025-09-12 15:56:21 -05:00
parent 9b98181d28
commit 067b0d2e9f
10 changed files with 264 additions and 110 deletions

View File

@@ -6,23 +6,43 @@
*/
#pragma once
#include "display/display.h"
#include "display/texture/texture.h"
#define FRAMEBUFFER_CLEAR_COLOR (1 << 0)
#define FRAMEBUFFER_CLEAR_DEPTH (1 << 1)
typedef struct {
#if DISPLAY_SDL2
#if DISPLAY_SDL2 == 1
// OpenGL Framebuffer Object ID
GLuint id;
texture_t texture;
#else
#error "Framebuffers not implemented on this platform."
#endif
} framebuffer_t;
extern framebuffer_t FRAMEBUFFER_BACKBUFFER;
extern const framebuffer_t *FRAMEBUFFER_BOUND;
void frameBufferInitBackbuffer();
/**
* Initializes the backbuffer framebuffer.
*/
void frameBufferInitBackbuffer(void);
/**
* Initializes a framebuffer.
*
* @param framebuffer The framebuffer to initialize.
* @param width The width of the framebuffer.
* @param height The height of the framebuffer.
*/
#if DISPLAY_SIZE_DYNAMIC == 1
void frameBufferInit(
framebuffer_t *framebuffer,
const uint32_t width,
const uint32_t height
);
#endif
/**
* Gets the width of the framebuffer.