treballant en el overlay, el text i les notificacions

This commit is contained in:
2026-04-04 18:11:04 +02:00
parent abb23071b5
commit fe8e5d661e
38 changed files with 738 additions and 105 deletions

View File

@@ -0,0 +1,47 @@
#pragma once
#include <SDL3/SDL.h>
#include <cstdint>
class Screen {
public:
static void init();
static void destroy();
static auto get() -> Screen*;
// Presentació — rep el buffer ARGB de 320x200 de JD8
void present(Uint32* pixel_data);
// Gestió de finestra
void toggleFullscreen();
void incZoom();
void decZoom();
void setZoom(int zoom);
// Getters
[[nodiscard]] auto isFullscreen() const -> bool { return fullscreen_; }
[[nodiscard]] auto getZoom() const -> int { return zoom_; }
[[nodiscard]] auto getWindow() -> SDL_Window* { return window_; }
[[nodiscard]] auto getRenderer() -> SDL_Renderer* { return renderer_; }
private:
Screen();
~Screen();
void adjustWindowSize();
void calculateMaxZoom();
static Screen* instance_;
SDL_Window* window_{nullptr};
SDL_Renderer* renderer_{nullptr};
SDL_Texture* texture_{nullptr}; // 320x200 streaming, ARGB8888
int zoom_{3};
int max_zoom_{6};
bool fullscreen_{false};
static constexpr int GAME_WIDTH = 320;
static constexpr int GAME_HEIGHT = 200;
};