SDL_PenAxis - Pen axis indices.
Contents
Availability
This enum is available since SDL 3.2.0.
Simple Directmedia Layer SDL 3.2.20 SDL_PenAxis(3type)
Description
These are the valid values for the axis field in SDL_PenAxisEvent. All axes are either normalised to
0..1 or report a (positive or negative) angle in degrees, with 0.0 representing the centre. Not all
pens/backends support all axes: unsupported axes are always zero.
To convert angles for tilt and rotation into vector representation, use SDL_sinf on the XTILT, YTILT, or
ROTATION component, for example:
SDL_sinf(xtilt*SDL_PI_F/180.0).
Name
SDL_PenAxis - Pen axis indices.
Synopsis
#include<SDL3/SDL_pen.h>typedefenumSDL_PenAxis{SDL_PEN_AXIS_PRESSURE,/**<Penpressure.Unidirectional:0to1.0*/SDL_PEN_AXIS_XTILT,/**<Penhorizontaltiltangle.Bidirectional:-90.0to90.0(left-to-right).*/SDL_PEN_AXIS_YTILT,/**<Penverticaltiltangle.Bidirectional:-90.0to90.0(top-to-down).*/SDL_PEN_AXIS_DISTANCE,/**<Pendistancetodrawingsurface.Unidirectional:0.0to1.0*/SDL_PEN_AXIS_ROTATION,/**<Penbarrelrotation.Bidirectional:-180to179.9(clockwise,0isfacingup,-180.0isfacingdown).*/SDL_PEN_AXIS_SLIDER,/**<Penfingerwheelorslider(e.g.,AirbrushPen).Unidirectional:0to1.0*/SDL_PEN_AXIS_TANGENTIAL_PRESSURE,/**<Pressurefromsqueezingthepen("barrelpressure").*/SDL_PEN_AXIS_COUNT/**<TotalknownpenaxistypesinthisversionofSDL.Thisnumbermaygrowinfuturereleases!*/}SDL_PenAxis;