Ja pinta cosetes per pantalla

This commit is contained in:
2025-03-04 14:24:30 +01:00
parent 05f91b2a94
commit 57481a1e97
69 changed files with 481 additions and 478 deletions

View File

@@ -586,22 +586,4 @@ void fillTextureWithColor(SDL_Renderer *renderer, SDL_Texture *texture, Uint8 r,
// Restaurar el render target previo
SDL_SetRenderTarget(renderer, previous_target);
}
// Crea un SDL_Texture
SDL_Texture *createTexture(SDL_Renderer *renderer, int width, int height, Uint32 format, int access, bool logError)
{
// Crear la textura
SDL_Texture *texture = SDL_CreateTexture(renderer, format, access, width, height);
if (texture == nullptr)
{
// Registrar el error si está habilitado
if (logError)
{
std::cerr << "Error: Texture could not be created!\nSDL Error: " << SDL_GetError() << std::endl;
}
return nullptr;
}
return texture;
}
}