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

Renders a game menu. More...

#include <GameMenuRenderer.hpp>

Public Member Functions

 GameMenuRenderer ()
 
void drawMenu (const GameMenu &menu, const glm::vec2 &finalRes, float aspectRatio) const
 
glm::vec2 getButtonSize () const
 
- 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 Attributes

Program_backgroundProgram
 Background images rendering.
 
Program_buttonProgram
 Buttons rendering.
 
Program_imageProgram
 Fixed images rendering.
 
Program_fontProgram
 Labels font rendering.
 
const Mesh_button
 Button main mesh (with border).
 
const Mesh_buttonIn
 Button interior mesh.
 
const Mesh_toggle
 Toggle main mesh (with border).
 
const Mesh_toggleIn
 Toggle interior mesh.
 
const Mesh_quad
 Quad mesh for images.
 

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 a game menu.

Inherits Renderer.

Constructor & Destructor Documentation

◆ GameMenuRenderer()

GameMenuRenderer::GameMenuRenderer ( )
explicit

Constructor.

Member Function Documentation

◆ drawMenu()

void GameMenuRenderer::drawMenu ( const GameMenu menu,
const glm::vec2 &  finalRes,
float  aspectRatio 
) const

Draw the menu

Parameters
menuthe menu to draw
finalResthe final viewport dimensions
aspectRatiothe target aspect ratio

◆ getButtonSize()

glm::vec2 GameMenuRenderer::getButtonSize ( ) const

Return the absolute unit size of the button mesh.

Returns
the dimensions of the button mesh

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