74bb0ab78f972e405cf649fd4cdcb682dd9fb3af
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
41 {$IFDEF ENABLE_GFX}
43 {$ENDIF}
45 {$IFDEF ENABLE_TOUCH}
46 // touch screen button location and size
48 {$ENDIF}
52 implementation
54 uses
55 {$INCLUDE ../../nogl/noGLuses.inc}
56 {$IFDEF ENABLE_TOUCH}
57 r_touch,
58 {$ENDIF}
59 {$IFDEF ENABLE_GFX}
60 r_gfx,
61 {$ENDIF}
67 ;
69 var
74 begin
78 begin
84 begin
91 end
92 end
97 begin
98 {$IFDEF NOGL_INIT}
100 {$ELSE}
103 begin
105 begin
107 exit
108 end
109 end
110 {$ENDIF}
114 begin
120 begin
126 begin
135 begin
136 {$IFNDEF USE_SYSSTUB}
137 PrintGLSupportedExtensions;
139 {$ELSE}
142 {$ENDIF}
144 begin
147 end
148 else
149 begin
152 else
154 end
159 begin
161 begin
162 {$IFDEF NOGL_INIT}
163 nogl_Init;
164 {$ENDIF}
166 begin
168 {$IFDEF NOGL_INIT}
170 {$ELSE}
172 {$ENDIF}
174 begin
180 end
184 begin
186 begin
187 {$IFDEF NOGL_INIT}
188 nogl_Quit;
189 {$ENDIF}
191 end
195 begin
196 r_Game_LoadTextures;
197 r_Map_LoadTextures;
201 begin
202 r_Map_FreeTextures;
203 r_Game_FreeTextures;
207 begin
209 r_Player_Load;
210 r_Map_Load;
211 r_PlayerModel_Load;
212 r_Monsters_Load;
213 r_Weapon_Load;
214 r_Items_Load;
215 {$IFDEF ENABLE_GFX}
216 r_GFX_Load;
217 {$ENDIF}
221 begin
222 {$IFDEF ENABLE_GFX}
223 r_GFX_Free;
224 {$ENDIF}
225 r_Items_Free;
226 r_Weapon_Free;
227 r_Monsters_Free;
228 r_PlayerModel_Free;
229 r_Map_Free;
230 r_Player_Free;
231 r_Game_Free;
232 g_Texture_DeleteAll;
233 g_Frames_DeleteAll;
237 begin
240 LoadGL;
241 r_Window_Initialize;
242 r_Console_Init;
243 r_PlayerModel_Initialize;
244 r_Map_Initialize;
248 begin
249 r_Map_Finalize;
250 r_PlayerModel_Finalize;
251 FreeGL;
252 e_ReleaseEngine
256 begin
257 {$IFDEF ENABLE_GFX}
258 r_GFX_Update;
259 {$ENDIF}
260 r_Map_Update;
261 r_PlayerModel_Update;
262 r_Console_Update;
266 begin
267 r_Game_Draw;
268 {$IFDEF ENABLE_TOUCH}
269 r_Touch_Draw;
270 {$ENDIF}
274 begin
275 LoadGL;
281 begin
282 // store real window size in gWinSize, downscale resolution now
286 begin
296 e_InitGL;
297 r_Game_SetupScreenSize;
301 begin
302 if sys_SetDisplayMode(Max(1, gRC_Width), Max(1, gRC_Height), Max(1, gBPP), gRC_FullScreen, gRC_Maximized) then
304 else
311 begin
313 try
315 try
318 except
322 finally
323 end
327 begin
331 {$IFDEF ENABLE_GFX}
333 begin
336 {$ENDIF}
338 {$IFDEF ENABLE_TOUCH}
340 begin
343 {$ENDIF}
346 begin