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 uint width, const uint 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.
State getState () const
 Queries the current state of the graphic manager.
bool setState (const State &state)
 Setup a basic state of the graphic manager.
SdlWindowgetWindow () const
 Queries the SDL window.

Protected Attributes

SdlEventSource_eventSource
SdlWindow_window

Detailed Description

Base class for a SDL based graphics manager.

It features a few extra a few extra features required by SdlEventSource.

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


Constructor & Destructor Documentation

SdlGraphicsManager::SdlGraphicsManager ( SdlEventSource source,
SdlWindow window 
)

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

SdlGraphicsManager::~SdlGraphicsManager (  )  [virtual]

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


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.

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

void SdlGraphicsManager::deactivateManager (  )  [virtual]

Makes this graphics manager inactive.

This should allow another graphics manager to become active again.

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

SdlGraphicsManager::State SdlGraphicsManager::getState (  )  const

Queries the current state of the graphic manager.

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

SdlWindow* SdlGraphicsManager::getWindow (  )  const [inline]

Queries the SDL window.

Definition at line 130 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.
virtual void SdlGraphicsManager::notifyResize ( const uint  width,
const uint  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.

Definition at line 77 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.

bool SdlGraphicsManager::setState ( const State state  ) 

Setup a basic state of the graphic manager.

Definition at line 58 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.

Member Data Documentation

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

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


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


Generated on Sat Jan 12 2019 05:03:25 for ResidualVM by doxygen 1.7.1
curved edge   curved edge