|
| 1 | +{* |
| 2 | + * SDL pen instance IDs. |
| 3 | + * |
| 4 | + * Zero is used to signify an invalid/null device. |
| 5 | + * |
| 6 | + * These show up in pen events when SDL sees input from them. They remain |
| 7 | + * consistent as long as SDL can recognize a tool to be the same pen; but if a |
| 8 | + * pen physically leaves the area and returns, it might get a new ID. |
| 9 | + * |
| 10 | + * \since This datatype is available since SDL 3.1.3. |
| 11 | + } |
| 12 | +type |
| 13 | + PPSDL_PenID = ^PSDL_PenID; |
| 14 | + PSDL_PenID = ^TSDL_PenID; |
| 15 | + TSDL_PenID = cuint32; |
| 16 | +{* |
| 17 | + * Pen input flags, as reported by various pen events' `pen_state` field. |
| 18 | + * |
| 19 | + * \since This datatype is available since SDL 3.1.3. |
| 20 | + } |
| 21 | + PPSDL_PenInputFlags = ^PSDL_PenInputFlags; |
| 22 | + PSDL_PenInputFlags = ^TSDL_PenInputFlags; |
| 23 | + TSDL_PenInputFlags = cuint32; |
| 24 | +
|
| 25 | + {* |
| 26 | + * Pen axis indices. |
| 27 | + * |
| 28 | + * These are the valid values for the `axis` field in SDL_PenAxisEvent. All |
| 29 | + * axes are either normalised to 0..1 or report a (positive or negative) angle |
| 30 | + * in degrees, with 0.0 representing the centre. Not all pens/backends support |
| 31 | + * all axes: unsupported axes are always zero. |
| 32 | + * |
| 33 | + * To convert angles for tilt and rotation into vector representation, use |
| 34 | + * SDL_sinf on the XTILT, YTILT, or ROTATION component, for example: |
| 35 | + * |
| 36 | + * `SDL_sinf(xtilt * SDL_PI_F / 180.0)`. |
| 37 | + * |
| 38 | + * \since This enum is available since SDL 3.1.3 |
| 39 | + } |
| 40 | +type |
| 41 | + PPSDL_PenAxis = ^PSDL_PenAxis; |
| 42 | + PSDL_PenAxis = ^TSDL_PenAxis; |
| 43 | + TSDL_PenAxis = type Integer; |
| 44 | +const |
| 45 | + SDL_PEN_AXIS_PRESSURE = TSDL_PenAxis(0); {*< Pen pressure. Unidirectional: 0 to 1.0 } |
| 46 | + SDL_PEN_AXIS_XTILT = TSDL_PenAxis(1); {*< Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). } |
| 47 | + SDL_PEN_AXIS_YTILT = TSDL_PenAxis(2); {*< Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). } |
| 48 | + SDL_PEN_AXIS_DISTANCE = TSDL_PenAxis(3); {*< Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 } |
| 49 | + SDL_PEN_AXIS_ROTATION = TSDL_PenAxis(4); {*< Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). } |
| 50 | + SDL_PEN_AXIS_SLIDER = TSDL_PenAxis(5); {*< Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 } |
| 51 | + SDL_PEN_AXIS_TANGENTIAL_PRESSURE = TSDL_PenAxis(6); {*< Pressure from squeezing the pen ("barrel pressure"). } |
| 52 | + SDL_PEN_AXIS_COUNT = TSDL_PenAxis(7); {*< Total known pen axis types in this version of SDL. This number may grow in future releases! } |
| 53 | +
|
0 commit comments