Merging r6173 through r6179 from trunk to ogl-es branch

- Adding optional support for touch input in X11


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6180 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien
2020-12-30 18:39:20 +00:00
parent 1e6fe54cf5
commit a9f7c2abc9
5 changed files with 139 additions and 31 deletions

View File

@ -37,14 +37,14 @@ namespace irr
//! A touch input event.
EET_TOUCH_INPUT_EVENT,
//! A accelerometer event.
EET_ACCELEROMETER_EVENT,
//! A accelerometer event.
EET_ACCELEROMETER_EVENT,
//! A gyroscope event.
EET_GYROSCOPE_EVENT,
//! A gyroscope event.
EET_GYROSCOPE_EVENT,
//! A device motion event.
EET_DEVICE_MOTION_EVENT,
//! A device motion event.
EET_DEVICE_MOTION_EVENT,
//! A joystick (joypad, gamepad) input event.
/** Joystick events are created by polling all connected joysticks once per
@ -353,6 +353,22 @@ struct SEvent
};
//! Any kind of touch event.
struct STouchInput
{
// Touch ID.
size_t ID;
// X position of simple touch.
s32 X;
// Y position of simple touch.
s32 Y;
//! Type of touch event.
ETOUCH_INPUT_EVENT Event;
};
//! Any kind of mouse event.
struct SMouseInput
{
@ -416,58 +432,55 @@ struct SEvent
//! Any kind of touch event.
struct STouchInput
{
// Touch ID.
size_t ID;
// Touch ID.
size_t ID;
// X position of simple touch.
// X position of simple touch.
s32 X;
// Y position of simple touch.
// Y position of simple touch.
s32 Y;
//! Type of touch event.
ETOUCH_INPUT_EVENT Event;
};
//! Any kind of accelerometer event.
//! Any kind of accelerometer event.
struct SAccelerometerEvent
{
// X acceleration.
// X acceleration.
f64 X;
// Y acceleration.
// Y acceleration.
f64 Y;
// Z acceleration.
// Z acceleration.
f64 Z;
};
//! Any kind of gyroscope event.
struct SGyroscopeEvent
{
// X rotation.
// X rotation.
f64 X;
// Y rotation.
// Y rotation.
f64 Y;
// Z rotation.
// Z rotation.
f64 Z;
};
//! Any kind of device motion event.
//! Any kind of device motion event.
struct SDeviceMotionEvent
{
// X angle - roll.
// X angle - roll.
f64 X;
// Y angle - pitch.
// Y angle - pitch.
f64 Y;
// Z angle - yaw.
// Z angle - yaw.
f64 Z;
};
@ -581,10 +594,10 @@ struct SEvent
struct SGUIEvent GUIEvent;
struct SMouseInput MouseInput;
struct SKeyInput KeyInput;
struct STouchInput TouchInput;
struct SAccelerometerEvent AccelerometerEvent;
struct SGyroscopeEvent GyroscopeEvent;
struct SDeviceMotionEvent DeviceMotionEvent;
struct STouchInput TouchInput;
struct SAccelerometerEvent AccelerometerEvent;
struct SGyroscopeEvent GyroscopeEvent;
struct SDeviceMotionEvent DeviceMotionEvent;
struct SJoystickEvent JoystickEvent;
struct SLogEvent LogEvent;
struct SUserEvent UserEvent;

View File

@ -317,18 +317,22 @@ define out. */
#undef _IRR_COMPILE_WITH_X11_
#endif
//! On some Linux systems the XF86 vidmode extension or X11 RandR are missing. Use these flags
//! to remove the dependencies such that Irrlicht will compile on those systems, too.
//! If you don't need colored cursors you can also disable the Xcursor extension
//! On some Linux systems the XF86 vidmode extension, X11 RandR, or XInput2 are missing.
//! Use these defines to add/remove support for those dependencies as needed.
//! XInput2 (library called Xi) is currently only used to support touch-input.
#if defined(_IRR_LINUX_PLATFORM_) && defined(_IRR_COMPILE_WITH_X11_)
#define _IRR_LINUX_X11_VIDMODE_
//#define _IRR_LINUX_X11_RANDR_
//#define _IRR_LINUX_X11_XINPUT2_
#ifdef NO_IRR_LINUX_X11_VIDMODE_
#undef _IRR_LINUX_X11_VIDMODE_
#endif
#ifdef NO_IRR_LINUX_X11_RANDR_
#undef _IRR_LINUX_X11_RANDR_
#endif
#ifdef NO_IRR_LINUX_X11_XINPUT2_
#undef _IRR_LINUX_X11_XINPUT2_
#endif
//! X11 has by default only monochrome cursors, but using the Xcursor library we can also get color cursor support.
//! If you have the need for custom color cursors on X11 then enable this and make sure you also link