DEADSOFTWARE

render: disable FBO on devices which not support NPOT textures
[d2df-sdl.git] / src / game / opengl / r_window.pas
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}
16 unit r_window;
18 interface
20 procedure r_Window_DrawLoading (forceUpdate: Boolean);
22 implementation
24 uses
25 {$INCLUDE ../nogl/noGLuses.inc}
26 SysUtils, Classes,
27 e_log, utils,
28 r_graphics, r_game, r_console, g_system,
29 g_options, g_game, g_console,
30 xprofiler
31 ;
33 const
34 ProgressUpdateMSecs = 35; //1;//100;
36 var
37 prevLoadingUpdateTime: UInt64;
39 procedure r_Window_DrawLoading (forceUpdate: Boolean);
40 var stt: UInt64;
41 begin
42 if e_NoGraphics = False then
43 begin
44 if not forceUpdate then
45 begin
46 stt := getTimeMilli();
47 forceUpdate := (stt < prevLoadingUpdateTime) or (stt-prevLoadingUpdateTime >= ProgressUpdateMSecs);
48 end;
50 if forceUpdate then
51 begin
52 e_SetRendertarget(True);
53 e_SetViewPort(0, 0, gScreenWidth, gScreenHeight);
55 r_Game_DrawMenuBackground('INTER');
56 e_DarkenQuadWH(0, 0, gScreenWidth, gScreenHeight, 150);
57 r_Game_DrawLoadingStat();
58 r_Console_Draw(True);
60 e_SetRendertarget(False);
61 e_SetViewPort(0, 0, gWinSizeX, gWinSizeY);
62 e_BlitFramebuffer(gWinSizeX, gWinSizeY);
64 sys_Repaint;
65 prevLoadingUpdateTime := getTimeMilli();
66 end;
67 end;
68 end;
70 end.