OpenTTD
allegro_v.cpp
Go to the documentation of this file.
1 /* $Id$ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8  */
9 
17 #ifdef WITH_ALLEGRO
18 
19 #include "../stdafx.h"
20 #include "../openttd.h"
21 #include "../gfx_func.h"
22 #include "../rev.h"
23 #include "../blitter/factory.hpp"
24 #include "../network/network.h"
25 #include "../core/random_func.hpp"
26 #include "../core/math_func.hpp"
27 #include "../framerate_type.h"
28 #include "../thread.h"
29 #include "allegro_v.h"
30 #include <allegro.h>
31 #include <algorithm>
32 
33 #include "../safeguards.h"
34 
35 #ifdef _DEBUG
36 /* Allegro replaces SEGV/ABRT signals meaning that the debugger will never
37  * be triggered, so rereplace the signals and make the debugger useful. */
38 #include <signal.h>
39 #endif
40 
41 static FVideoDriver_Allegro iFVideoDriver_Allegro;
42 
43 static BITMAP *_allegro_screen;
44 
45 #define MAX_DIRTY_RECTS 100
46 static PointDimension _dirty_rects[MAX_DIRTY_RECTS];
47 static int _num_dirty_rects;
48 
49 void VideoDriver_Allegro::MakeDirty(int left, int top, int width, int height)
50 {
51  if (_num_dirty_rects < MAX_DIRTY_RECTS) {
52  _dirty_rects[_num_dirty_rects].x = left;
53  _dirty_rects[_num_dirty_rects].y = top;
54  _dirty_rects[_num_dirty_rects].width = width;
55  _dirty_rects[_num_dirty_rects].height = height;
56  }
57  _num_dirty_rects++;
58 }
59 
60 static void DrawSurfaceToScreen()
61 {
62  PerformanceMeasurer framerate(PFE_VIDEO);
63 
64  int n = _num_dirty_rects;
65  if (n == 0) return;
66 
67  _num_dirty_rects = 0;
68  if (n > MAX_DIRTY_RECTS) {
69  blit(_allegro_screen, screen, 0, 0, 0, 0, _allegro_screen->w, _allegro_screen->h);
70  return;
71  }
72 
73  for (int i = 0; i < n; i++) {
74  blit(_allegro_screen, screen, _dirty_rects[i].x, _dirty_rects[i].y, _dirty_rects[i].x, _dirty_rects[i].y, _dirty_rects[i].width, _dirty_rects[i].height);
75  }
76 }
77 
78 
79 static void UpdatePalette(uint start, uint count)
80 {
81  static PALETTE pal;
82 
83  uint end = start + count;
84  for (uint i = start; i != end; i++) {
85  pal[i].r = _cur_palette.palette[i].r / 4;
86  pal[i].g = _cur_palette.palette[i].g / 4;
87  pal[i].b = _cur_palette.palette[i].b / 4;
88  pal[i].filler = 0;
89  }
90 
91  set_palette_range(pal, start, end - 1, 1);
92 }
93 
94 static void InitPalette()
95 {
96  UpdatePalette(0, 256);
97 }
98 
99 static void CheckPaletteAnim()
100 {
101  if (_cur_palette.count_dirty != 0) {
103 
104  switch (blitter->UsePaletteAnimation()) {
107  break;
108 
110  blitter->PaletteAnimate(_cur_palette);
111  break;
112 
114  break;
115 
116  default:
117  NOT_REACHED();
118  }
120  }
121 }
122 
123 static const Dimension default_resolutions[] = {
124  { 640, 480},
125  { 800, 600},
126  {1024, 768},
127  {1152, 864},
128  {1280, 800},
129  {1280, 960},
130  {1280, 1024},
131  {1400, 1050},
132  {1600, 1200},
133  {1680, 1050},
134  {1920, 1200}
135 };
136 
137 static void GetVideoModes()
138 {
139  /* Need to set a gfx_mode as there is NO other way to autodetect for
140  * cards ourselves... and we need a card to get the modes. */
141  set_gfx_mode(_fullscreen ? GFX_AUTODETECT_FULLSCREEN : GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
142 
143  _resolutions.clear();
144 
145  GFX_MODE_LIST *mode_list = get_gfx_mode_list(gfx_driver->id);
146  if (mode_list == nullptr) {
147  _resolutions.assign(std::begin(default_resolutions), std::end(default_resolutions));
148  return;
149  }
150 
151  GFX_MODE *modes = mode_list->mode;
152 
153  for (int i = 0; modes[i].bpp != 0; i++) {
154  uint w = modes[i].width;
155  uint h = modes[i].height;
156  if (w < 640 || h < 480) continue;
157  if (std::find(_resolutions.begin(), _resolutions.end(), Dimension(w, h)) != _resolutions.end()) continue;
158  _resolutions.emplace_back(w, h);
159  }
160 
161  SortResolutions();
162 
163  destroy_gfx_mode_list(mode_list);
164 }
165 
166 static void GetAvailableVideoMode(uint *w, uint *h)
167 {
168  /* No video modes, so just try it and see where it ends */
169  if (_resolutions.empty()) return;
170 
171  /* is the wanted mode among the available modes? */
172  if (std::find(_resolutions.begin(), _resolutions.end(), Dimension(*w, *h)) != _resolutions.end()) return;
173 
174  /* use the closest possible resolution */
175  uint best = 0;
176  uint delta = Delta(_resolutions[0].width, *w) * Delta(_resolutions[0].height, *h);
177  for (uint i = 1; i != _resolutions.size(); ++i) {
178  uint newdelta = Delta(_resolutions[i].width, *w) * Delta(_resolutions[i].height, *h);
179  if (newdelta < delta) {
180  best = i;
181  delta = newdelta;
182  }
183  }
184  *w = _resolutions[best].width;
185  *h = _resolutions[best].height;
186 }
187 
188 static bool CreateMainSurface(uint w, uint h)
189 {
191  if (bpp == 0) usererror("Can't use a blitter that blits 0 bpp for normal visuals");
192  set_color_depth(bpp);
193 
194  GetAvailableVideoMode(&w, &h);
195  if (set_gfx_mode(_fullscreen ? GFX_AUTODETECT_FULLSCREEN : GFX_AUTODETECT_WINDOWED, w, h, 0, 0) != 0) {
196  DEBUG(driver, 0, "Allegro: Couldn't allocate a window to draw on '%s'", allegro_error);
197  return false;
198  }
199 
200  /* The size of the screen might be bigger than the part we can actually draw on!
201  * So calculate the size based on the top, bottom, left and right */
202  _allegro_screen = create_bitmap_ex(bpp, screen->cr - screen->cl, screen->cb - screen->ct);
203  _screen.width = _allegro_screen->w;
204  _screen.height = _allegro_screen->h;
205  _screen.pitch = ((byte*)screen->line[1] - (byte*)screen->line[0]) / (bpp / 8);
206  _screen.dst_ptr = _allegro_screen->line[0];
207 
208  /* Initialise the screen so we don't blit garbage to the screen */
209  memset(_screen.dst_ptr, 0, _screen.height * _screen.pitch);
210 
211  /* Set the mouse at the place where we expect it */
212  poll_mouse();
213  _cursor.pos.x = mouse_x;
214  _cursor.pos.y = mouse_y;
215 
217 
218  InitPalette();
219 
220  char caption[32];
221  seprintf(caption, lastof(caption), "OpenTTD %s", _openttd_revision);
222  set_window_title(caption);
223 
224  enable_hardware_cursor();
225  select_mouse_cursor(MOUSE_CURSOR_ARROW);
226  show_mouse(_allegro_screen);
227 
228  GameSizeChanged();
229 
230  return true;
231 }
232 
233 bool VideoDriver_Allegro::ClaimMousePointer()
234 {
235  select_mouse_cursor(MOUSE_CURSOR_NONE);
236  show_mouse(nullptr);
237  disable_hardware_cursor();
238  return true;
239 }
240 
241 struct VkMapping {
242  uint16 vk_from;
243  byte vk_count;
244  byte map_to;
245 };
246 
247 #define AS(x, z) {x, 0, z}
248 #define AM(x, y, z, w) {x, y - x, z}
249 
250 static const VkMapping _vk_mapping[] = {
251  /* Pageup stuff + up/down */
252  AM(KEY_PGUP, KEY_PGDN, WKC_PAGEUP, WKC_PAGEDOWN),
253  AS(KEY_UP, WKC_UP),
254  AS(KEY_DOWN, WKC_DOWN),
255  AS(KEY_LEFT, WKC_LEFT),
256  AS(KEY_RIGHT, WKC_RIGHT),
257 
258  AS(KEY_HOME, WKC_HOME),
259  AS(KEY_END, WKC_END),
260 
261  AS(KEY_INSERT, WKC_INSERT),
262  AS(KEY_DEL, WKC_DELETE),
263 
264  /* Map letters & digits */
265  AM(KEY_A, KEY_Z, 'A', 'Z'),
266  AM(KEY_0, KEY_9, '0', '9'),
267 
268  AS(KEY_ESC, WKC_ESC),
269  AS(KEY_PAUSE, WKC_PAUSE),
270  AS(KEY_BACKSPACE, WKC_BACKSPACE),
271 
272  AS(KEY_SPACE, WKC_SPACE),
273  AS(KEY_ENTER, WKC_RETURN),
274  AS(KEY_TAB, WKC_TAB),
275 
276  /* Function keys */
277  AM(KEY_F1, KEY_F12, WKC_F1, WKC_F12),
278 
279  /* Numeric part. */
280  AM(KEY_0_PAD, KEY_9_PAD, '0', '9'),
281  AS(KEY_SLASH_PAD, WKC_NUM_DIV),
282  AS(KEY_ASTERISK, WKC_NUM_MUL),
283  AS(KEY_MINUS_PAD, WKC_NUM_MINUS),
284  AS(KEY_PLUS_PAD, WKC_NUM_PLUS),
285  AS(KEY_ENTER_PAD, WKC_NUM_ENTER),
286  AS(KEY_DEL_PAD, WKC_DELETE),
287 
288  /* Other non-letter keys */
289  AS(KEY_SLASH, WKC_SLASH),
290  AS(KEY_SEMICOLON, WKC_SEMICOLON),
291  AS(KEY_EQUALS, WKC_EQUALS),
292  AS(KEY_OPENBRACE, WKC_L_BRACKET),
293  AS(KEY_BACKSLASH, WKC_BACKSLASH),
294  AS(KEY_CLOSEBRACE, WKC_R_BRACKET),
295 
296  AS(KEY_QUOTE, WKC_SINGLEQUOTE),
297  AS(KEY_COMMA, WKC_COMMA),
298  AS(KEY_MINUS, WKC_MINUS),
299  AS(KEY_STOP, WKC_PERIOD),
300  AS(KEY_TILDE, WKC_BACKQUOTE),
301 };
302 
303 static uint32 ConvertAllegroKeyIntoMy(WChar *character)
304 {
305  int scancode;
306  int unicode = ureadkey(&scancode);
307 
308  const VkMapping *map;
309  uint key = 0;
310 
311  for (map = _vk_mapping; map != endof(_vk_mapping); ++map) {
312  if ((uint)(scancode - map->vk_from) <= map->vk_count) {
313  key = scancode - map->vk_from + map->map_to;
314  break;
315  }
316  }
317 
318  if (key_shifts & KB_SHIFT_FLAG) key |= WKC_SHIFT;
319  if (key_shifts & KB_CTRL_FLAG) key |= WKC_CTRL;
320  if (key_shifts & KB_ALT_FLAG) key |= WKC_ALT;
321 #if 0
322  DEBUG(driver, 0, "Scancode character pressed %u", scancode);
323  DEBUG(driver, 0, "Unicode character pressed %u", unicode);
324 #endif
325 
326  *character = unicode;
327  return key;
328 }
329 
330 static const uint LEFT_BUTTON = 0;
331 static const uint RIGHT_BUTTON = 1;
332 
333 static void PollEvent()
334 {
335  poll_mouse();
336 
337  bool mouse_action = false;
338 
339  /* Mouse buttons */
340  static int prev_button_state;
341  if (prev_button_state != mouse_b) {
342  uint diff = prev_button_state ^ mouse_b;
343  while (diff != 0) {
344  uint button = FindFirstBit(diff);
345  ClrBit(diff, button);
346  if (HasBit(mouse_b, button)) {
347  /* Pressed mouse button */
348  if (_rightclick_emulate && (key_shifts & KB_CTRL_FLAG)) {
349  button = RIGHT_BUTTON;
350  ClrBit(diff, RIGHT_BUTTON);
351  }
352  switch (button) {
353  case LEFT_BUTTON:
354  _left_button_down = true;
355  break;
356 
357  case RIGHT_BUTTON:
358  _right_button_down = true;
359  _right_button_clicked = true;
360  break;
361 
362  default:
363  /* ignore rest */
364  break;
365  }
366  } else {
367  /* Released mouse button */
368  if (_rightclick_emulate) {
369  _right_button_down = false;
370  _left_button_down = false;
371  _left_button_clicked = false;
372  } else if (button == LEFT_BUTTON) {
373  _left_button_down = false;
374  _left_button_clicked = false;
375  } else if (button == RIGHT_BUTTON) {
376  _right_button_down = false;
377  }
378  }
379  }
380  prev_button_state = mouse_b;
381  mouse_action = true;
382  }
383 
384  /* Mouse movement */
385  if (_cursor.UpdateCursorPosition(mouse_x, mouse_y, false)) {
386  position_mouse(_cursor.pos.x, _cursor.pos.y);
387  }
388  if (_cursor.delta.x != 0 || _cursor.delta.y) mouse_action = true;
389 
390  static int prev_mouse_z = 0;
391  if (prev_mouse_z != mouse_z) {
392  _cursor.wheel = (prev_mouse_z - mouse_z) < 0 ? -1 : 1;
393  prev_mouse_z = mouse_z;
394  mouse_action = true;
395  }
396 
397  if (mouse_action) HandleMouseEvents();
398 
399  poll_keyboard();
400  if ((key_shifts & KB_ALT_FLAG) && (key[KEY_ENTER] || key[KEY_F])) {
401  ToggleFullScreen(!_fullscreen);
402  } else if (keypressed()) {
403  WChar character;
404  uint keycode = ConvertAllegroKeyIntoMy(&character);
405  HandleKeypress(keycode, character);
406  }
407 }
408 
413 int _allegro_instance_count = 0;
414 
415 const char *VideoDriver_Allegro::Start(const char * const *parm)
416 {
417  if (_allegro_instance_count == 0 && install_allegro(SYSTEM_AUTODETECT, &errno, nullptr)) {
418  DEBUG(driver, 0, "allegro: install_allegro failed '%s'", allegro_error);
419  return "Failed to set up Allegro";
420  }
421  _allegro_instance_count++;
422 
423  install_timer();
424  install_mouse();
425  install_keyboard();
426 
427 #if defined _DEBUG
428 /* Allegro replaces SEGV/ABRT signals meaning that the debugger will never
429  * be triggered, so rereplace the signals and make the debugger useful. */
430  signal(SIGABRT, nullptr);
431  signal(SIGSEGV, nullptr);
432 #endif
433 
434  GetVideoModes();
435  if (!CreateMainSurface(_cur_resolution.width, _cur_resolution.height)) {
436  return "Failed to set up Allegro video";
437  }
439  set_close_button_callback(HandleExitGameRequest);
440 
441  return nullptr;
442 }
443 
445 {
446  if (--_allegro_instance_count == 0) allegro_exit();
447 }
448 
449 #if defined(UNIX) || defined(__OS2__)
450 # include <sys/time.h> /* gettimeofday */
451 
452 static uint32 GetTime()
453 {
454  struct timeval tim;
455 
456  gettimeofday(&tim, nullptr);
457  return tim.tv_usec / 1000 + tim.tv_sec * 1000;
458 }
459 #else
460 static uint32 GetTime()
461 {
462  return GetTickCount();
463 }
464 #endif
465 
466 
468 {
469  uint32 cur_ticks = GetTime();
470  uint32 last_cur_ticks = cur_ticks;
471  uint32 next_tick = cur_ticks + MILLISECONDS_PER_TICK;
472 
473  CheckPaletteAnim();
474 
475  for (;;) {
476  uint32 prev_cur_ticks = cur_ticks; // to check for wrapping
477  InteractiveRandom(); // randomness
478 
479  PollEvent();
480  if (_exit_game) return;
481 
482 #if defined(_DEBUG)
483  if (_shift_pressed)
484 #else
485  /* Speedup when pressing tab, except when using ALT+TAB
486  * to switch to another application */
487  if (key[KEY_TAB] && (key_shifts & KB_ALT_FLAG) == 0)
488 #endif
489  {
490  if (!_networking && _game_mode != GM_MENU) _fast_forward |= 2;
491  } else if (_fast_forward & 2) {
492  _fast_forward = 0;
493  }
494 
495  cur_ticks = GetTime();
496  if (cur_ticks >= next_tick || (_fast_forward && !_pause_mode) || cur_ticks < prev_cur_ticks) {
497  _realtime_tick += cur_ticks - last_cur_ticks;
498  last_cur_ticks = cur_ticks;
499  next_tick = cur_ticks + MILLISECONDS_PER_TICK;
500 
501  bool old_ctrl_pressed = _ctrl_pressed;
502 
503  _ctrl_pressed = !!(key_shifts & KB_CTRL_FLAG);
504  _shift_pressed = !!(key_shifts & KB_SHIFT_FLAG);
505 
506  /* determine which directional keys are down */
507  _dirkeys =
508  (key[KEY_LEFT] ? 1 : 0) |
509  (key[KEY_UP] ? 2 : 0) |
510  (key[KEY_RIGHT] ? 4 : 0) |
511  (key[KEY_DOWN] ? 8 : 0);
512 
513  if (old_ctrl_pressed != _ctrl_pressed) HandleCtrlChanged();
514 
515  GameLoop();
516 
517  UpdateWindows();
518  CheckPaletteAnim();
519  DrawSurfaceToScreen();
520  } else {
521  CSleep(1);
523  DrawMouseCursor();
524  DrawSurfaceToScreen();
525  }
526  }
527 }
528 
529 bool VideoDriver_Allegro::ChangeResolution(int w, int h)
530 {
531  return CreateMainSurface(w, h);
532 }
533 
534 bool VideoDriver_Allegro::ToggleFullscreen(bool fullscreen)
535 {
536  _fullscreen = fullscreen;
537  GetVideoModes(); // get the list of available video modes
538  if (_resolutions.empty() || !this->ChangeResolution(_cur_resolution.width, _cur_resolution.height)) {
539  /* switching resolution failed, put back full_screen to original status */
540  _fullscreen ^= true;
541  return false;
542  }
543  return true;
544 }
545 
547 {
548  return CreateMainSurface(_screen.width, _screen.height);
549 }
550 
551 #endif /* WITH_ALLEGRO */
bool _networking
are we in networking mode?
Definition: network.cpp:54
uint32 _realtime_tick
The real time in the game.
Definition: debug.cpp:50
Point pos
logical mouse position
Definition: gfx_type.h:119
Factory for the allegro video driver.
Definition: allegro_v.h:40
, Comma
Definition: gfx_type.h:104
int CDECL seprintf(char *str, const char *last, const char *format,...)
Safer implementation of snprintf; same as snprintf except:
Definition: string.cpp:409
bool _right_button_down
Is right mouse button pressed?
Definition: gfx.cpp:42
Colour palette[256]
Current palette. Entry 0 has to be always fully transparent!
Definition: gfx_type.h:310
= Equals
Definition: gfx_type.h:99
void CSleep(int milliseconds)
Sleep on the current thread for a defined time.
Definition: thread.h:27
Dimension _cur_resolution
The current resolution.
Definition: driver.cpp:23
#define lastof(x)
Get the last element of an fixed size array.
Definition: depend.cpp:50
No palette animation.
Definition: base.hpp:52
How all blitters should look like.
Definition: base.hpp:30
RAII class for measuring simple elements of performance.
void MainLoop() override
Perform the actual drawing.
virtual void PostResize()
Post resize event.
Definition: base.hpp:203
Palette animation should be done by video backend (8bpp only!)
Definition: base.hpp:53
bool _left_button_clicked
Is left mouse button clicked?
Definition: gfx.cpp:41
Base of the Allegro video driver.
std::vector< Dimension > _resolutions
List of resolutions.
Definition: driver.cpp:22
bool _ctrl_pressed
Is Ctrl pressed?
Definition: gfx.cpp:37
bool ChangeResolution(int w, int h) override
Change the resolution of the window.
&#39; Single quote
Definition: gfx_type.h:103
bool _right_button_clicked
Is right mouse button clicked?
Definition: gfx.cpp:43
void MakeDirty(int left, int top, int width, int height) override
Mark a particular area dirty.
The blitter takes care of the palette animation.
Definition: base.hpp:54
virtual void PaletteAnimate(const Palette &palette)=0
Called when the 8bpp palette is changed; you should redraw all pixels on the screen that are equal to...
bool _left_button_down
Is left mouse button pressed?
Definition: gfx.cpp:40
[ Left square bracket
Definition: gfx_type.h:100
] Right square bracket
Definition: gfx_type.h:102
\ Backslash
Definition: gfx_type.h:101
void CDECL usererror(const char *s,...)
Error handling for fatal user errors.
Definition: openttd.cpp:94
int wheel
mouse wheel movement
Definition: gfx_type.h:121
bool UpdateCursorPosition(int x, int y, bool queued_warp)
Update cursor position on mouse movement.
Definition: gfx.cpp:1644
/ Forward slash
Definition: gfx_type.h:97
static const uint MILLISECONDS_PER_TICK
The number of milliseconds per game tick.
Definition: gfx_type.h:306
void HandleKeypress(uint keycode, WChar key)
Handle keyboard input.
Definition: window.cpp:2654
bool ToggleFullscreen(bool fullscreen) override
Change the full screen setting.
byte _dirkeys
1 = left, 2 = up, 4 = right, 8 = down
Definition: gfx.cpp:33
void HandleMouseEvents()
Handle a mouse event from the video driver.
Definition: window.cpp:2961
static Blitter * GetCurrentBlitter()
Get the current active blitter (always set by calling SelectBlitter).
Definition: factory.hpp:147
int first_dirty
The first dirty element.
Definition: gfx_type.h:311
PauseMode _pause_mode
The current pause mode.
Definition: gfx.cpp:49
; Semicolon
Definition: gfx_type.h:98
Palette _cur_palette
Current palette.
Definition: gfx.cpp:50
bool AfterBlitterChange() override
Callback invoked after the blitter was changed.
bool _shift_pressed
Is Shift pressed?
Definition: gfx.cpp:38
void Stop() override
Stop this driver.
#define DEBUG(name, level,...)
Output a line of debugging information.
Definition: debug.h:37
uint8 FindFirstBit(uint32 x)
Search the first set bit in a 32 bit variable.
virtual Blitter::PaletteAnimation UsePaletteAnimation()=0
Check if the blitter uses palette animation at all.
void HandleCtrlChanged()
State of CONTROL key has changed.
Definition: window.cpp:2711
static T ClrBit(T &x, const uint8 y)
Clears a bit in a variable.
Specification of a rectangle with an absolute top-left coordinate and a (relative) width/height...
Speed of painting drawn video buffer.
const char * Start(const char *const *param) override
Start this driver.
void NetworkDrawChatMessage()
Draw the chat message-box.
#define endof(x)
Get the end element of an fixed size array.
Definition: stdafx.h:386
virtual uint8 GetScreenDepth()=0
Get the screen depth this blitter works for.
#define AS(ap_name, size_x, size_y, min_year, max_year, catchment, noise, maint_cost, ttdpatch_type, class_id, name, preview)
AirportSpec definition for airports with at least one depot.
bool _rightclick_emulate
Whether right clicking is emulated.
Definition: driver.cpp:24
void GameSizeChanged()
Size of the application screen changed.
Definition: main_gui.cpp:596
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
. Period
Definition: gfx_type.h:105
Point delta
relative mouse movement in this tick
Definition: gfx_type.h:120
int count_dirty
The number of dirty elements.
Definition: gfx_type.h:312
static T Delta(const T a, const T b)
Returns the (absolute) difference between two (scalar) variables.
Definition: math_func.hpp:232
uint32 WChar
Type for wide characters, i.e.
Definition: string_type.h:37
Dimensions (a width and height) of a rectangle in 2D.
void MarkWholeScreenDirty()
This function mark the whole screen as dirty.
Definition: gfx.cpp:1459
void UpdateWindows()
Update the continuously changing contents of the windows, such as the viewports.
Definition: window.cpp:3112