SimpleGL  1.1.0
A framework for platform independent rendering
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
sgl::Application Class Referenceabstract

This is the base class for an application. More...

#include <application.hpp>

Inheritance diagram for sgl::Application:
sgl::ApplicationGL sgl::ApplicationVK

Public Member Functions

 ~Application (void)
 Destroys the application. More...
 
void run ()
 Starts the application. More...
 
void init ()
 Initializes the application. More...
 
void mainLoop ()
 The main loop is a fixed timestep loop. More...
 
virtual void handleEvents (std::vector< Event * > events)=0
 This method is intended to handle events like user input. More...
 
virtual void updateScene (float delta)=0
 This method is intended to update objects of the application. More...
 
virtual void clear ()=0
 This method is intended to clear the color and depth buffers. More...
 
virtual void renderScene (float alpha)=0
 This method is intended to used for drawing the scene. More...
 
virtual void dispose ()
 Disposes the application. More...
 

Protected Member Functions

 Application (void)
 Initializes a new application. More...
 

Protected Attributes

bool running
 Tells if the application is running. More...
 
int targetUps
 Stores the desired UPS. More...
 
int targetFps
 Stores the desired FPS. More...
 
Windowwindow
 The window of this application. More...
 

Detailed Description

This is the base class for an application.

Definition at line 25 of file application.hpp.

Constructor & Destructor Documentation

sgl::Application::Application ( void  )
protected

Initializes a new application.

Definition at line 16 of file application.cpp.

sgl::Application::~Application ( void  )

Destroys the application.

Definition at line 22 of file application.cpp.

Member Function Documentation

virtual void sgl::Application::clear ( )
pure virtual

This method is intended to clear the color and depth buffers.

Implemented in sgl::ApplicationGL, and sgl::ApplicationVK.

void sgl::Application::dispose ( )
virtual

Disposes the application.

Reimplemented in sgl::ApplicationGL, and sgl::ApplicationVK.

Definition at line 90 of file application.cpp.

virtual void sgl::Application::handleEvents ( std::vector< Event * >  events)
pure virtual

This method is intended to handle events like user input.

Parameters
eventsA list of events.
void sgl::Application::init ( )

Initializes the application.

Definition at line 36 of file application.cpp.

void sgl::Application::mainLoop ( )

The main loop is a fixed timestep loop.

Definition at line 41 of file application.cpp.

virtual void sgl::Application::renderScene ( float  alpha)
pure virtual

This method is intended to used for drawing the scene.

Parameters
alphaThe alpha value.
void sgl::Application::run ( )

Starts the application.

Definition at line 30 of file application.cpp.

virtual void sgl::Application::updateScene ( float  delta)
pure virtual

This method is intended to update objects of the application.

Parameters
deltaThe delta time.

Member Data Documentation

bool sgl::Application::running
protected

Tells if the application is running.

Definition at line 29 of file application.hpp.

int sgl::Application::targetFps
protected

Stores the desired FPS.

Definition at line 35 of file application.hpp.

int sgl::Application::targetUps
protected

Stores the desired UPS.

Definition at line 32 of file application.hpp.

Window* sgl::Application::window
protected

The window of this application.

Definition at line 38 of file application.hpp.


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