Rendu
A lightweight rendering engine for experimentations
|
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 | |
Renderer & | operator= (const Renderer &)=delete |
Renderer (Renderer &&)=delete | |
Renderer & | operator= (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. | |
Renders a game menu.
Inherits Renderer.
|
explicit |
Constructor.
void GameMenuRenderer::drawMenu | ( | const GameMenu & | menu, |
const glm::vec2 & | finalRes, | ||
float | aspectRatio | ||
) | const |
Draw the menu
menu | the menu to draw |
finalRes | the final viewport dimensions |
aspectRatio | the target aspect ratio |
glm::vec2 GameMenuRenderer::getButtonSize | ( | ) | const |
Return the absolute unit size of the button mesh.