Demo: añadida la clase screen

This commit is contained in:
2023-05-07 12:09:52 +02:00
parent 8bcd3e6068
commit 3ba5f6cce0
7 changed files with 96 additions and 34 deletions

View File

@@ -1,7 +1,6 @@
#pragma once
#include <SDL2/SDL.h>
#include "asset.h"
#include "notify.h"
#include "utils.h"
#include <vector>
@@ -18,7 +17,6 @@ private:
// Objetos y punteros
SDL_Window *window; // Ventana de la aplicación
SDL_Renderer *renderer; // El renderizador de la ventana
Asset *asset; // Objeto con el listado de recursos
SDL_Texture *gameCanvas; // Textura para completar la ventana de juego hasta la pantalla completa
options_t *options; // Variable con todas las opciones del programa
Notify *notify; // Dibuja notificaciones por pantalla
@@ -32,6 +30,7 @@ private:
int borderHeight; // Anltura del borde
SDL_Rect dest; // Coordenadas donde se va a dibujar la textura del juego sobre la pantalla o ventana
color_t borderColor; // Color del borde añadido a la textura de juego para rellenar la pantalla
bool notifyAdded; // Indica si se ha añadido un notificador
bool notifyActive; // Indica si hay notificaciones activas
int notificationLogicalWidth; // Ancho lógico de las notificaciones en relación al tamaño de pantalla
int notificationLogicalHeight; // Alto lógico de las notificaciones en relación al tamaño de pantalla
@@ -71,7 +70,7 @@ private:
public:
// Constructor
Screen(SDL_Window *window, SDL_Renderer *renderer, Asset *asset, options_t *options);
Screen(SDL_Window *window, SDL_Renderer *renderer, options_t *options);
// Destructor
~Screen();
@@ -134,6 +133,9 @@ public:
// Dibuja los efectos
void renderFX();
// Añade un notificador a la pantalla
void addNotifier(string iconsFile, string bitmapFontFile, string offsetFontFile, string soundFile);
// Actualiza el notificador
void updateNotifier();