OpenTTD Source: Driver Class Reference

OpenTTD Source 12.0-beta1

Public Types | Public Member Functions
Driver Class Referenceabstract

A driver for communicating with the user. More...

`#include <driver.h>`

Inheritance diagram for Driver:

## Public Types
enum | Type { DT_BEGIN = 0, DT_MUSIC = 0, DT_SOUND, DT_VIDEO, DT_END }
| The type of driver. More...

## Public Member Functions
virtual const char * | Start (const StringList &parm)=0
| Start this driver. More...
virtual void | Stop ()=0
| Stop this driver.
virtual const char * | GetName () const =0
| Get the name of this driver. More...

## Detailed Description

A driver for communicating with the user.

Definition at line 23 of file driver.h.

## Member Enumeration Documentation

## ◆ Type

enum Driver::Type

The type of driver.

Enumerator
DT_BEGIN | Helper for iteration.
DT_MUSIC | A music driver, needs to be before sound to properly shut down extmidi forked music players.
DT_SOUND | A sound driver.
DT_VIDEO | A video driver.
DT_END | Helper for iteration.

Definition at line 40 of file driver.h.

## Member Function Documentation

## ◆ GetName()

virtual const char* Driver::GetName | ( |  | ) | const
| pure virtual

Get the name of this driver.

Returns
  The name of the driver.

Implemented in VideoDriver_CocoaQuartz, VideoDriver_Win32GDI, VideoDriver_SDL_Base, VideoDriver_CocoaOpenGL, MusicDriver_ExtMidi, VideoDriver_Allegro, VideoDriver_SDL_OpenGL, VideoDriver_SDL, MusicDriver_BeMidi, VideoDriver_Null, MusicDriver_DMusic, MusicDriver_Allegro, MusicDriver_FluidSynth, MusicDriver_Null, MusicDriver_OS2, MusicDriver_Win32, VideoDriver_Dedicated, MusicDriver_Cocoa, SoundDriver_Null, SoundDriver_SDL, SoundDriver_Win32, SoundDriver_XAudio2, SoundDriver_Cocoa, VideoDriver_SDL_Default, and SoundDriver_Allegro.

## ◆ Start()

virtual const char* Driver::Start | ( | const StringList & | parm | ) |
| pure virtual

Start this driver.

Parameters

  parm | Parameters passed to the driver.

Returns
  nullptr if everything went okay, otherwise an error message.

Implemented in VideoDriver_CocoaQuartz, VideoDriver_Win32GDI, VideoDriver_CocoaOpenGL, MusicDriver_ExtMidi, VideoDriver_SDL_Base, MusicDriver_BeMidi, VideoDriver_Null, MusicDriver_DMusic, MusicDriver_Allegro, MusicDriver_FluidSynth, MusicDriver_Null, MusicDriver_OS2, MusicDriver_Win32, SoundDriver_Null, SoundDriver_SDL, SoundDriver_Win32, SoundDriver_XAudio2, VideoDriver_Allegro, VideoDriver_Dedicated, VideoDriver_SDL, MusicDriver_Cocoa, SoundDriver_Cocoa, VideoDriver_SDL_OpenGL, and SoundDriver_Allegro.

Referenced by DriverFactoryBase::SelectDriverImpl().

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

- src/driver.h