| 1 | // SPDX-FileCopyrightText: 2011 Torsten Dreyer |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | |
| 4 | #ifndef __FGGLAPPLICATION_HXX |
| 5 | #define __FGGLAPPLICATION_HXX |
| 6 | |
| 7 | class FGGLApplication { |
| 8 | public: |
| 9 | FGGLApplication (const char *a_name, int argc, char **argv); |
| 10 | virtual ~FGGLApplication (); |
| 11 | void Run(const int glutMode, |
| 12 | const bool gameMode, |
| 13 | int width = -1, |
| 14 | int height = -1, |
| 15 | const int bpp = 32); |
| 16 | |
| 17 | protected: |
| 18 | virtual void Key (const unsigned char key, const int x, const int y) {} |
| 19 | virtual void Idle () {} |
| 20 | virtual void Display () {} |
| 21 | virtual void Reshape (const int width, const int height) {} |
| 22 | |
| 23 | virtual void Init () {} |
| 24 | |
| 25 | int windowId; |
| 26 | bool gameMode; |
| 27 | |
| 28 | const char *name; |
| 29 | |
| 30 | static FGGLApplication *application; |
| 31 | private: |
| 32 | static void KeyCallback (const unsigned char key, const int x, const int y); |
| 33 | static void IdleCallback (); |
| 34 | static void DisplayCallback (); |
| 35 | static void ReshapeCallback (const int width, const int height); |
| 36 | |
| 37 | }; |
| 38 | |
| 39 | #endif |