48 const auto elapsedTime = clock.
reset();
60 LUG_LOG.error(
"Application::run: Can't begin frame");
67 LUG_LOG.error(
"Application::run: Can't end frame");
71 elapsed += elapsedTime.getSeconds<
float>();
74 if (elapsed >= 1.0f) {
75 LUG_LOG.info(
"FPS: {}", frames / elapsed);
bool beginFrame(const lug::System::Time &elapsedTime)
virtual void onEvent(const lug::Window::Event &event)=0
Override this function to handle an event.
Application(const Info &info)
lug::Graphics::Graphics _graphics
virtual Render::Window * createWindow(Render::Window::InitInfo &initInfo)=0
bool init(int argc, char *argv[])
Init the application with the informations filled in the lug::Graphics::Graphics::InitInfo and lug::G...
virtual bool endFrame()=0
Renderer * getRenderer() const
Gets the renderer.
virtual void onFrame(const System::Time &elapsedTime)=0
Override this function to handle a frame.
bool finishInit()
Finish the initialization of the application with the informations filled in the lug::Graphics::Rende...
lug::Graphics::Graphics::InitInfo _graphicsInitInfo
bool finishInit()
Finish the initialization of the application with the informations filled in initInfo structure...
bool beginInit(const InitInfo &initInfo)
Begin the initialization of the application with the informations filled in initInfo structure...
lug::Graphics::Render::Window * _window
void close()
Close the application.
bool run()
Run the application.
virtual bool beginFrame(const lug::System::Time &elapsedTime)=0
bool isOpen() const
Determines if the window is open.
virtual bool pollEvent(lug::Window::Event &event)
Checks if an event is available from the window implementation, and fill it in the event parameter...
bool beginInit(int argc, char *argv[])
Begin the initialization of the application with the informations filled in the lug::Graphics::Graphi...
lug::Graphics::Render::Window::InitInfo _renderWindowInitInfo