ScummVM API documentation

Description

This is the lower level implementation as provided by the backends. The engines should use the Graphics::CursorManager class instead of using this directly.

Functions

virtual bool OSystem::showMouse (bool visible)=0
 
virtual bool OSystem::lockMouse (bool lock)
 
virtual void OSystem::warpMouse (int x, int y)=0
 
virtual void OSystem::setMouseCursor (const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale=false, const Graphics::PixelFormat *format=nullptr)=0
 
virtual void OSystem::setCursorPalette (const byte *colors, uint start, uint num)
 

Function Documentation

◆ showMouse()

virtual bool OSystem::showMouse ( bool  visible)
pure virtual

Show or hide the mouse cursor.

Currently, the backend is not required to immediately draw the mouse cursor on showMouse(true).

See also
Graphics::CursorManager::showMouse

◆ lockMouse()

virtual bool OSystem::lockMouse ( bool  lock)
inlinevirtual

Lock or unlock the mouse cursor within the window.

◆ warpMouse()

virtual void OSystem::warpMouse ( int  x,
int  y 
)
pure virtual

Move ("warp") the mouse cursor to the specified position in virtual screen coordinates.

Parameters
xNew x position of the mouse.
yNew y position of the mouse.

◆ setMouseCursor()

virtual void OSystem::setMouseCursor ( const void *  buf,
uint  w,
uint  h,
int  hotspotX,
int  hotspotY,
uint32  keycolor,
bool  dontScale = false,
const Graphics::PixelFormat *  format = nullptr 
)
pure virtual

Set the bitmap used for drawing the cursor.

Parameters
bufPixmap data to be used.
wWidth of the mouse cursor.
hHeight of the mouse cursor.
hotspotXHorizontal offset from the left side to the hotspot.
hotspotYVertical offset from the top side to the hotspot.
keycolorTransparency color value. This should not exceed the maximum color value of the specified format. In case it does, the behavior is undefined. The backend might just error out or simply ignore the value. (The SDL backend will just assert to prevent abuse of this).
dontScaleWhether the cursor should never be scaled. An exception is high ppi displays, where the cursor might be too small to notice otherwise, these are allowed to scale the cursor anyway.
formatPointer to the pixel format that the cursor graphic uses (0 means CLUT8).

◆ setCursorPalette()

virtual void OSystem::setCursorPalette ( const byte *  colors,
uint  start,
uint  num 
)
inlinevirtual

Replace the specified range of cursor 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.

Backends which implement this should have the kFeatureCursorPalette flag set.

See also
setPalette
kFeatureCursorPalette