ScummVM API documentation
LibretroGraphics Class Reference
Inheritance diagram for LibretroGraphics:
WindowedGraphicsManager GraphicsManager PaletteManager Common::NonCopyable

Public Member Functions

Common::List< Graphics::PixelFormatgetSupportedFormats () const override
 
const OSystem::GraphicsModegetSupportedGraphicsModes (void) const override
 
void initSize (uint width, uint height, const Graphics::PixelFormat *format) override
 
int16 getHeight (void) const override
 
int16 getWidth (void) const override
 
Graphics::PixelFormat getScreenFormat (void) const override
 
void copyRectToScreen (const void *buf, int pitch, int x, int y, int w, int h) override
 
void updateScreen (void) override
 
void clearOverlay (void) override
 
void grabOverlay (Graphics::Surface &surface) const override
 
void copyRectToOverlay (const void *buf, int pitch, int x, int y, int w, int h) override
 
int16 getOverlayHeight (void) const override
 
int16 getOverlayWidth (void) const override
 
Graphics::PixelFormat getOverlayFormat () const override
 
const Graphics::ManagedSurfacegetScreen (void)
 
void warpMouse (int x, int y) override
 
void setMouseCursor (const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor=255, bool dontScale=false, const Graphics::PixelFormat *format=NULL, const byte *mask=nullptr) override
 
void setCursorPalette (const byte *colors, uint start, uint num) override
 
bool isOverlayInGUI (void)
 
bool hasFeature (OSystem::Feature f) const override
 
void setFeatureState (OSystem::Feature f, bool enable) override
 
bool getFeatureState (OSystem::Feature f) const override
 
int getDefaultGraphicsMode () const override
 
bool setGraphicsMode (int mode, uint flags=OSystem::kGfxModeNoFlags) override
 
int getGraphicsMode () const override
 
Graphics::SurfacelockScreen () override
 
void unlockScreen () override
 
int getScreenChangeID () const override
 
void beginGFXTransaction () override
 
OSystem::TransactionError endGFXTransaction () override
 
void fillScreen (uint32 col) override
 
void fillScreen (const Common::Rect &r, uint32 col) override
 
void setFocusRectangle (const Common::Rect &rect) override
 
void clearFocusRectangle () override
 
void realUpdateScreen (void)
 
bool gameNeedsAspectRatioCorrection () const override
 
void handleResizeImpl (const int width, const int height) override
 
void setSystemMousePosition (const int x, const int y) override
 
void setMousePosition (int x, int y)
 
void displayMessageOnOSD (const Common::U32String &msg) 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 bool setShader (const Common::Path &fileName)
 
virtual const OSystem::GraphicsModegetSupportedStretchModes () const
 
virtual int getDefaultStretchMode () const
 
virtual bool setStretchMode (int mode)
 
virtual int getStretchMode () const
 
virtual Common::RotationMode getRotationMode () const
 
virtual uint getDefaultScaler () const
 
virtual uint getDefaultScaleFactor () const
 
virtual bool setScaler (uint mode, int factor)
 
virtual uint getScaler () const
 
virtual uint getScaleFactor () const
 
virtual void initSizeHint (const Graphics::ModeList &modes)
 
virtual float getHiDPIScreenFactor () const
 
virtual void displayActivityIconOnOSD (const Graphics::Surface *icon)
 
virtual void saveScreenshot ()
 
virtual bool lockMouse (bool lock)
 
- Public Member Functions inherited from PaletteManager
void setPalette (const Graphics::Palette &pal, uint start=0)
 
Graphics::Palette grabPalette (uint start, uint num)
 

Public Attributes

Graphics::ManagedSurface _screen
 
Graphics::Surface _gameScreen
 
Graphics::Surface _overlay
 
Graphics::Surface _cursor
 
Graphics::Palette _cursorPalette
 
Graphics::Palette _gamePalette
 

Protected Member Functions

void setPalette (const byte *colors, uint start, uint num) override
 
void grabPalette (byte *colors, uint start, uint num) const override
 
- 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
 
virtual int getGameRenderScale () const
 
void handleResize (const int width, const int height)
 
virtual void recalculateDisplayAreas ()
 
virtual void notifyActiveAreaChanged ()
 
bool showMouse (bool visible) override
 
void setMousePosition (int x, int y)
 

Additional Inherited Members

- 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
 

Member Function Documentation

◆ warpMouse()

void LibretroGraphics::warpMouse ( int  x,
int  y 
)
overridevirtual

Move ("warp") the mouse cursor to the specified position.

Parameters
xThe new X position of the mouse in virtual screen coordinates.
yThe new Y position of the mouse in virtual screen coordinates.

Reimplemented from WindowedGraphicsManager.

◆ gameNeedsAspectRatioCorrection()

bool LibretroGraphics::gameNeedsAspectRatioCorrection ( ) const
inlineoverridevirtual
Returns
whether or not the game screen must have aspect ratio correction applied for correct rendering.

Implements WindowedGraphicsManager.

◆ handleResizeImpl()

void LibretroGraphics::handleResizeImpl ( const int  width,
const int  height 
)
overridevirtual

Backend-specific implementation for updating internal surfaces that need to reflect the new window size.

Implements WindowedGraphicsManager.

◆ setSystemMousePosition()

void LibretroGraphics::setSystemMousePosition ( const int  x,
const int  y 
)
inlineoverridevirtual

Sets the position of the hardware mouse cursor in the host system, relative to the window.

Parameters
xX coordinate in window coordinates.
yY coordinate in window coordinates.

Implements WindowedGraphicsManager.

◆ setPalette()

void LibretroGraphics::setPalette ( const byte *  colors,
uint  start,
uint  num 
)
overrideprotectedvirtual

Replace the specified range of the palette with new colors. The palette entries from 'start' till (start+num-1) will be replaced - so a full palette update is accomplished via start=0, num=256.

The palette data is specified in interleaved RGB format. That is, the first byte of the memory block 'colors' points at is the red component of the first new color; the second byte the green component of the first new color; the third byte the blue component, the last byte to the alpha (transparency) value. Then the second color starts, and so on. So memory looks like this: R1-G1-B1-R2-G2-B2-R3-...

Parameters
colorsthe new palette data, in interleaved RGB format
startthe first palette entry to be updated
numthe number of palette entries to be updated
Note
It is an error if start+num exceeds 256, behavior is undefined in that case (the backend may ignore it silently or assert).
It is an error if this function gets called when the pixel format in use (the return value of getScreenFormat) has more than one byte per pixel.
See also
getScreenFormat

Implements GraphicsManager.

◆ grabPalette()

void LibretroGraphics::grabPalette ( byte *  colors,
uint  start,
uint  num 
) const
overrideprotectedvirtual

Grabs a specified part of the currently active palette. The format is the same as for setPalette.

This should return exactly the same RGB data as was setup via previous setPalette calls.

For example, for every valid value of start and num of the following code:

byte origPal[num*3]; // Setup origPal's data however you like g_system->setPalette(origPal, start, num); byte obtainedPal[num*3]; g_system->grabPalette(obtainedPal, start, num);

the following should be true:

memcmp(origPal, obtainedPal, num*3) == 0

See also
setPalette
Parameters
colorsthe palette data, in interleaved RGB format
startthe first platte entry to be read
numthe number of palette entries to be read
Note
It is an error if this function gets called when the pixel format in use (the return value of getScreenFormat) has more than one byte per pixel.
See also
getScreenFormat

Implements GraphicsManager.


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