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

ResVmSdlGraphicsManager Class Reference

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

#include <resvm-sdl-graphics.h>

Inheritance diagram for ResVmSdlGraphicsManager:
Collaboration diagram for ResVmSdlGraphicsManager:

List of all members.

Public Member Functions

 ResVmSdlGraphicsManager (SdlEventSource *source, SdlWindow *window)
 ~ResVmSdlGraphicsManager () override
void activateManager () override
 Makes this graphics manager active.
void deactivateManager () override
 Makes this graphics manager inactive.
void notifyVideoExpose () override
 Notify the graphics manager that the graphics needs to be redrawn, since the application window was modified.
bool notifyMousePosition (Common::Point &mouse) override
 Notifies the graphics manager about a mouse position change.
void saveScreenshot () override
bool showMouse (bool visible) override
bool lockMouse (bool lock) override
bool notifyEvent (const Common::Event &event) override
 Notifies the observer of an incoming event.
bool isMouseLocked () const
 Checks if mouse is locked or not.

Protected Member Functions

Common::Rect getPreferredFullscreenResolution ()
 Obtain the user configured fullscreen resolution, or default to the desktop resolution.
virtual int getGraphicsModeScale (int mode) const =0
virtual bool saveScreenshot (const Common::String &file) const =0
 Save a screenshot to the specified file.

Detailed Description

Base class for a ResidualVM SDL based graphics manager.

Used to share reusable methods between SDL graphics managers

Definition at line 40 of file resvm-sdl-graphics.h.


Constructor & Destructor Documentation

ResVmSdlGraphicsManager::ResVmSdlGraphicsManager ( SdlEventSource source,
SdlWindow window 
)

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

ResVmSdlGraphicsManager::~ResVmSdlGraphicsManager (  )  [override]

Definition at line 38 of file resvm-sdl-graphics.cpp.


Member Function Documentation

void ResVmSdlGraphicsManager::activateManager (  )  [override, 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 from SdlGraphicsManager.

Definition at line 41 of file resvm-sdl-graphics.cpp.

void ResVmSdlGraphicsManager::deactivateManager (  )  [override, virtual]

Makes this graphics manager inactive.

This should allow another graphics manager to become active again.

Reimplemented from SdlGraphicsManager.

Definition at line 48 of file resvm-sdl-graphics.cpp.

int ResVmSdlGraphicsManager::getGraphicsModeScale ( int  mode  )  const [protected, pure virtual]

Implemented in OpenGLSdlGraphicsManager, and SurfaceSdlGraphicsManager.

Definition at line 169 of file resvm-sdl-graphics.cpp.

Common::Rect ResVmSdlGraphicsManager::getPreferredFullscreenResolution (  )  [protected]

Obtain the user configured fullscreen resolution, or default to the desktop resolution.

Definition at line 57 of file resvm-sdl-graphics.cpp.

bool ResVmSdlGraphicsManager::isMouseLocked (  )  const

Checks if mouse is locked or not.

Avoid to emulate a mouse movement from joystick if locked.

Definition at line 98 of file resvm-sdl-graphics.cpp.

bool ResVmSdlGraphicsManager::lockMouse ( bool  lock  )  [override]

Definition at line 83 of file resvm-sdl-graphics.cpp.

bool ResVmSdlGraphicsManager::notifyEvent ( const Common::Event event  )  [override, virtual]

Notifies the observer of an incoming event.

An observer is supposed to eat the event, with returning true, when it wants to prevent other observers from receiving the event. A usage example here is the keymapper: If it processes an Event, it should 'eat' it and create a new event, which the EventDispatcher will then catch.

Parameters:
event the event, which is incoming.
Returns:
true if the event should not be passed to other observers, false otherwise.

Implements Common::EventObserver.

Definition at line 106 of file resvm-sdl-graphics.cpp.

bool ResVmSdlGraphicsManager::notifyMousePosition ( Common::Point mouse  )  [override, 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.

Implements SdlGraphicsManager.

Definition at line 123 of file resvm-sdl-graphics.cpp.

void ResVmSdlGraphicsManager::notifyVideoExpose (  )  [inline, override, 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.

Implements SdlGraphicsManager.

Definition at line 48 of file resvm-sdl-graphics.h.

virtual bool ResVmSdlGraphicsManager::saveScreenshot ( const Common::String file  )  const [protected, pure virtual]

Save a screenshot to the specified file.

Reimplemented from SdlGraphicsManager.

Implemented in OpenGLSdlGraphicsManager, and SurfaceSdlGraphicsManager.

void ResVmSdlGraphicsManager::saveScreenshot (  )  [override, virtual]

Reimplemented from SdlGraphicsManager.

Definition at line 129 of file resvm-sdl-graphics.cpp.

bool ResVmSdlGraphicsManager::showMouse ( bool  visible  )  [override]

Definition at line 78 of file resvm-sdl-graphics.cpp.


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


Generated on Sat Sep 19 2020 05:04:10 for ResidualVM by doxygen 1.7.1
curved edge   curved edge