libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
VideoDriver Class Referenceabstract

Platform video backend owning the frame lifecycle (init/render/clear, screen size, refresh rate, delta time) and handing out an ImageRenderer and a GlyphRenderer. More...

#include <VideoDriver.h>

Inheritance diagram for VideoDriver:
[legend]

Public Member Functions

virtual void init (int width, int height)=0
 
virtual void shutdown ()=0
 Releases the video backend. Call after every other user of the renderers has finished.
 
virtual void render ()=0
 Flushes the current frame to the screen and swaps buffers.
 
virtual void clearScreen (const PixelColor &color)=0
 Clears the current frame buffer.
 
virtual int getScreenWidth () const =0
 
virtual int getScreenHeight () const =0
 
virtual uint32_t getFrameTimer ()=0
 
virtual int getRefreshRate () const =0
 
virtual float getDeltaTime () const =0
 
virtual float getUIScale () const
 Ratio of physical render-target pixels to design-canvas pixels (the width/height passed to init()).
 
virtual ImageRenderer * getImageRenderer ()=0
 
virtual GlyphRenderer * getGlyphRenderer ()=0
 

Detailed Description

Platform video backend owning the frame lifecycle (init/render/clear, screen size, refresh rate, delta time) and handing out an ImageRenderer and a GlyphRenderer.

GuiImage/GuiText never touch a platform texture type directly, only these two renderers.

Definition at line 27 of file VideoDriver.h.

Member Function Documentation

◆ clearScreen()

virtual void VideoDriver::clearScreen ( const PixelColor & color)
pure virtual

Clears the current frame buffer.

Implemented in OgcVideoDriver, and WutVideoDriver.

◆ getDeltaTime()

virtual float VideoDriver::getDeltaTime ( ) const
pure virtual
Returns
the nominal frame period in seconds (1/getRefreshRate()); not a measured time

Implemented in OgcVideoDriver, and WutVideoDriver.

◆ getFrameTimer()

virtual uint32_t VideoDriver::getFrameTimer ( )
pure virtual
Returns
the number of frames rendered so far (incremented once per render())

Implemented in OgcVideoDriver, and WutVideoDriver.

◆ getGlyphRenderer()

virtual GlyphRenderer * VideoDriver::getGlyphRenderer ( )
pure virtual
Returns
the renderer GuiTextRenderer draws glyphs through

Implemented in OgcVideoDriver, and WutVideoDriver.

◆ getImageRenderer()

virtual ImageRenderer * VideoDriver::getImageRenderer ( )
pure virtual
Returns
the renderer GuiImage/GuiImageData draw through

Implemented in OgcVideoDriver, and WutVideoDriver.

◆ getRefreshRate()

virtual int VideoDriver::getRefreshRate ( ) const
pure virtual
Returns
the display refresh rate in Hz (50 for PAL/576i output, otherwise 60)

Implemented in OgcVideoDriver, and WutVideoDriver.

◆ getScreenHeight()

virtual int VideoDriver::getScreenHeight ( ) const
pure virtual
Returns
the design canvas height in pixels (as passed to init())

Implemented in OgcVideoDriver, and WutVideoDriver.

◆ getScreenWidth()

virtual int VideoDriver::getScreenWidth ( ) const
pure virtual
Returns
the design canvas width in pixels (as passed to init())

Implemented in OgcVideoDriver, and WutVideoDriver.

◆ getUIScale()

virtual float VideoDriver::getUIScale ( ) const
inlinevirtual

Ratio of physical render-target pixels to design-canvas pixels (the width/height passed to init()).

Greater than 1.0 wherever the driver upscales the design canvas to fill a higher-resolution.

Reimplemented in WutVideoDriver.

Definition at line 58 of file VideoDriver.h.

◆ init()

virtual void VideoDriver::init ( int width,
int height )
pure virtual
Parameters
widthDesign canvas width in pixels
heightDesign canvas height in pixels

Implemented in OgcVideoDriver, and WutVideoDriver.

◆ render()

virtual void VideoDriver::render ( )
pure virtual

Flushes the current frame to the screen and swaps buffers.

Implemented in OgcVideoDriver, and WutVideoDriver.

◆ shutdown()

virtual void VideoDriver::shutdown ( )
pure virtual

Releases the video backend. Call after every other user of the renderers has finished.

Implemented in OgcVideoDriver, and WutVideoDriver.


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