Public Member Functions

# VideoDriver Class Reference

The base of all video drivers. More...

`#include <video_driver.hpp>`

Inheritance diagram for VideoDriver:

## Public Member Functions
virtual void | MakeDirty (int left, int top, int width, int height)=0
| Mark a particular area dirty.
virtual void | MainLoop ()=0
| Perform the actual drawing.
virtual bool | ChangeResolution (int w, int h)=0
| Change the resolution of the window.
virtual bool | ToggleFullscreen (bool fullscreen)=0
| Change the full screen setting.
virtual bool | AfterBlitterChange ()
| Callback invoked after the blitter was changed.
virtual bool | ClaimMousePointer ()
virtual bool | HasGUI () const
| Whether the driver has a graphical user interface with the end user.

## Detailed Description

The base of all video drivers.

Definition at line 19 of file video_driver.hpp.

## Member Function Documentation

virtual bool VideoDriver::AfterBlitterChange | ( |  | ) | `[inline, virtual]`

Callback invoked after the blitter was changed.

Returns:
  True if no error.

Reimplemented in VideoDriver_Allegro, VideoDriver_Cocoa, VideoDriver_SDL, and VideoDriver_Win32.

Definition at line 54 of file video_driver.hpp.

Referenced by SwitchNewGRFBlitter().

virtual bool VideoDriver::ChangeResolution | ( | int | w,
|  | int | h |
| ) |  |  | `[pure virtual]`

Change the resolution of the window.

Parameters:

  | w | The new width.
  | h | The new height.

Returns:
  True if the change succeeded.

Implemented in VideoDriver_Allegro, VideoDriver_Cocoa, VideoDriver_Dedicated, VideoDriver_Null, VideoDriver_SDL, and VideoDriver_Win32.

virtual bool VideoDriver::HasGUI | ( |  | ) | const`[inline, virtual]`

Whether the driver has a graphical user interface with the end user.

Or in other words, whether we should spawn a thread for world generation and NewGRF scanning so the graphical updates can keep coming. Otherwise progress has to be shown on the console, which uses by definition another thread/process for display purposes.

Returns:
  True for all drivers except null and dedicated.

Reimplemented in VideoDriver_Dedicated, and VideoDriver_Null.

Definition at line 72 of file video_driver.hpp.

Referenced by GenerateWorld(), and ScanNewGRFFiles().

virtual void VideoDriver::MakeDirty | ( | int | left,
|  | int | top,
|  | int | width,
|  | int | height |
| ) |  |  | `[pure virtual]`

Mark a particular area dirty.

Parameters:

  | left | The left most line of the dirty area.
  | top | The top most line of the dirty area.
  | width | The width of the dirty area.
  | height | The height of the dirty area.

Implemented in VideoDriver_Allegro, VideoDriver_Cocoa, VideoDriver_Dedicated, VideoDriver_Null, VideoDriver_SDL, and VideoDriver_Win32.

Referenced by NetworkDrawChatMessage(), NetworkUndrawChatMessage(), and Blitter_32bppAnim::PaletteAnimate().

virtual bool VideoDriver::ToggleFullscreen | ( | bool | fullscreen | ) | `[pure virtual]`

Change the full screen setting.

Parameters:

  | fullscreen | The new setting.

Returns:
  True if the change succeeded.

Implemented in VideoDriver_Allegro, VideoDriver_Cocoa, VideoDriver_Dedicated, VideoDriver_Null, VideoDriver_SDL, and VideoDriver_Win32.

The documentation for this class was generated from the following file:

- src/video/video_driver.hpp