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
43 implementation
45 uses
46 {$INCLUDE ../../nogl/noGLuses.inc}
52 ;
54 var
58 begin
60 begin
61 {$IFDEF NOGL_INIT}
62 nogl_Init;
64 begin
68 {$ELSE}
70 begin
74 {$ENDIF}
76 end
80 begin
82 begin
83 {$IFDEF NOGL_INIT}
84 nogl_Quit;
85 {$ENDIF}
87 end
91 begin
92 r_Game_LoadTextures;
93 r_Map_LoadTextures;
97 begin
98 r_Map_FreeTextures;
99 r_Game_FreeTextures;
103 begin
105 r_Player_Load;
106 r_Map_Load;
107 r_PlayerModel_Load;
108 r_Monsters_Load;
109 r_Weapon_Load;
110 r_Items_Load;
111 r_GFX_Load;
115 begin
116 r_GFX_Free;
117 r_Items_Free;
118 r_Weapon_Free;
119 r_Monsters_Free;
120 r_PlayerModel_Free;
121 r_Map_Free;
122 r_Player_Free;
123 r_Game_Free;
124 g_Texture_DeleteAll;
125 g_Frames_DeleteAll;
129 begin
132 LoadGL;
133 r_Window_Initialize;
134 r_Console_Init;
135 r_PlayerModel_Initialize;
136 r_Map_Initialize;
140 begin
141 r_Map_Finalize;
142 r_PlayerModel_Finalize;
143 FreeGL;
144 e_ReleaseEngine
148 begin
149 r_GFX_Update;
150 r_Map_Update;
151 r_PlayerModel_Update;
152 r_Console_Update;
156 begin
157 LoadGL;
163 begin
164 // store real window size in gWinSize, downscale resolution now
168 begin
178 e_InitGL;
179 r_Game_SetupScreenSize;
183 begin
184 if sys_SetDisplayMode(Max(1, gRC_Width), Max(1, gRC_Height), Max(1, gBPP), gRC_FullScreen, gRC_Maximized) then
186 else
193 begin
195 try
197 try
200 except
204 finally
205 end
209 begin
214 begin
219 begin