hx3d  1
2D/3D Simple Game Framework
application.cpp
1 /*
2  Application management.
3  Copyright (C) 2015 Denis BOURGE
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
18  USA
19 */
20 
21 #include "hx3d/window/application.hpp"
22 
23 namespace hx3d {
24 namespace window {
25 
27  _running(false),
28  _width(config.width), _height(config.height), _fpsLimit(config.fpsLimit), _title(config.title),
29  _fullscreen(config.fullscreen),
30  _elapsedTime(0)
31  {}
32 
33 Application::~Application() {}
34 
36  return _width;
37 }
38 
40  return _height;
41 }
42 
43 glm::ivec2 Application::getSize() {
44  return glm::ivec2(_width, _height);
45 }
46 
48  return _currentFPS;
49 }
50 
52  return _elapsedTime;
53 }
54 
55 } /* window */
56 } /* hx3d */
Application configuration.
hx3d framework namespace
Definition: audio.hpp:26
Application(ApplicationConfig config)
Create a window.
Definition: application.cpp:26
int _width
Application width.
glm::ivec2 getSize()
Get the window size (ivec2)
Definition: application.cpp:43
int _height
Application height.
float _elapsedTime
Elapsed time since the beginning.
float getElapsedTime()
Get the elapsed time in seconds since the application start. Reset after one hour.
Definition: application.cpp:51
float getFPS()
Get the current frames per second (FPS)
Definition: application.cpp:47
float _currentFPS
Current FPS.
int getHeight()
Get the window height.
Definition: application.cpp:39
int getWidth()
Get the window width.
Definition: application.cpp:35