2e356dd1b68d4e3ab8ffce0c8cb976a501c48e47
1 (* Copyright (C) Doom 2D: Forever Developers
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, version 3 of the License ONLY.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 *)
15 {$INCLUDE ../../shared/a_modes.inc}
18 interface
42 {$IFDEF ENABLE_TOUCH}
43 // touch screen button location and size
45 {$ENDIF}
49 implementation
51 uses
52 {$INCLUDE ../../nogl/noGLuses.inc}
53 {$IFDEF ENABLE_TOUCH}
54 r_touch,
55 {$ENDIF}
61 ;
63 var
67 begin
69 begin
70 {$IFDEF NOGL_INIT}
71 nogl_Init;
73 begin
77 {$ELSE}
79 begin
83 {$ENDIF}
85 end
89 begin
91 begin
92 {$IFDEF NOGL_INIT}
93 nogl_Quit;
94 {$ENDIF}
96 end
100 begin
101 r_Game_LoadTextures;
102 r_Map_LoadTextures;
106 begin
107 r_Map_FreeTextures;
108 r_Game_FreeTextures;
112 begin
114 r_Player_Load;
115 r_Map_Load;
116 r_PlayerModel_Load;
117 r_Monsters_Load;
118 r_Weapon_Load;
119 r_Items_Load;
120 r_GFX_Load;
124 begin
125 r_GFX_Free;
126 r_Items_Free;
127 r_Weapon_Free;
128 r_Monsters_Free;
129 r_PlayerModel_Free;
130 r_Map_Free;
131 r_Player_Free;
132 r_Game_Free;
133 g_Texture_DeleteAll;
134 g_Frames_DeleteAll;
138 begin
141 LoadGL;
142 r_Window_Initialize;
143 r_Console_Init;
144 r_PlayerModel_Initialize;
145 r_Map_Initialize;
149 begin
150 r_Map_Finalize;
151 r_PlayerModel_Finalize;
152 FreeGL;
153 e_ReleaseEngine
157 begin
158 r_GFX_Update;
159 r_Map_Update;
160 r_PlayerModel_Update;
161 r_Console_Update;
165 begin
166 r_Game_Draw;
167 {$IFDEF ENABLE_TOUCH}
168 r_Touch_Draw;
169 {$ENDIF}
173 begin
174 LoadGL;
180 begin
181 // store real window size in gWinSize, downscale resolution now
185 begin
195 e_InitGL;
196 r_Game_SetupScreenSize;
200 begin
201 if sys_SetDisplayMode(Max(1, gRC_Width), Max(1, gRC_Height), Max(1, gBPP), gRC_FullScreen, gRC_Maximized) then
203 else
210 begin
212 try
214 try
217 except
221 finally
222 end
226 begin
231 begin
235 {$IFDEF ENABLE_TOUCH}
237 begin
240 {$ENDIF}
243 begin