mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-04 14:24:57 +08:00
video, x11: fix linkage if SDL_VIDEO_DRIVER_X11_XINPUT2 isn't defined.
This commit is contained in:
@@ -20,14 +20,14 @@
|
|||||||
*/
|
*/
|
||||||
#include "../../SDL_internal.h"
|
#include "../../SDL_internal.h"
|
||||||
|
|
||||||
#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2
|
|
||||||
|
|
||||||
#include "../../events/SDL_pen_c.h"
|
#include "../../events/SDL_pen_c.h"
|
||||||
#include "../SDL_sysvideo.h"
|
#include "../SDL_sysvideo.h"
|
||||||
#include "SDL_x11pen.h"
|
#include "SDL_x11pen.h"
|
||||||
#include "SDL_x11video.h"
|
#include "SDL_x11video.h"
|
||||||
#include "SDL_x11xinput2.h"
|
#include "SDL_x11xinput2.h"
|
||||||
|
|
||||||
|
#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2
|
||||||
|
|
||||||
/* Does this device have a valuator for pressure sensitivity? */
|
/* Does this device have a valuator for pressure sensitivity? */
|
||||||
static SDL_bool X11_XInput2DeviceIsPen(SDL_VideoDevice *_this, const XIDeviceInfo *dev)
|
static SDL_bool X11_XInput2DeviceIsPen(SDL_VideoDevice *_this, const XIDeviceInfo *dev)
|
||||||
{
|
{
|
||||||
@@ -416,5 +416,17 @@ void X11_PenAxesFromValuators(const X11_PenHandle *pen,
|
|||||||
X11_XInput2NormalizePenAxes(pen, axis_values);
|
X11_XInput2NormalizePenAxes(pen, axis_values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
void X11_InitPen(SDL_VideoDevice *_this)
|
||||||
|
{
|
||||||
|
(void) _this;
|
||||||
|
}
|
||||||
|
|
||||||
|
void X11_QuitPen(SDL_VideoDevice *_this)
|
||||||
|
{
|
||||||
|
(void) _this;
|
||||||
|
}
|
||||||
|
|
||||||
#endif // SDL_VIDEO_DRIVER_X11_XINPUT2
|
#endif // SDL_VIDEO_DRIVER_X11_XINPUT2
|
||||||
|
|
||||||
|
|||||||
@@ -25,11 +25,17 @@
|
|||||||
|
|
||||||
// Pressure-sensitive pen support for X11.
|
// Pressure-sensitive pen support for X11.
|
||||||
|
|
||||||
#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2
|
|
||||||
|
|
||||||
#include "SDL_x11video.h"
|
#include "SDL_x11video.h"
|
||||||
#include "../../events/SDL_pen_c.h"
|
#include "../../events/SDL_pen_c.h"
|
||||||
|
|
||||||
|
// Prep pen support (never fails; pens simply won't be added if there's a problem).
|
||||||
|
extern void X11_InitPen(SDL_VideoDevice *_this);
|
||||||
|
|
||||||
|
// Clean up pen support.
|
||||||
|
extern void X11_QuitPen(SDL_VideoDevice *_this);
|
||||||
|
|
||||||
|
#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2
|
||||||
|
|
||||||
// Forward definition for SDL_x11video.h
|
// Forward definition for SDL_x11video.h
|
||||||
struct SDL_VideoData;
|
struct SDL_VideoData;
|
||||||
|
|
||||||
@@ -47,12 +53,6 @@ typedef struct X11_PenHandle
|
|||||||
float axis_max[SDL_PEN_NUM_AXES];
|
float axis_max[SDL_PEN_NUM_AXES];
|
||||||
} X11_PenHandle;
|
} X11_PenHandle;
|
||||||
|
|
||||||
// Prep pen support (never fails; pens simply won't be added if there's a problem).
|
|
||||||
extern void X11_InitPen(SDL_VideoDevice *_this);
|
|
||||||
|
|
||||||
// Clean up pen support.
|
|
||||||
extern void X11_QuitPen(SDL_VideoDevice *_this);
|
|
||||||
|
|
||||||
// Converts XINPUT2 valuators into pen axis information, including normalisation.
|
// Converts XINPUT2 valuators into pen axis information, including normalisation.
|
||||||
extern void X11_PenAxesFromValuators(const X11_PenHandle *pen,
|
extern void X11_PenAxesFromValuators(const X11_PenHandle *pen,
|
||||||
const double *input_values, const unsigned char *mask, const int mask_len,
|
const double *input_values, const unsigned char *mask, const int mask_len,
|
||||||
@@ -70,4 +70,3 @@ extern X11_PenHandle *X11_FindPenByDeviceID(int deviceid);
|
|||||||
#endif // SDL_VIDEO_DRIVER_X11_XINPUT2
|
#endif // SDL_VIDEO_DRIVER_X11_XINPUT2
|
||||||
|
|
||||||
#endif // SDL_x11pen_h_
|
#endif // SDL_x11pen_h_
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user