PGE Engine
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
window.h
1 /*
2  * Platformer Game Engine by Wohlstand, a free platform for game making
3  * Copyright (c) 2015 Vitaly Novichkov <admin@wohlnet.ru>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * any later version.
9  *
10  * This program 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
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef WINDOW_H
20 #define WINDOW_H
21 
22 #define SDL_MAIN_HANDLED
23 #include <SDL2/SDL.h> // SDL 2 Library
24 #include <SDL2/SDL_opengl.h>
25 
26 #include <QString>
27 
29 {
30 public:
31  static int Width;
32  static int Height;
33  static int MaxFPS;
34  static bool vsync;
35  static float TicksPerSecond;
36  static int TimeOfFrame;
37  static bool showDebugInfo;
38  static bool showPhysicsDebug;
39  static bool init(QString WindowTitle="Platformer Game Engine by Wohldtand");
40  static void toggleVSync(bool vsync);
41  static bool uninit();
42  static bool isReady();
43  static void setCursorVisibly(bool viz);
44  static void clean();
45  static void rePaint();
46 
47  static SDL_Window *window;
48  static SDL_GLContext glcontext_background;
49  static SDL_GLContext glcontext;
50  static int setFullScreen(bool fs);
51  static int SDL_ToggleFS(SDL_Window *win=NULL);
52 
53  static int processEvents(SDL_Event &event);
54 
55  static bool checkSDLError(int line = -1);
56 private:
57  static bool IsInit;
58  static bool showCursor;
59  static SDL_bool IsFullScreen(SDL_Window *win);
60 };
61 
62 #endif // WINDOW_H
static int SDL_ToggleFS(SDL_Window *win=NULL)
Definition: window.cpp:262
Definition: window.h:28