DEADSOFTWARE

gl: interpolate platforms
[d2df-sdl.git] / src / game / renders / stub / r_render.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_render;
18 interface
20 uses
21 {$IFDEF ENABLE_MENU}
22 g_gui,
23 {$ENDIF}
24 g_base // TRectWH
25 ;
27 procedure r_Render_Initialize;
28 procedure r_Render_Finalize;
30 procedure r_Render_Load;
31 procedure r_Render_Free;
33 procedure r_Render_LoadTextures;
34 procedure r_Render_FreeTextures;
36 procedure r_Render_Update;
37 procedure r_Render_Draw;
39 procedure r_Render_Resize (w, h: Integer);
40 procedure r_Render_Apply;
42 function r_Render_WriteScreenShot (filename: String): Boolean;
44 {$IFDEF ENABLE_GIBS}
45 function r_Render_GetGibRect (m, id: Integer): TRectWH;
46 {$ENDIF}
48 {$IFDEF ENABLE_GFX}
49 procedure r_Render_QueueEffect (AnimType, X, Y: Integer);
50 {$ENDIF}
52 {$IFDEF ENABLE_TOUCH}
53 // touch screen button location and size
54 procedure r_Render_GetKeyRect (key: Integer; out x, y, w, h: Integer; out founded: Boolean);
55 {$ENDIF}
57 {$IFDEF ENABLE_MENU}
58 procedure r_Render_GetControlSize (ctrl: TGUIControl; out w, h: Integer);
59 procedure r_Render_GetLogoSize (out w, h: Integer);
60 procedure r_Render_GetMaxFontSize (BigFont: Boolean; out w, h: Integer);
61 procedure r_Render_GetStringSize (BigFont: Boolean; str: String; out w, h: Integer);
62 {$ENDIF}
64 procedure r_Render_DrawLoading (force: Boolean); // !!! remove it
66 implementation
68 uses
69 {$IFDEF ENABLE_SYSTEM}
70 g_system,
71 {$ENDIF}
72 SysUtils, Classes, Math,
73 e_log, utils,
74 g_game, g_options, g_console
75 ;
77 procedure r_Render_LoadTextures;
78 begin
79 end;
81 procedure r_Render_FreeTextures;
82 begin
83 end;
85 procedure r_Render_Load;
86 begin
87 end;
89 procedure r_Render_Free;
90 begin
91 end;
93 procedure r_Render_Initialize;
94 begin
95 {$IFDEF ENABLE_SYSTEM}
96 if sys_SetDisplayMode(gRC_Width, gRC_Height, gBPP, gRC_FullScreen, gRC_Maximized) = False then
97 raise Exception.Create('Failed to set videomode on startup.');
98 {$ENDIF}
99 end;
101 procedure r_Render_Finalize;
102 begin
103 end;
105 procedure r_Render_Update;
106 begin
107 end;
109 procedure r_Render_Draw;
110 begin
111 end;
113 procedure r_Render_Resize (w, h: Integer);
114 begin
115 gWinSizeX := w;
116 gWinSizeY := h;
117 gRC_Width := w;
118 gRC_Height := h;
119 gScreenWidth := w;
120 gScreenHeight := h;
121 end;
123 procedure r_Render_Apply;
124 begin
125 {$IFDEF ENABLE_SYSTEM}
126 if sys_SetDisplayMode(Max(1, gRC_Width), Max(1, gRC_Height), Max(1, gBPP), gRC_FullScreen, gRC_Maximized) then
127 e_LogWriteln('resolution changed')
128 else
129 e_LogWriteln('resolution not changed');
130 sys_EnableVSync(gVSync)
131 {$ENDIF}
132 end;
134 function r_Render_WriteScreenShot (filename: String): Boolean;
135 begin
136 Result := False;
137 end;
139 {$IFDEF ENABLE_GIBS}
140 function r_Render_GetGibRect (m, id: Integer): TRectWH;
141 begin
142 Result.X := 16;
143 Result.Y := 16;
144 Result.Width := 16;
145 Result.Height := 16;
146 end;
147 {$ENDIF}
149 {$IFDEF ENABLE_GFX}
150 procedure r_Render_QueueEffect (AnimType, X, Y: Integer);
151 begin
152 end;
153 {$ENDIF}
155 {$IFDEF ENABLE_TOUCH}
156 procedure r_Render_GetKeyRect (key: Integer; out x, y, w, h: Integer; out founded: Boolean);
157 begin
158 founded := False;
159 end;
160 {$ENDIF}
162 {$IFDEF ENABLE_MENU}
163 procedure r_Render_GetControlSize (ctrl: TGUIControl; out w, h: Integer);
164 begin
165 w := 0; h := 0;
166 end;
168 procedure r_Render_GetLogoSize (out w, h: Integer);
169 begin
170 w := 0; h := 0;
171 end;
173 procedure r_Render_GetMaxFontSize (BigFont: Boolean; out w, h: Integer);
174 begin
175 w := 0; h := 0;
176 end;
178 procedure r_Render_GetStringSize (BigFont: Boolean; str: String; out w, h: Integer);
179 begin
180 w := 0; h := 0;
181 end;
182 {$ENDIF}
184 procedure r_Render_DrawLoading (force: Boolean);
185 begin
186 end;
188 end.