Mercurial > sdl-ios-xcode
annotate EXCLUDE/GLTSF/src/App.cpp @ 4730:6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
author | dewyatt |
---|---|
date | Tue, 25 May 2010 18:53:09 -0400 |
parents | |
children | 0c7c67d4e6ee |
rev | line source |
---|---|
4730
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
1 #include "App.hpp" |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
2 |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
3 App::App() : my_Done(false) |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
4 { |
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 } |
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 App::~App() |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
9 { |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
10 Finalize(); |
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 |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
13 void App::Initialize() |
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 Finalize(); |
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 my_Window.Initialize(L"GLTSF", Video_Mode(800, 600, 32), false); |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
18 my_Window.Set_Listener(this); |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
19 my_Window.Show(); |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
20 } |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
21 |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
22 void App::Finalize() |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
23 { |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
24 my_Window.Finalize(); |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
25 } |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
26 |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
27 void App::Run() |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
28 { |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
29 Initialize(); |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
30 while (!my_Done) |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
31 { |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
32 my_Window.Update(); |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
33 my_Window.Display(); |
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 |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
37 void App::On_Close() |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
38 { |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
39 my_Done = true; |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
40 my_Window.Hide(); |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
41 } |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
42 |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
43 void App::On_Key_Down(int Key) |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
44 { |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
45 switch (Key) |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
46 { |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
47 case VK_ESCAPE: |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
48 On_Close(); |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
49 break; |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
50 } |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
51 } |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
52 |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
53 void App::On_Key_Up(int Key) |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
54 { |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
55 |
6032ada8b9e5
Adding GLTSF (somewhat based on SFML, no actual TSF code yet)
dewyatt
parents:
diff
changeset
|
56 } |