Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
GameRenderer Class Referencefinal

Renders the main game scene. More...

#include <GameRenderer.hpp>

Public Member Functions

 GameRenderer (const glm::vec2 &resolution)
 
void drawPlayer (const Player &player, Texture &dst) const
 
void resize (uint width, uint height) override
 
- Public Member Functions inherited from Renderer
 Renderer (const std::string &name)
 
virtual void draw (const Camera &camera, Texture *dstColor, Texture *dstDepth, uint layer=0)
 
virtual void resize (uint width, uint height)
 
virtual void interface ()
 
virtual ~Renderer ()=default
 
 Renderer (const Renderer &)=delete
 
Rendereroperator= (const Renderer &)=delete
 
 Renderer (Renderer &&)=delete
 
Rendereroperator= (Renderer &&)=delete
 
Layout outputColorFormat () const
 
Layout outputDepthFormat () const
 

Private Member Functions

void drawScene (const Player &player) const
 

Private Attributes

Texture _sceneNormal
 Scene normal texture.
 
Texture _sceneMaterial
 Scene material texture.
 
Texture _sceneDepth
 Scene depth texture.
 
Texture _lighting
 Texture containing the lit result.
 
std::unique_ptr< SSAO_ssaoPass
 Screen space ambient occlusion pass.
 
Program_fxaaProgram
 Antialiasing program.
 
Program_coloredProgram
 Base scene rendering program.
 
Program_compositingProgram
 Lighting program.
 
const Mesh_ground
 Terrain mesh.
 
const Mesh_head
 Snake head mesh.
 
const Mesh_bodyElement
 Body elements and items mesh.
 
Camera _playerCamera
 The player camera (fixed).
 
const Texture_cubemap
 Environment map for reflections.
 

Additional Inherited Members

- Protected Attributes inherited from Renderer
std::string _name
 Debug name.
 
Layout _colorFormat = Layout::NONE
 The preferred output format for a given renderer.
 
Layout _depthFormat = Layout::NONE
 The preferred output format for a given renderer.
 

Detailed Description

Renders the main game scene.

Inherits Renderer.

Constructor & Destructor Documentation

◆ GameRenderer()

GameRenderer::GameRenderer ( const glm::vec2 &  resolution)
explicit

Constructor

Parameters
resolutionthe rendering resolution

Member Function Documentation

◆ drawPlayer()

void GameRenderer::drawPlayer ( const Player player,
Texture dst 
) const

Draw the game scene

Parameters
playerthe state of the game and player
dstthe destination texture

◆ drawScene()

void GameRenderer::drawScene ( const Player player) const
private

Draw the scene to the current bound framebuffer.

Parameters
playerthe player state

◆ resize()

void GameRenderer::resize ( uint  width,
uint  height 
)
overridevirtual

Resize internal buffers based on new window size.

Parameters
widthnew width
heightnew height

Reimplemented from Renderer.


The documentation for this class was generated from the following files: