2eec521475ec4c7806fa08c8d63a59538c1da293
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
35 implementation
37 uses
38 {$INCLUDE ../../nogl/noGLuses.inc}
44 ;
46 var
50 begin
52 begin
53 {$IFDEF NOGL_INIT}
54 nogl_Init;
56 begin
60 {$ELSE}
62 begin
66 {$ENDIF}
68 end
72 begin
74 begin
75 {$IFDEF NOGL_INIT}
76 nogl_Quit;
77 {$ENDIF}
79 end
83 begin
84 r_Game_LoadTextures;
85 r_Map_LoadTextures;
89 begin
90 r_Map_FreeTextures;
91 r_Game_FreeTextures;
95 begin
97 r_Player_Load;
98 r_Map_Load;
99 r_PlayerModel_Load;
100 r_Monsters_Load;
101 r_Weapon_Load;
102 r_Items_Load;
103 r_GFX_Load;
107 begin
108 r_GFX_Free;
109 r_Items_Free;
110 r_Weapon_Free;
111 r_Monsters_Free;
112 r_PlayerModel_Free;
113 r_Map_Free;
114 r_Player_Free;
115 r_Game_Free;
116 g_Texture_DeleteAll;
117 g_Frames_DeleteAll;
121 begin
124 LoadGL;
125 r_Window_Initialize;
126 r_Console_Init;
127 r_PlayerModel_Initialize;
128 r_Map_Initialize;
132 begin
133 r_Map_Finalize;
134 r_PlayerModel_Finalize;
135 FreeGL;
136 e_ReleaseEngine
140 begin
141 r_Map_Update;
142 r_PlayerModel_Update;
146 begin
147 LoadGL;
153 begin
154 // store real window size in gWinSize, downscale resolution now
158 begin
168 e_InitGL
172 begin
173 if sys_SetDisplayMode(Max(1, gRC_Width), Max(1, gRC_Height), Max(1, gBPP), gRC_FullScreen, gRC_Maximized) then
175 else