Public Member Functions | |
OpenGLSdlGraphicsManager (SdlEventSource *eventSource, SdlWindow *window) | |
bool | hasFeature (OSystem::Feature f) const override |
void | setFeatureState (OSystem::Feature f, bool enable) override |
bool | getFeatureState (OSystem::Feature f) const override |
void | initSize (uint w, uint h, const Graphics::PixelFormat *format) override |
void | updateScreen () override |
float | getHiDPIScreenFactor () const override |
bool | notifyEvent (const Common::Event &event) override |
void | notifyVideoExpose () override |
void | notifyResize (const int width, const int height) override |
Public Member Functions inherited from OpenGL::OpenGLGraphicsManager | |
const OSystem::GraphicsMode * | getSupportedGraphicsModes () const override |
int | getDefaultGraphicsMode () const override |
bool | setGraphicsMode (int mode, uint flags=OSystem::kGfxModeNoFlags) override |
int | getGraphicsMode () const override |
const OSystem::GraphicsMode * | getSupportedStretchModes () const override |
int | getDefaultStretchMode () const override |
bool | setStretchMode (int mode) override |
int | getStretchMode () const override |
bool | setShader (const Common::Path &fileNode) override |
void | beginGFXTransaction () override |
OSystem::TransactionError | endGFXTransaction () override |
int | getScreenChangeID () const override |
int16 | getWidth () const override |
int16 | getHeight () const override |
void | copyRectToScreen (const void *buf, int pitch, int x, int y, int w, int h) override |
void | fillScreen (uint32 col) override |
void | fillScreen (const Common::Rect &r, uint32 col) override |
Graphics::Surface * | lockScreen () override |
void | unlockScreen () override |
void | setFocusRectangle (const Common::Rect &rect) override |
void | clearFocusRectangle () override |
int16 | getOverlayWidth () const override |
int16 | getOverlayHeight () const override |
Graphics::PixelFormat | getOverlayFormat () const override |
void | copyRectToOverlay (const void *buf, int pitch, int x, int y, int w, int h) override |
void | clearOverlay () override |
void | grabOverlay (Graphics::Surface &surface) const override |
void | setMouseCursor (const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format, const byte *mask) override |
void | setCursorPalette (const byte *colors, uint start, uint num) override |
void | displayMessageOnOSD (const Common::U32String &msg) override |
void | displayActivityIconOnOSD (const Graphics::Surface *icon) override |
void | setPalette (const byte *colors, uint start, uint num) override |
void | grabPalette (byte *colors, uint start, uint num) const override |
Public Member Functions inherited from WindowedGraphicsManager | |
void | showOverlay (bool inGUI) override |
void | hideOverlay () override |
bool | isOverlayVisible () const override |
void | setShakePos (int shakeXOffset, int shakeYOffset) override |
int | getWindowWidth () const |
int | getWindowHeight () const |
Public Member Functions inherited from GraphicsManager | |
virtual uint | getDefaultScaler () const |
virtual uint | getDefaultScaleFactor () const |
virtual bool | setScaler (uint mode, int factor) |
virtual uint | getScaler () const |
virtual uint | getScaleFactor () const |
Public Member Functions inherited from PaletteManager | |
void | setPalette (const Graphics::Palette &pal, uint start=0) |
Graphics::Palette | grabPalette (uint start, uint num) |
Public Member Functions inherited from SdlGraphicsManager | |
SdlGraphicsManager (SdlEventSource *source, SdlWindow *window) | |
virtual void | activateManager () |
virtual void | deactivateManager () |
virtual bool | notifyMousePosition (Common::Point &mouse) |
Common::RotationMode | getRotationMode () const override |
virtual bool | showMouse (bool visible) override |
bool | lockMouse (bool lock) override |
void | saveScreenshot () override |
bool | notifyEvent (const Common::Event &event) override |
State | getState () const |
bool | setState (const State &state) |
SdlWindow * | getWindow () const |
void | initSizeHint (const Graphics::ModeList &modes) override |
Common::Keymap * | getKeymap () |
Public Member Functions inherited from Common::EventObserver | |
virtual void | notifyPoll () |
Protected Member Functions | |
bool | loadVideoMode (uint requestedWidth, uint requestedHeight, const Graphics::PixelFormat &format) override |
void | refreshScreen () override |
void | handleResizeImpl (const int width, const int height) override |
bool | saveScreenshot (const Common::Path &filename) const override |
Protected Member Functions inherited from OpenGL::OpenGLGraphicsManager | |
void | renderCursor () |
bool | isGLESContext () const |
void | notifyContextCreate (ContextType type, Framebuffer *target, const Graphics::PixelFormat &defaultFormat, const Graphics::PixelFormat &defaultFormatAlpha) |
void | notifyContextDestroy () |
Surface * | createSurface (const Graphics::PixelFormat &format, bool wantAlpha=false, bool wantScaler=false, bool wantMask=false) |
TransactionMode | getTransactionMode () const |
bool | loadShader (const Common::Path &fileName) |
bool | saveScreenshot (const Common::Path &filename) const |
bool | getGLPixelFormat (const Graphics::PixelFormat &pixelFormat, GLenum &glIntFormat, GLenum &glFormat, GLenum &glType) const |
bool | gameNeedsAspectRatioCorrection () const override |
int | getGameRenderScale () const override |
void | recalculateDisplayAreas () override |
void | updateLinearFiltering () |
Pipeline * | getPipeline () const |
void | updateCursorPalette () |
void | recalculateCursorScaling () |
virtual const Graphics::Font * | getFontOSD () const |
Protected Member Functions inherited from WindowedGraphicsManager | |
Common::Point | convertVirtualToWindow (const int x, const int y) const |
Common::Point | convertWindowToVirtual (int x, int y) const |
frac_t | getDesiredGameAspectRatio () const |
void | handleResize (const int width, const int height) |
bool | showMouse (bool visible) override |
void | warpMouse (int x, int y) override |
void | setMousePosition (int x, int y) |
Protected Member Functions inherited from SdlGraphicsManager | |
Common::Rect | getPreferredFullscreenResolution () |
bool | defaultGraphicsModeConfig () const |
void | getWindowSizeFromSdl (int *width, int *height) const |
virtual void | showSystemMouseCursor (bool visible) |
void | setSystemMousePosition (const int x, const int y) override |
void | notifyActiveAreaChanged () override |
void | handleResizeImpl (const int width, const int height) override |
Additional Inherited Members | |
Protected Types inherited from OpenGL::OpenGLGraphicsManager | |
enum | TransactionMode { kTransactionNone = 0, kTransactionActive = 1, kTransactionRollback = 2 } |
Protected Types inherited from SdlGraphicsManager | |
enum | CustomEventAction { kActionToggleFullscreen = 100, kActionToggleMouseCapture, kActionSaveScreenshot, kActionToggleAspectRatioCorrection, kActionToggleFilteredScaling, kActionCycleStretchMode, kActionIncreaseScaleFactor, kActionDecreaseScaleFactor, kActionNextScaleFilter, kActionPreviousScaleFilter } |
Protected Attributes inherited from OpenGL::OpenGLGraphicsManager | |
VideoState | _currentState |
VideoState | _oldState |
Graphics::PixelFormat | _defaultFormat |
Graphics::PixelFormat | _defaultFormatAlpha |
Framebuffer * | _targetBuffer |
Surface * | _gameScreen |
byte | _gamePalette [3 *256] |
Surface * | _overlay |
Surface * | _cursor |
Surface * | _cursorMask |
int | _cursorHotspotX |
int | _cursorHotspotY |
int | _cursorHotspotXScaled |
int | _cursorHotspotYScaled |
float | _cursorWidthScaled |
float | _cursorHeightScaled |
uint32 | _cursorKeyColor |
bool | _cursorUseKey |
bool | _cursorDontScale |
bool | _cursorPaletteEnabled |
byte | _cursorPalette [3 *256] |
Protected Attributes inherited from WindowedGraphicsManager | |
int | _windowWidth |
int | _windowHeight |
int | _screenAlign |
bool | _overlayVisible |
bool | _overlayInGUI |
int | _gameScreenShakeXOffset |
int | _gameScreenShakeYOffset |
Common::Rect | _gameDrawRect |
Common::Rect | _overlayDrawRect |
DisplayArea | _activeArea |
bool | _forceRedraw |
bool | _cursorVisible |
bool | _cursorNeedsRedraw |
bool | _cursorLastInActiveArea |
int | _cursorX |
int | _cursorY |
Protected Attributes inherited from SdlGraphicsManager | |
SDL_Surface * | _hwScreen |
SdlEventSource * | _eventSource |
SdlWindow * | _window |
|
overridevirtual |
Notify 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.
event | The event that is incoming. |
true | If the event should not be passed to other observers, false otherwise. |
Implements Common::EventObserver.
|
overridevirtual |
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.
|
overridevirtual |
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.
width | Requested window width. |
height | Requested window height. |
Reimplemented from SdlGraphicsManager.
|
overrideprotectedvirtual |
Set up the requested video mode. This takes parameters which describe what resolution the game screen requests (this is possibly aspect ratio corrected!).
A sub-class should take these parameters as hints. It might very well set up a mode which it thinks suites the situation best.
requestedWidth This is the requested actual game screen width.
requestedHeight | This is the requested actual game screen height. |
format | This is the requested pixel format of the virtual game screen. |
Implements OpenGL::OpenGLGraphicsManager.
|
overrideprotectedvirtual |
Refresh the screen contents.
Implements OpenGL::OpenGLGraphicsManager.
|
overrideprotectedvirtual |
Backend-specific implementation for updating internal surfaces that need to reflect the new window size.
Reimplemented from OpenGL::OpenGLGraphicsManager.