3535a2d2969b02b4559b2fdef0bf5e870aa4259c
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
36 implementation
38 uses
39 {$INCLUDE ../../nogl/noGLuses.inc}
45 ;
47 var
51 begin
53 begin
54 {$IFDEF NOGL_INIT}
55 nogl_Init;
57 begin
61 {$ELSE}
63 begin
67 {$ENDIF}
69 end
73 begin
75 begin
76 {$IFDEF NOGL_INIT}
77 nogl_Quit;
78 {$ENDIF}
80 end
84 begin
85 r_Game_LoadTextures;
86 r_Map_LoadTextures;
90 begin
91 r_Map_FreeTextures;
92 r_Game_FreeTextures;
96 begin
98 r_Player_Load;
99 r_Map_Load;
100 r_PlayerModel_Load;
101 r_Monsters_Load;
102 r_Weapon_Load;
103 r_Items_Load;
104 r_GFX_Load;
108 begin
109 r_GFX_Free;
110 r_Items_Free;
111 r_Weapon_Free;
112 r_Monsters_Free;
113 r_PlayerModel_Free;
114 r_Map_Free;
115 r_Player_Free;
116 r_Game_Free;
117 g_Texture_DeleteAll;
118 g_Frames_DeleteAll;
122 begin
125 LoadGL;
126 r_Window_Initialize;
127 r_Console_Init;
128 r_PlayerModel_Initialize;
129 r_Map_Initialize;
133 begin
134 r_Map_Finalize;
135 r_PlayerModel_Finalize;
136 FreeGL;
137 e_ReleaseEngine
141 begin
142 r_Map_Update;
143 r_PlayerModel_Update;
147 begin
148 LoadGL;
154 begin
155 // store real window size in gWinSize, downscale resolution now
159 begin
169 e_InitGL;
170 r_Game_SetupScreenSize;
174 begin
175 if sys_SetDisplayMode(Max(1, gRC_Width), Max(1, gRC_Height), Max(1, gBPP), gRC_FullScreen, gRC_Maximized) then
177 else
184 begin
186 try
188 try
191 except
195 finally
196 end