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

View File

@@ -30,7 +30,7 @@ public:
~Screen(); ~Screen();
// Limpia la pantalla // 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 // Prepara para empezar a dibujar en la textura de juego
void start(); void start();