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, const byte *mask=nullptr)=0
 
virtual void OSystem::setCursorPalette (const byte *colors, uint start, uint num)
 
virtual uint32 OSystem::getDoubleClickTime () const
 

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

Implemented in OSystem_Wii, N3DS::OSystem_3DS, OSystem_N64, OSystem_DS, OSystem_Dreamcast, ModularGraphicsBackend, and OSystem_PSP.

◆ lockMouse()

virtual bool OSystem::lockMouse ( bool  lock)
inlinevirtual

Lock or unlock the mouse cursor within the window.

Reimplemented in ModularGraphicsBackend.

◆ 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.

Implemented in OSystem_Wii, OSystem_N64, N3DS::OSystem_3DS, OSystem_DS, OSystem_Dreamcast, ModularGraphicsBackend, and OSystem_PSP.

◆ 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,
const byte *  mask = 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). This parameter does nothing if a mask is provided.
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).
maskA mask containing values from the CursorMaskValue enum for each cursor pixel.

Implemented in OSystem_Wii, OSystem_N64, N3DS::OSystem_3DS, OSystem_Dreamcast, OSystem_DS, ModularGraphicsBackend, and OSystem_PSP.

◆ 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

Reimplemented in N3DS::OSystem_3DS, OSystem_N64, OSystem_Wii, OSystem_DS, OSystem_Dreamcast, ModularGraphicsBackend, and OSystem_PSP.

◆ getDoubleClickTime()

virtual uint32 OSystem::getDoubleClickTime ( ) const
inlinevirtual

Get the system-configured double-click time interval. If the system doesn't support configuring double-click time, returns 0.

Reimplemented in OSystem_SDL.