Actualizado renderGame y screen.h
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user