![]() |
Duckcpp 2.1.0
Duckcpp is a high-performance c++ graphics engine.
|
Interface to manipulate the mouse cursor. More...
#include <duckcpp/core/engine/ICursorControl.hpp>
Public Member Functions | |
virtual void | setVisible (bool visible)=0 |
Changes the visible state of the mouse cursor. | |
virtual bool | isVisible () const =0 |
Returns if the cursor is currently visible. | |
virtual void | setPosition (const dcpp::nub::position2df &pos)=0 |
Sets the new position of the cursor. | |
virtual void | setPosition (dcpp::float32_kt x, dcpp::float32_kt y)=0 |
Sets the new position of the cursor. | |
virtual void | setPosition (const dcpp::nub::position2di &pos)=0 |
Sets the new position of the cursor. | |
virtual void | setPosition (dcpp::int32_kt x, dcpp::int32_kt y)=0 |
Sets the new position of the cursor. | |
virtual const dcpp::nub::position2di & | getPosition (bool updateCursor=true)=0 |
Returns the current position of the mouse cursor. | |
virtual dcpp::nub::position2df | getRelativePosition (bool updateCursor=true)=0 |
Returns the current position of the mouse cursor. | |
virtual void | setReferenceRect (dcpp::nub::recti *rect=0)=0 |
Sets an absolute reference rect for setting and retrieving the cursor position. | |
virtual void | setActiveIcon (ECURSOR_ICON iconId) |
Sets the active cursor icon. | |
virtual ECURSOR_ICON | getActiveIcon () const |
Gets the currently active icon. | |
virtual ECURSOR_ICON | addIcon (const dcpp::gui::SCursorSprite &icon) |
Add a custom sprite as cursor icon. | |
virtual void | changeIcon (ECURSOR_ICON iconId, const dcpp::gui::SCursorSprite &sprite) |
replace a cursor icon. | |
virtual dcpp::nub::dimension2di | getSupportedIconSize () const |
Return a system-specific size which is supported for cursors. Larger icons will fail, smaller icons might work. | |
virtual void | setPlatformBehavior (ECURSOR_PLATFORM_BEHAVIOR behavior) |
Set platform specific behavior flags. | |
virtual ECURSOR_PLATFORM_BEHAVIOR | getPlatformBehavior () const |
Return platform specific behavior. | |
![]() | |
IReferenceCounted () | |
Constructor. | |
virtual | ~IReferenceCounted () |
Destructor. | |
void | grab () const |
Grabs the object. Increments the reference counter by one. | |
bool | drop () const |
Drops the object. Decrements the reference counter by one. | |
dcpp::int32_kt | getReferenceCount () const |
Get the reference count. | |
const dcpp::char_kt * | getDebugName () const |
Returns the debug name of the object. | |
Additional Inherited Members | |
![]() | |
void | setDebugName (const dcpp::char_kt *newName) |
Sets the debug name of the object. | |
Interface to manipulate the mouse cursor.
|
inlinevirtual |
Add a custom sprite as cursor icon.
|
inlinevirtual |
replace a cursor icon.
Changing cursor icons is so far only supported on Win32 and Linux Note that this only changes the icons within your application, system cursors outside your application will not be affected.
|
inlinevirtual |
Return platform specific behavior.
|
pure virtual |
Returns the current position of the mouse cursor.
updateCursor | When true ask system/OS for current cursor position. When false return the last known (buffered) position ( this is useful to check what has become of a setPosition call with float numbers). |
|
pure virtual |
Returns the current position of the mouse cursor.
updateCursor | When true ask system/OS for current cursor position. When false return the last known (buffered) position (this is useful to check what has become of a setPosition call with float numbers and is often different from the values you passed in setPosition). |
|
pure virtual |
Returns if the cursor is currently visible.
|
inlinevirtual |
Sets the active cursor icon.
Setting cursor icons is so far only supported on Win32 and Linux
|
pure virtual |
Sets the new position of the cursor.
The position must be between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is the top left corner and (1.0f, 1.0f) is the bottom right corner of the render window.
pos | New position of the cursor. |
|
pure virtual |
Sets the new position of the cursor.
pos | New position of the cursor. The coordinates are pixel units. |
|
pure virtual |
Sets the new position of the cursor.
The position must be between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is the top left corner and (1.0f, 1.0f) is the bottom right corner of the render window.
x | New x-coord of the cursor. |
y | New x-coord of the cursor. |
|
pure virtual |
Sets the new position of the cursor.
x | New x-coord of the cursor. The coordinates are pixel units. |
y | New y-coord of the cursor. The coordinates are pixel units. |
|
pure virtual |
Sets an absolute reference rect for setting and retrieving the cursor position.
If this rect is set, the cursor position is not being calculated relative to the rendering window but to this rect. You can set the rect pointer to 0 to disable this feature again. This feature is useful when rendering into parts of foreign windows for example in an editor.
rect | A pointer to an reference rectangle or 0 to disable the reference rectangle. |
|
pure virtual |
Changes the visible state of the mouse cursor.
visible | The new visible state. If true, the cursor will be visible, if false, it will be invisible. |