mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-15 18:57:08 +00:00
Better UX when touch events aren't supported by Irrlicht device (#15288)
This commit is contained in:
parent
24704b01d9
commit
9f43018df2
10 changed files with 50 additions and 4 deletions
|
@ -193,6 +193,11 @@ public:
|
|||
/** If this returns false, you should not do any rendering. */
|
||||
virtual bool isWindowVisible() const { return true; };
|
||||
|
||||
//! Checks if the Irrlicht device supports touch events.
|
||||
/** Intentionally doesn't check whether a touch input device is available
|
||||
or similar. */
|
||||
virtual bool supportsTouchEvents() const { return false; }
|
||||
|
||||
//! Get the current color format of the window
|
||||
/** \return Color format of the window. */
|
||||
virtual video::ECOLOR_FORMAT getColorFormat() const = 0;
|
||||
|
|
|
@ -1205,6 +1205,17 @@ bool CIrrDeviceLinux::isWindowMaximized() const
|
|||
return WindowMaximized;
|
||||
}
|
||||
|
||||
//! Checks if the Irrlicht device supports touch events.
|
||||
bool CIrrDeviceLinux::supportsTouchEvents() const
|
||||
{
|
||||
#if defined(_IRR_LINUX_X11_XINPUT2_)
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
//! returns color format of the window.
|
||||
video::ECOLOR_FORMAT CIrrDeviceLinux::getColorFormat() const
|
||||
{
|
||||
|
|
|
@ -66,6 +66,9 @@ public:
|
|||
//! returns last state from maximizeWindow() and restoreWindow()
|
||||
bool isWindowMaximized() const override;
|
||||
|
||||
//! Checks if the Irrlicht device supports touch events.
|
||||
bool supportsTouchEvents() const override;
|
||||
|
||||
//! returns color format of the window.
|
||||
video::ECOLOR_FORMAT getColorFormat() const override;
|
||||
|
||||
|
|
|
@ -1293,6 +1293,12 @@ bool CIrrDeviceSDL::isWindowVisible() const
|
|||
return !IsInBackground;
|
||||
}
|
||||
|
||||
//! Checks if the Irrlicht device supports touch events.
|
||||
bool CIrrDeviceSDL::supportsTouchEvents() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//! returns if window is active. if not, nothing need to be drawn
|
||||
bool CIrrDeviceSDL::isWindowActive() const
|
||||
{
|
||||
|
|
|
@ -93,6 +93,9 @@ public:
|
|||
//! Checks if the window could possibly be visible.
|
||||
bool isWindowVisible() const override;
|
||||
|
||||
//! Checks if the Irrlicht device supports touch events.
|
||||
bool supportsTouchEvents() const override;
|
||||
|
||||
//! Get the position of this window on screen
|
||||
core::position2di getWindowPosition() override;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue