2a4c3e7247226170373c12d4ce38ea07ca61444e
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
39 {$IFDEF ENABLE_GIBS}
41 {$ENDIF}
43 {$IFDEF ENABLE_GFX}
45 {$ENDIF}
47 {$IFDEF ENABLE_TOUCH}
48 // touch screen button location and size
50 {$ENDIF}
54 implementation
56 uses
57 {$INCLUDE ../../nogl/noGLuses.inc}
58 {$IFDEF ENABLE_TOUCH}
59 r_touch,
60 {$ENDIF}
61 {$IFDEF ENABLE_GFX}
62 r_gfx,
63 {$ENDIF}
64 {$IFDEF ENABLE_SYSTEM}
65 g_system,
66 {$ENDIF}
72 ;
74 var
79 begin
83 begin
89 begin
96 end
97 end
102 begin
103 {$IFDEF NOGL_INIT}
105 {$ELSE}
108 begin
110 begin
112 exit
113 end
114 end
115 {$ENDIF}
119 begin
125 begin
131 begin
140 begin
141 {$IFNDEF USE_SYSSTUB}
142 PrintGLSupportedExtensions;
144 {$ELSE}
147 {$ENDIF}
149 begin
152 end
153 else
154 begin
157 else
159 end
164 begin
166 begin
167 {$IFDEF NOGL_INIT}
168 nogl_Init;
169 {$ENDIF}
171 begin
173 {$IFDEF NOGL_INIT}
175 {$ELSE}
177 {$ENDIF}
179 begin
185 end
189 begin
191 begin
192 {$IFDEF NOGL_INIT}
193 nogl_Quit;
194 {$ENDIF}
196 end
200 begin
201 r_Game_LoadTextures;
202 r_Map_LoadTextures;
206 begin
207 r_Map_FreeTextures;
208 r_Game_FreeTextures;
212 begin
214 r_Player_Load;
215 r_Map_Load;
216 r_PlayerModel_Load;
217 r_Monsters_Load;
218 r_Weapon_Load;
219 r_Items_Load;
220 {$IFDEF ENABLE_GFX}
221 r_GFX_Load;
222 {$ENDIF}
226 begin
227 {$IFDEF ENABLE_GFX}
228 r_GFX_Free;
229 {$ENDIF}
230 r_Items_Free;
231 r_Weapon_Free;
232 r_Monsters_Free;
233 r_PlayerModel_Free;
234 r_Map_Free;
235 r_Player_Free;
236 r_Game_Free;
237 g_Texture_DeleteAll;
238 g_Frames_DeleteAll;
242 begin
243 {$IFDEF ENABLE_SYSTEM}
246 {$ENDIF}
247 LoadGL;
248 r_Window_Initialize;
249 r_Console_Init;
250 r_PlayerModel_Initialize;
251 r_Map_Initialize;
255 begin
256 r_Map_Finalize;
257 r_PlayerModel_Finalize;
258 FreeGL;
259 e_ReleaseEngine
263 begin
264 {$IFDEF ENABLE_GFX}
265 r_GFX_Update;
266 {$ENDIF}
267 r_Map_Update;
268 r_PlayerModel_Update;
269 r_Console_Update;
273 begin
274 r_Game_Draw;
275 {$IFDEF ENABLE_TOUCH}
276 r_Touch_Draw;
277 {$ENDIF}
281 begin
282 LoadGL;
288 begin
289 // store real window size in gWinSize, downscale resolution now
293 begin
303 e_InitGL;
304 r_Game_SetupScreenSize;
308 begin
309 {$IFDEF ENABLE_SYSTEM}
310 if sys_SetDisplayMode(Max(1, gRC_Width), Max(1, gRC_Height), Max(1, gBPP), gRC_FullScreen, gRC_Maximized) then
312 else
315 {$ENDIF}
320 begin
322 try
324 try
327 except
331 finally
332 end
335 {$IFDEF ENABLE_GIBS}
337 begin
340 {$ENDIF}
342 {$IFDEF ENABLE_GFX}
344 begin
347 {$ENDIF}
349 {$IFDEF ENABLE_TOUCH}
351 begin
354 {$ENDIF}
357 begin