ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

SdlGraphicsManager Class Reference

Base class for a SDL based graphics manager. More...

#include <sdl-graphics.h>

Inheritance diagram for SdlGraphicsManager:
Collaboration diagram for SdlGraphicsManager:

List of all members.

Classes

struct  State
 A (subset) of the graphic manager's state. More...

Public Member Functions

 SdlGraphicsManager (SdlEventSource *source, SdlWindow *window)
virtual ~SdlGraphicsManager ()
virtual void activateManager ()
 Makes this graphics manager active.
virtual void deactivateManager ()
 Makes this graphics manager inactive.
virtual void notifyVideoExpose ()=0
 Notify the graphics manager that the graphics needs to be redrawn, since the application window was modified.
virtual void notifyResize (const int width, const int height)
 Notify the graphics manager about a resize event.
virtual void transformMouseCoordinates (Common::Point &point)=0
 Transforms real screen coordinates into the current active screen coordinates (may be either game screen or overlay).
virtual bool notifyMousePosition (Common::Point &mouse)=0
 Notifies the graphics manager about a mouse position change.
virtual bool saveScreenshot (const Common::String &filename) const
virtual void saveScreenshot ()
State getState () const
 Gets the current state of the graphics manager.
bool setState (const State &state)
 Sets up a basic state of the graphics manager.
SdlWindowgetWindow () const
Common::KeymapgetKeymap ()

Protected Types

enum  CustomEventAction { kActionToggleFullscreen = 100, kActionToggleMouseCapture, kActionSaveScreenshot, kActionToggleAspectRatioCorrection }

Protected Attributes

SDL_Surface * _hwScreen
SdlEventSource_eventSource
SdlWindow_window

Detailed Description

Base class for a SDL based graphics manager.

Definition at line 42 of file sdl-graphics.h.


Member Enumeration Documentation

Enumerator:
kActionToggleFullscreen 
kActionToggleMouseCapture 
kActionSaveScreenshot 
kActionToggleAspectRatioCorrection 

Definition at line 155 of file sdl-graphics.h.


Constructor & Destructor Documentation

SdlGraphicsManager::SdlGraphicsManager ( SdlEventSource source,
SdlWindow window 
)

Definition at line 40 of file sdl-graphics.cpp.

virtual SdlGraphicsManager::~SdlGraphicsManager (  )  [inline, virtual]

Definition at line 45 of file sdl-graphics.h.


Member Function Documentation

void SdlGraphicsManager::activateManager (  )  [virtual]

Makes this graphics manager active.

That means it should be ready to process inputs now. However, even without being active it should be able to query the supported modes and other bits.

Reimplemented in ResVmSdlGraphicsManager.

Definition at line 52 of file sdl-graphics.cpp.

void SdlGraphicsManager::deactivateManager (  )  [virtual]

Makes this graphics manager inactive.

This should allow another graphics manager to become active again.

Reimplemented in ResVmSdlGraphicsManager.

Definition at line 59 of file sdl-graphics.cpp.

Common::Keymap * SdlGraphicsManager::getKeymap (  ) 

Definition at line 368 of file sdl-graphics.cpp.

SdlGraphicsManager::State SdlGraphicsManager::getState (  )  const

Gets the current state of the graphics manager.

Definition at line 68 of file sdl-graphics.cpp.

SdlWindow* SdlGraphicsManager::getWindow (  )  const [inline]
Returns:
the SDL window.

Definition at line 147 of file sdl-graphics.h.

virtual bool SdlGraphicsManager::notifyMousePosition ( Common::Point mouse  )  [pure virtual]

Notifies the graphics manager about a mouse position change.

The passed point *must* be converted from window coordinates to virtual coordinates in order for the event to be processed correctly by the game engine. Just use `convertWindowToVirtual` for this unless you need to do something special.

Parameters:
mouse The mouse position in window coordinates, which must be converted synchronously to virtual coordinates.
Returns:
true if the mouse was in a valid position for the game and should cause the event to be sent to the game.

Implemented in ResVmSdlGraphicsManager.

virtual void SdlGraphicsManager::notifyResize ( const int  width,
const int  height 
) [inline, virtual]

Notify the graphics manager about a resize event.

It is noteworthy that the requested width/height should actually be set up as is and not changed by the graphics manager, since otherwise it may lead to odd behavior for certain window managers.

It is only required to overwrite this method in case you want a resizable window. The default implementation just does nothing.

Parameters:
width Requested window width.
height Requested window height.

Reimplemented in OpenGLSdlGraphicsManager.

Definition at line 81 of file sdl-graphics.h.

virtual void SdlGraphicsManager::notifyVideoExpose (  )  [pure virtual]

Notify the graphics manager that the graphics needs to be redrawn, since the application window was modified.

This is basically called when SDL_VIDEOEXPOSE was received.

Implemented in ResVmSdlGraphicsManager.

virtual bool SdlGraphicsManager::saveScreenshot ( const Common::String filename  )  const [inline, virtual]
virtual void SdlGraphicsManager::saveScreenshot (  )  [inline, virtual]

Reimplemented in ResVmSdlGraphicsManager.

Definition at line 112 of file sdl-graphics.h.

bool SdlGraphicsManager::setState ( const State state  ) 

Sets up a basic state of the graphics manager.

Definition at line 82 of file sdl-graphics.cpp.

virtual void SdlGraphicsManager::transformMouseCoordinates ( Common::Point point  )  [pure virtual]

Transforms real screen coordinates into the current active screen coordinates (may be either game screen or overlay).

Parameters:
point Mouse coordinates to transform. !! ResidualVM specific:

Implemented in OpenGLSdlGraphicsManager, and SurfaceSdlGraphicsManager.


Member Data Documentation

Definition at line 229 of file sdl-graphics.h.

SDL_Surface* SdlGraphicsManager::_hwScreen [protected]

Definition at line 228 of file sdl-graphics.h.

Definition at line 230 of file sdl-graphics.h.


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


Generated on Sat Jun 27 2020 05:02:01 for ResidualVM by doxygen 1.7.1
curved edge   curved edge