annotate EXCLUDE/GLTSF/include/App.hpp @ 4738:381d402a5e90

Added support for On_Resized event to App. Added OpenGL code to draw a rotating triangle. Rearranged main loop code.
author dewyatt
date Sat, 12 Jun 2010 03:21:54 -0400
parents 0c7c67d4e6ee
children
rev   line source
4730
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
1 #ifndef APP_HPP
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
2 #define APP_HPP
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
3
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
4 #include "Window.hpp"
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
5
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
6 class App : public Window_Listener
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
7 {
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
8 public:
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
9 App();
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
10 virtual ~App();
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
11
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
12 void Initialize();
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
13 void Finalize();
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
14
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
15 void Run();
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
16
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
17 virtual void On_Close();
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
18 virtual void On_Key_Down(int Key);
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
19 virtual void On_Key_Up(int Key);
4734
0c7c67d4e6ee Added On_Char method to Window_Listener for WM_CHAR messages.
dewyatt
parents: 4730
diff changeset
20 virtual void On_Char(unsigned int Char);
4738
381d402a5e90 Added support for On_Resized event to App.
dewyatt
parents: 4734
diff changeset
21 virtual void On_Resized(unsigned int Width, unsigned int Height);
4730
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
22
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
23 private:
4738
381d402a5e90 Added support for On_Resized event to App.
dewyatt
parents: 4734
diff changeset
24 void Update();
381d402a5e90 Added support for On_Resized event to App.
dewyatt
parents: 4734
diff changeset
25 void Draw();
381d402a5e90 Added support for On_Resized event to App.
dewyatt
parents: 4734
diff changeset
26
4734
0c7c67d4e6ee Added On_Char method to Window_Listener for WM_CHAR messages.
dewyatt
parents: 4730
diff changeset
27 static const int Width = 800;
0c7c67d4e6ee Added On_Char method to Window_Listener for WM_CHAR messages.
dewyatt
parents: 4730
diff changeset
28 static const int Height = 600;
0c7c67d4e6ee Added On_Char method to Window_Listener for WM_CHAR messages.
dewyatt
parents: 4730
diff changeset
29 static const int Bits_Per_Pixel = 32;
4738
381d402a5e90 Added support for On_Resized event to App.
dewyatt
parents: 4734
diff changeset
30 static const bool Fullscreen = true;
4734
0c7c67d4e6ee Added On_Char method to Window_Listener for WM_CHAR messages.
dewyatt
parents: 4730
diff changeset
31
4730
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
32 Window my_Window;
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
33 bool my_Done;
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
34 };
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
35
6032ada8b9e5 Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff changeset
36 #endif