Actualizado renderGame y screen.h

This commit is contained in:
2022-08-09 17:23:58 +02:00
parent 63bf42880e
commit 61297ff340
2 changed files with 7 additions and 5 deletions

View File

@@ -442,16 +442,18 @@ void Director::updateGame()
// Pinta la sección de juego
void Director::renderGame()
{
// Prepara para empezar a dibujar el frame
screen->start();
// Limpia la pantalla
SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0xFF);
SDL_RenderClear(renderer);
screen->clean();
// Dibuja los objetos
map->render();
player->render();
// Muestra el backbuffer en pantalla
SDL_RenderPresent(renderer);
// Vuelca el contenido del renderizador en pantalla
screen->blit();
}
// Bucle principal

View File

@@ -30,7 +30,7 @@ public:
~Screen();
// Limpia la pantalla
void clean(color_t color);
void clean(color_t color = {0x00, 0x00, 0x00});
// Prepara para empezar a dibujar en la textura de juego
void start();