forked from jaildesigner-jailgames/jaildoctors_dilemma
canvi de pc
This commit is contained in:
@@ -536,4 +536,23 @@ void playMusic(const std::string &music_path)
|
||||
{
|
||||
JA_PlayMusic(Resource::get()->getMusic(music_path));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Rellena una textura de un color
|
||||
void fillTextureWithColor(SDL_Renderer* renderer, SDL_Texture* texture, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
|
||||
{
|
||||
// Guardar el render target actual
|
||||
SDL_Texture* previous_target = SDL_GetRenderTarget(renderer);
|
||||
|
||||
// Establecer la textura como el render target
|
||||
SDL_SetRenderTarget(renderer, texture);
|
||||
|
||||
// Establecer el color deseado
|
||||
SDL_SetRenderDrawColor(renderer, r, g, b, a);
|
||||
|
||||
// Pintar toda el área
|
||||
SDL_RenderClear(renderer);
|
||||
|
||||
// Restaurar el render target previo
|
||||
SDL_SetRenderTarget(renderer, previous_target);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user