migrant a SDL3

This commit is contained in:
2025-03-27 09:43:19 +01:00
parent d2286905dc
commit 2edb978a28
67 changed files with 234 additions and 283 deletions

View File

@@ -1,18 +1,19 @@
#include "screen.h"
#include <SDL3/SDL_pixels.h> // Para SDL_PIXELFORMAT_RGBA8888
#include <SDL3/SDL_pixels.h> // Para SDL_PixelFormat
#include <SDL3/SDL_timer.h> // Para SDL_GetTicks
#include <algorithm> // Para max, min
#include <fstream> // Para basic_ifstream, ifstream
#include <iterator> // Para istreambuf_iterator, operator==
#include <string> // Para allocator, char_traits, operator+, to_s...
#include <memory> // Para __shared_ptr_access, shared_ptr
#include <string> // Para string, operator+, to_string
#include "asset.h" // Para Asset
#include "global_inputs.h" // Para service_pressed_counter
#include "jail_shader.h" // Para init, render
#include "mouse.h" // Para updateCursorVisibility
#include "notifier.h" // Para Notifier
#include "on_screen_help.h" // Para OnScreenHelp
#include "options.h" // Para Options, OptionsVideo, options, Options...
#include "options.h" // Para Options, VideoOptions, options, WindowO...
#include "resource.h" // Para Resource
#include "text.h" // Para Text
// [SINGLETON]
Screen *Screen::screen_ = nullptr;
@@ -35,8 +36,6 @@ Screen::Screen(SDL_Window *window, SDL_Renderer *renderer)
dst_rect_(SDL_FRect{0, 0, static_cast<float>(param.game.width), static_cast<float>(param.game.height)})
{
// Inicializa variables
auto DM = SDL_GetCurrentDisplayMode(0);
info_resolution_ = std::to_string(DM->w) + " X " + std::to_string(DM->h) + " AT " + std::to_string(DM->refresh_rate) + " HZ";
adjustRenderLogicalSize();
// Muestra la ventana
@@ -212,7 +211,7 @@ void Screen::renderInfo()
text->writeColored(param.game.width - text->lenght(FPS_TEXT), 0, FPS_TEXT, orange_soft_color);
// Resolution
text->writeColored(0, 0, info_resolution_, orange_soft_color);
text->writeColored(0, 0, options.video.info, orange_soft_color);
}
}