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
20 uses
21 utils;
27 var
34 implementation
36 uses
38 {$IFDEF ENABLE_HOLMES}
40 {$ENDIF}
41 {$INCLUDE ../nogl/noGLuses.inc}
50 const
53 var
63 begin
67 {$IFNDEF HEADLESS}
68 var
70 {$ENDIF}
73 var
74 {$IFNDEF HEADLESS}
75 // ev: TSDL_Event;
77 {$ENDIF}
78 begin
79 // FillChar(ev, sizeof(ev), 0);
82 // while (SDL_PollEvent(@ev) > 0) do
83 // begin
84 // EventHandler(ev);
85 // if (ev.type_ = SDL_QUITEV) then break;
86 // end;
87 //e_PollJoysticks();
89 // if (ev.type_ = SDL_QUITEV) or (gExit = EXIT_QUIT) then
90 // begin
91 // wLoadingProgress := false;
92 // exit;
93 // end;
95 {$IFNDEF HEADLESS}
97 begin
99 begin
101 forceUpdate := (stt < prevLoadingUpdateTime) or (stt-prevLoadingUpdateTime >= ProgressUpdateMSecs);
105 begin
111 sys_Repaint;
115 {$ENDIF}
120 begin
122 end
123 else
124 begin
125 if (NetMode = NET_CLIENT) and (NetState <> NET_STATE_AUTH) then g_Net_Client_UpdateWhileLoading();
133 var
135 begin
144 begin
154 begin
157 begin
162 end
163 else
164 begin
175 begin
181 begin
183 exit;
186 // Âðåìÿ ïðåäûäóùåãî îáíîâëåíèÿ
188 begin
191 begin
192 Draw;
193 sys_Repaint
194 end
195 end
196 else
197 begin
206 begin
210 begin
213 begin
220 end
221 end
226 begin
230 begin
234 end
238 begin
247 var
249 {$IF not DEFINED(HEADLESS)}
251 {$ENDIF}
254 {$IFDEF ENABLE_HOLMES}
257 {$ENDIF}
258 begin
259 {$IFDEF HEADLESS}
261 {$ENDIF}
265 begin
269 //if arg = '--twinkletwinkle' then gwin_k8_enable_light_experiments := true;
287 {.$IF DEFINED(D2F_DEBUG)}
289 {.$ENDIF}
291 {$IFDEF ENABLE_HOLMES}
295 begin
297 begin
304 begin
306 begin
309 {$IFNDEF HEADLESS}
311 begin
318 {$ELSE}
319 // fuck off, fpc!
322 {$ENDIF}
326 {$ENDIF}
329 begin
331 begin
338 begin
346 PrintGLSupportedExtensions;
347 glLegacyNPOT := GLExtensionSupported('GL_ARB_texture_non_power_of_two') or GLExtensionSupported('GL_OES_texture_npot');
351 Init;
354 // Êîìàíäíàÿ ñòðîêà
357 {$IFNDEF HEADLESS}
358 // Çàïðîñ ÿçûêà
360 {$ENDIF}
364 // main loop
372 initialization