canvi de pc

This commit is contained in:
2025-03-01 08:11:00 +01:00
parent 5ff04daf20
commit c7db6aeaa3
6 changed files with 49 additions and 9 deletions

View File

@@ -52,7 +52,7 @@ Screen::Screen(SDL_Window *window, SDL_Renderer *renderer)
SDL_RenderSetIntegerScale(renderer_, options.video.integer_scale ? SDL_TRUE : SDL_FALSE);
// Crea la textura donde se vuelcan las surfaces
surface_texture_ = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_STREAMING, options.game.width, options.game.height);
surface_texture_ = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, options.game.width, options.game.height);
if (surface_texture_ == nullptr)
{
if (options.console)
@@ -60,6 +60,7 @@ Screen::Screen(SDL_Window *window, SDL_Renderer *renderer)
std::cout << "surface_texture_ could not be created!\nSDL Error: " << SDL_GetError() << std::endl;
}
}
//SDL_SetTextureBlendMode(surface_texture_, SDL_BLENDMODE_BLEND);
// Crea la textura donde se dibujan los graficos del juego
game_texture_ = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, options.game.width, options.game.height);
@@ -128,7 +129,9 @@ void Screen::render()
// Renderiza sobre gameCanvas los overlays
renderNotifications();
surface_->copyToTexture(renderer_, game_texture_);
fillTextureWithColor(renderer_, surface_texture_, 0xFF, 0x00, 0xFF, 0xFF);
surface_->copyToTexture(renderer_, surface_texture_);
SDL_RenderCopy(renderer_, surface_texture_, nullptr, nullptr);
// Si está el borde activo, vuelca gameCanvas sobre borderCanvas
if (options.video.border.enabled)