Skip to content

Commit 5516740

Browse files
committed
pen: Improved docs for SDL_PenDeviceType.
1 parent 4ece699 commit 5516740

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

include/SDL3/SDL_pen.h

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,18 +130,31 @@ typedef enum SDL_PenAxis
130130
/**
131131
* An enum that describes the type of a pen device.
132132
*
133+
* A "direct" device is a pen that touches a graphic display (like an
134+
* Apple Pencil on an iPad's screen). "Indirect" devices touch an external
135+
* tablet surface that is connected to the machine but is not a display (like
136+
* a lower-end Wacom tablet connected over USB).
137+
*
138+
* Apps may use this information to decide if they should draw a cursor; if
139+
* the pen is touching the screen directly, a cursor doesn't make sense and
140+
* can be in the way, but becomes necessary for indirect devices to know where
141+
* on the display they are interacting.
142+
*
133143
* \since This enum is available since SDL 3.4.0.
134144
*/
135145
typedef enum SDL_PenDeviceType
136146
{
137-
SDL_PEN_DEVICE_TYPE_INVALID = -1,
138-
SDL_PEN_DEVICE_TYPE_UNKNOWN,
139-
SDL_PEN_DEVICE_TYPE_DIRECT,
140-
SDL_PEN_DEVICE_TYPE_INDIRECT
147+
SDL_PEN_DEVICE_TYPE_INVALID = -1, /**< Not a valid pen device. */
148+
SDL_PEN_DEVICE_TYPE_UNKNOWN, /**< Don't know specifics of this pen. */
149+
SDL_PEN_DEVICE_TYPE_DIRECT, /**< Pen touches display. */
150+
SDL_PEN_DEVICE_TYPE_INDIRECT /**< Pen touches something that isn't the display. */
141151
} SDL_PenDeviceType;
142152

143153
/**
144154
* Get the device type of the given pen.
155+
156+
* Many platforms do not supply this information, so an app must always be
157+
* prepared to get an SDL_PEN_DEVICE_TYPE_UNKNOWN result.
145158
*
146159
* \param instance_id the pen instance ID.
147160
* \returns the device type of the given pen, or SDL_PEN_DEVICE_TYPE_INVALID

0 commit comments

Comments
 (0)