FYP  1.0.0
Final Year Project -- Alexander Meuer
Renderer Class Reference

Manages rendering in it's own thread. More...

#include <Renderer.hpp>

Collaboration diagram for Renderer:
Collaboration graph

Public Member Functions

 Renderer (std::string const &title, sf::VideoMode mode=sf::VideoMode::getDesktopMode(), sf::Uint32 style=sf::Style::Fullscreen, sf::ContextSettings settings=sf::ContextSettings())
 Creates a render window.
 
void startRenderLoop (const unsigned int framesPerSecond)
 Begins rendering on a seperate thread. Starts the render loop, creating a thread that runs the render() method until stopRenderLoop() is called.
 
void stopRenderLoop ()
 Stops render loop. Sets render loop condition to false and waits for thread to join.
 
bool pollEvent (sf::Event &event)
 

Private Member Functions

void render ()
 

Private Attributes

sf::RenderWindow mWindow
 
std::atomic< bool > mLoopOngoing
 True if want to keep rendering, false if we want rendering to stop.
 
std::chrono::milliseconds mFrameDelay
 
std::thread mThread
 Thread that rendering takes place on.
 
std::mutex mMutex
 

Detailed Description

Manages rendering in it's own thread.


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