14 @class RendererCaller;
91 void setLoopFunction(
void(*f)(
const double deltaTime,
const double elapsedTime));
146 bool _initialized =
false;
147 bool _running =
false;
149 double _elapsedTime = 0.0, _stopTime = 0.0, _startTime = 0.0;
158 RendererCaller *_rendererCaller =
nullptr;
160 void(*_initFunction)() =
nullptr;
161 void(*_loopFunction)(
const double deltaTime,
const double elapsedTime) =
nullptr;
162 void(*_terminateFunction)() =
nullptr;
ModelRendererPtr getModelRenderer()
Returns a pointer to the model renderer.
Definition: Renderer.cpp:27
void runRenderer()
Start the render loop.
void setTerminateFunction(void(*f)())
Sets a static function that gets called when terminating the renderer.
Definition: Renderer.cpp:57
void terminateRenderer()
Terminate the renderer.
The main class that is able to initialize and maintain the render loop as well as a view...
Definition: Renderer.h:22
void setLoopFunction(void(*f)(const double deltaTime, const double elapsedTime))
Sets a static function that gets called repeatedly when looping.
Definition: Renderer.cpp:52
std::shared_ptr< ModelRenderer > ModelRendererPtr
Definition: ModelRenderer.h:146
void stopRenderer()
Stop the render loop.
virtual ~Renderer()
Virtual destructor.
Definition: Renderer.h:38
bool isInitialized()
Returns true if the renderer has already been initialized.
Definition: Renderer.cpp:32
This interface needs to be implemented if the renderer should be used in an object oriented manner...
Definition: IRenderProject.h:10
std::shared_ptr< View > ViewPtr
Definition: View.h:225
std::shared_ptr< Renderer > RendererPtr
Definition: Renderer.h:166
bool isRunning()
Returns true if the renderer is running.
Definition: Renderer.cpp:37
InputPtr getInput()
Returns a pointer to the input handler of the renderer.
Definition: Renderer.cpp:17
int RendererCaller
Definition: Renderer.h:27
bool initRenderer(std::string windowTitle=bRenderer::DEFAULT_WINDOW_TITLE())
Do all necessary initializations for the renderer to be ready to run (returns true in the case of suc...
Definition: Renderer.cpp:62
void setInitFunction(void(*f)())
Sets a static function that gets called when initializing the renderer.
Definition: Renderer.cpp:47
std::string DEFAULT_WINDOW_TITLE()
Definition: Configuration.cpp:37
ObjectManagerPtr getObjects()
Returns a pointer to the object management of the renderer.
Definition: Renderer.cpp:22
std::shared_ptr< ObjectManager > ObjectManagerPtr
Definition: ObjectManager.h:690
ViewPtr getView()
Returns a pointer to the view of the renderer.
Definition: Renderer.cpp:12
Renderer()
Constructor.
Definition: Renderer.cpp:7
void setRenderProject(IRenderProject *p)
Sets the project instance to be used for function calls.
Definition: Renderer.cpp:42