203c9c2d3038c2359caf6e7d0e8c547772ea6ba7
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
68 begin
72 begin
78 begin
85 end
86 end
91 begin
92 {$IFDEF NOGL_INIT}
94 {$ELSE}
97 begin
99 begin
101 exit
102 end
103 end
104 {$ENDIF}
108 begin
114 begin
120 begin
129 begin
130 {$IFNDEF USE_SYSSTUB}
131 PrintGLSupportedExtensions;
133 {$ELSE}
136 {$ENDIF}
138 begin
141 end
142 else
143 begin
146 else
148 end
153 begin
155 begin
156 {$IFDEF NOGL_INIT}
157 nogl_Init;
158 {$ENDIF}
160 begin
162 {$IFDEF NOGL_INIT}
164 {$ELSE}
166 {$ENDIF}
168 begin
174 end
178 begin
180 begin
181 {$IFDEF NOGL_INIT}
182 nogl_Quit;
183 {$ENDIF}
185 end
189 begin
190 r_Game_LoadTextures;
191 r_Map_LoadTextures;
195 begin
196 r_Map_FreeTextures;
197 r_Game_FreeTextures;
201 begin
203 r_Player_Load;
204 r_Map_Load;
205 r_PlayerModel_Load;
206 r_Monsters_Load;
207 r_Weapon_Load;
208 r_Items_Load;
209 r_GFX_Load;
213 begin
214 r_GFX_Free;
215 r_Items_Free;
216 r_Weapon_Free;
217 r_Monsters_Free;
218 r_PlayerModel_Free;
219 r_Map_Free;
220 r_Player_Free;
221 r_Game_Free;
222 g_Texture_DeleteAll;
223 g_Frames_DeleteAll;
227 begin
230 LoadGL;
231 r_Window_Initialize;
232 r_Console_Init;
233 r_PlayerModel_Initialize;
234 r_Map_Initialize;
238 begin
239 r_Map_Finalize;
240 r_PlayerModel_Finalize;
241 FreeGL;
242 e_ReleaseEngine
246 begin
247 r_GFX_Update;
248 r_Map_Update;
249 r_PlayerModel_Update;
250 r_Console_Update;
254 begin
255 r_Game_Draw;
256 {$IFDEF ENABLE_TOUCH}
257 r_Touch_Draw;
258 {$ENDIF}
262 begin
263 LoadGL;
269 begin
270 // store real window size in gWinSize, downscale resolution now
274 begin
284 e_InitGL;
285 r_Game_SetupScreenSize;
289 begin
290 if sys_SetDisplayMode(Max(1, gRC_Width), Max(1, gRC_Height), Max(1, gBPP), gRC_FullScreen, gRC_Maximized) then
292 else
299 begin
301 try
303 try
306 except
310 finally
311 end
315 begin
320 begin
324 {$IFDEF ENABLE_TOUCH}
326 begin
329 {$ENDIF}
332 begin