Geno3D
A simple 3D visualisation library, using C++/SFML.
 All Classes Functions Variables
Public Member Functions | Public Attributes | Private Attributes | List of all members
Geno3D::Engine Class Reference

#include <Engine.hpp>

Public Member Functions

 Engine (int width, int height, std::string title)
 
void run ()
 

Public Attributes

std::shared_ptr< Scenescene
 

Private Attributes

const float dt = 1.0f / 60.0f
 The target frame time in seconds (target of 60fps)
 
sf::Clock clock
 The gameloop clock.
 
sf::RenderWindow window
 The render window object.
 
sf::Vector2i winSize
 Size of the window in x & y.
 

Detailed Description

The base "game" engine. This manages the update & draw loops, and creates the render window to be used in a scene.

Constructor & Destructor Documentation

Geno3D::Engine::Engine ( int  width,
int  height,
std::string  title 
)

Constructor for the Engine class.

Parameters
widththe width of the render window
heightthe height of the render window
titlethe window title
See Also
run()

References window.

Member Function Documentation

void Geno3D::Engine::run ( )

Display the window and run the gameloop.

See Also
scene

References clock, dt, scene, window, and winSize.

Member Data Documentation

std::shared_ptr<Scene> Geno3D::Engine::scene

The scene, defining draw & update behaviour. This should be assigned before calling run() to a subclass of the abstract class Scene.

See Also
Scene

Referenced by run().


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