Bubba-3D  0.9.0
Awesome game engine!
Window.h
1 /*
2  * This file is part of Bubba-3D.
3  *
4  * Bubba-3D is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * Bubba-3D is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with Bubba-3D. If not, see http://www.gnu.org/licenses/.
16  */
17 #include <string>
18 #include <SFML/Window.hpp>
19 
20 #ifndef BUBBA_3D_WINDOW_H
21 #define BUBBA_3D_WINDOW_H
22 
23 class Window {
24 public:
25  Window(int width, int height, std::string title);
26  ~Window();
27 
28  void initGL();
29  void resize(unsigned int width, unsigned int height);
30 
31  void setResizeMethod(void(*resize)(int, int));
32 
33  void start(unsigned int maxFPS);
34 
35  sf::Window* getWindow();
36 
45  void setIdleMethod(void(*idle)(float sinceStart, float sinceLastMethodCall));
46 
55  void setDisplayMethod(void(*display)(float sinceStart, float sinceLastMethodCall));
56 private:
57  sf::Window* window;
58  int width, height;
59  void(*resizeMethod)(int, int);
60  void(*idleMethod)(float, float);
61  void(*displayMethod)(float, float);
62 };
63 
64 #endif //BUBBA_3D_WINDOW_H
Definition: Window.h:23
void setIdleMethod(void(*idle)(float sinceStart, float sinceLastMethodCall))
Definition: Window.cpp:126
void setDisplayMethod(void(*display)(float sinceStart, float sinceLastMethodCall))
Definition: Window.cpp:122