OpenTTD
Public Member Functions | Static Public Member Functions
VideoDriver Class Referenceabstract

The base of all video drivers. More...

#include <video_driver.hpp>

Inheritance diagram for VideoDriver:
Driver VideoDriver_Allegro VideoDriver_Cocoa VideoDriver_Dedicated VideoDriver_Null VideoDriver_SDL VideoDriver_Win32

Public Member Functions

virtual void MakeDirty (int left, int top, int width, int height)=0
 Mark a particular area dirty. More...
 
virtual void MainLoop ()=0
 Perform the actual drawing.
 
virtual bool ChangeResolution (int w, int h)=0
 Change the resolution of the window. More...
 
virtual bool ToggleFullscreen (bool fullscreen)=0
 Change the full screen setting. More...
 
virtual bool AfterBlitterChange ()
 Callback invoked after the blitter was changed. More...
 
virtual void AcquireBlitterLock ()
 Acquire any lock(s) required to be held when changing blitters. More...
 
virtual void ReleaseBlitterLock ()
 Release any lock(s) required to be held when changing blitters. More...
 
virtual bool ClaimMousePointer ()
 
virtual bool HasGUI () const
 Whether the driver has a graphical user interface with the end user. More...
 
virtual void EditBoxLostFocus ()
 An edit box lost the input focus. More...
 
- Public Member Functions inherited from Driver
virtual const char * Start (const char *const *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...
 

Static Public Member Functions

static VideoDriverGetInstance ()
 Get the currently active instance of the video driver.
 

Additional Inherited Members

- Public Types inherited from Driver
enum  Type {
  DT_BEGIN = 0, DT_MUSIC = 0, DT_SOUND, DT_VIDEO,
  DT_END
}
 The type of driver. More...
 

Detailed Description

The base of all video drivers.

Definition at line 19 of file video_driver.hpp.

Member Function Documentation

◆ AcquireBlitterLock()

virtual void VideoDriver::AcquireBlitterLock ( )
inlinevirtual

Acquire any lock(s) required to be held when changing blitters.

These lock(s) may not be acquired recursively.

Reimplemented in VideoDriver_SDL, and VideoDriver_Win32.

Definition at line 64 of file video_driver.hpp.

◆ AfterBlitterChange()

virtual bool VideoDriver::AfterBlitterChange ( )
inlinevirtual

Callback invoked after the blitter was changed.

This may only be called between AcquireBlitterLock and ReleaseBlitterLock.

Returns
True if no error.

Reimplemented in VideoDriver_Cocoa, VideoDriver_Allegro, VideoDriver_SDL, and VideoDriver_Win32.

Definition at line 55 of file video_driver.hpp.

◆ ChangeResolution()

virtual bool VideoDriver::ChangeResolution ( int  w,
int  h 
)
pure virtual

Change the resolution of the window.

Parameters
wThe new width.
hThe new height.
Returns
True if the change succeeded.

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

◆ EditBoxLostFocus()

virtual void VideoDriver::EditBoxLostFocus ( )
inlinevirtual

An edit box lost the input focus.

Abort character compositing if necessary.

Reimplemented in VideoDriver_Cocoa, and VideoDriver_Win32.

Definition at line 93 of file video_driver.hpp.

Referenced by OskWindow::OnFocusLost(), IConsoleWindow::OnFocusLost(), Window::OnFocusLost(), and Window::UnfocusFocusedWidget().

◆ HasGUI()

virtual bool VideoDriver::HasGUI ( ) const
inlinevirtual

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_Null, and VideoDriver_Dedicated.

Definition at line 85 of file video_driver.hpp.

◆ MakeDirty()

virtual void VideoDriver::MakeDirty ( int  left,
int  top,
int  width,
int  height 
)
pure virtual

Mark a particular area dirty.

Parameters
leftThe left most line of the dirty area.
topThe top most line of the dirty area.
widthThe width of the dirty area.
heightThe height of the dirty area.

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

◆ ReleaseBlitterLock()

virtual void VideoDriver::ReleaseBlitterLock ( )
inlinevirtual

Release any lock(s) required to be held when changing blitters.

These lock(s) may not be acquired recursively.

Reimplemented in VideoDriver_SDL, and VideoDriver_Win32.

Definition at line 70 of file video_driver.hpp.

◆ ToggleFullscreen()

virtual bool VideoDriver::ToggleFullscreen ( bool  fullscreen)
pure virtual

Change the full screen setting.

Parameters
fullscreenThe new setting.
Returns
True if the change succeeded.

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


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