Pacman  1.0
Pacman game
Fonctions membres publiques | Fonctions membres privées | Attributs privés | Liste de tous les membres
Référence de la classe Renderer

The Renderer class. Plus de détails...

#include <Renderer.h>

Fonctions membres publiques

 Renderer ()
 Construct a new Renderer object. Plus de détails...
 
 ~Renderer ()
 
void render (const Maze &maze, std::shared_ptr< Pacman > pacman, std::vector< std::shared_ptr< Ghosts >> ghosts, int score, int state, int lives)
 This function renders the game. Plus de détails...
 
void updateScreen ()
 This function updates the screen. Plus de détails...
 

Fonctions membres privées

void createWindow ()
 
void createRenderer ()
 
void loadResources ()
 
void loadMusic ()
 
void drawScore (int score)
 
void drawLives (int lives)
 
void animateDeath (std::shared_ptr< Pacman > pacman)
 

Attributs privés

SDL_Window * window = nullptr
 
SDL_Renderer * renderer = nullptr
 
SDL_Surface * surface_bmp = nullptr
 
SDL_Texture * texture_bmp = nullptr
 
Mix_Music * music_start = nullptr
 
Mix_Music * music_death = nullptr
 
Mix_Music * music_chomp = nullptr
 
int screenWidth
 
int screenHeight
 
int frame = 0
 

Description détaillée

The Renderer class.

This class is responsible for rendering the game. It contains all the functions related to rendering the game and the game elements. It also contains the functions related to loading the resources.

Documentation des constructeurs et destructeur

◆ Renderer()

Renderer::Renderer ( )

Construct a new Renderer object.

This constructor initializes the renderer by creating the window and the renderer. It also loads the resources, and initializes the SDL, SDL_ttf and SDL_mixer libraries.

◆ ~Renderer()

Renderer::~Renderer ( )

Documentation des fonctions membres

◆ animateDeath()

void Renderer::animateDeath ( std::shared_ptr< Pacman pacman)
private

◆ createRenderer()

void Renderer::createRenderer ( )
private

◆ createWindow()

void Renderer::createWindow ( )
private

◆ drawLives()

void Renderer::drawLives ( int  lives)
private

◆ drawScore()

void Renderer::drawScore ( int  score)
private

◆ loadMusic()

void Renderer::loadMusic ( )
private

◆ loadResources()

void Renderer::loadResources ( )
private

◆ render()

void Renderer::render ( const Maze maze,
std::shared_ptr< Pacman pacman,
std::vector< std::shared_ptr< Ghosts >>  ghosts,
int  score,
int  state,
int  lives 
)

This function renders the game.

This function renders the game by rendering the maze, the pacman, the ghosts, the score and the lives.

Paramètres
maze
pacman
ghosts
score
state
lives

◆ updateScreen()

void Renderer::updateScreen ( )

This function updates the screen.

Documentation des données membres

◆ frame

int Renderer::frame = 0
private

◆ music_chomp

Mix_Music* Renderer::music_chomp = nullptr
private

◆ music_death

Mix_Music* Renderer::music_death = nullptr
private

◆ music_start

Mix_Music* Renderer::music_start = nullptr
private

◆ renderer

SDL_Renderer* Renderer::renderer = nullptr
private

◆ screenHeight

int Renderer::screenHeight
private

◆ screenWidth

int Renderer::screenWidth
private

◆ surface_bmp

SDL_Surface* Renderer::surface_bmp = nullptr
private

◆ texture_bmp

SDL_Texture* Renderer::texture_bmp = nullptr
private

◆ window

SDL_Window* Renderer::window = nullptr
private

La documentation de cette classe a été générée à partir du fichier suivant :