hx3d
1
2D/3D Simple Game Framework
Main Page
Namespaces
Classes
Files
File List
engine
src
window
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
26
Application::Application
(
ApplicationConfig
config):
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
35
int
Application::getWidth
() {
36
return
_width
;
37
}
38
39
int
Application::getHeight
() {
40
return
_height
;
41
}
42
43
glm::ivec2
Application::getSize
() {
44
return
glm::ivec2(
_width
,
_height
);
45
}
46
47
float
Application::getFPS
() {
48
return
_currentFPS
;
49
}
50
51
float
Application::getElapsedTime
() {
52
return
_elapsedTime
;
53
}
54
55
}
/* window */
56
}
/* hx3d */
hx3d::window::ApplicationConfig
Application configuration.
Definition:
application_config.hpp:32
hx3d
hx3d framework namespace
Definition:
audio.hpp:26
hx3d::window::Application::Application
Application(ApplicationConfig config)
Create a window.
Definition:
application.cpp:26
hx3d::window::Application::_width
int _width
Application width.
Definition:
application.hpp:104
hx3d::window::Application::getSize
glm::ivec2 getSize()
Get the window size (ivec2)
Definition:
application.cpp:43
hx3d::window::Application::_height
int _height
Application height.
Definition:
application.hpp:106
hx3d::window::Application::_elapsedTime
float _elapsedTime
Elapsed time since the beginning.
Definition:
application.hpp:117
hx3d::window::Application::getElapsedTime
float getElapsedTime()
Get the elapsed time in seconds since the application start. Reset after one hour.
Definition:
application.cpp:51
hx3d::window::Application::getFPS
float getFPS()
Get the current frames per second (FPS)
Definition:
application.cpp:47
hx3d::window::Application::_currentFPS
float _currentFPS
Current FPS.
Definition:
application.hpp:115
hx3d::window::Application::getHeight
int getHeight()
Get the window height.
Definition:
application.cpp:39
hx3d::window::Application::getWidth
int getWidth()
Get the window width.
Definition:
application.cpp:35
Generated by
1.8.11