34 lines
1.5 KiB
Zig
34 lines
1.5 KiB
Zig
const std = @import("std");
|
|
pub const c = @import("c.zig").c;
|
|
pub const PenID = packed struct(u32) {
|
|
pad0: u31 = 0,
|
|
rsvd: bool = false,
|
|
|
|
pub const None = PenID{};
|
|
};
|
|
|
|
pub const PenInputFlags = packed struct(u32) {
|
|
penInputDown: bool = false, // pen is pressed down
|
|
penInputButton1: bool = false, // button 1 is pressed
|
|
penInputButton2: bool = false, // button 2 is pressed
|
|
penInputButton3: bool = false, // button 3 is pressed
|
|
penInputButton4: bool = false, // button 4 is pressed
|
|
penInputButton5: bool = false, // button 5 is pressed
|
|
pad0: u24 = 0,
|
|
penInputEraserTip: bool = false, // eraser tip is used
|
|
rsvd: bool = false,
|
|
|
|
pub const None = PenInputFlags{};
|
|
};
|
|
|
|
pub const PenAxis = enum(c_int) {
|
|
penAxisPressure, //Pen pressure. Unidirectional: 0 to 1.0
|
|
penAxisXtilt, //Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right).
|
|
penAxisYtilt, //Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down).
|
|
penAxisDistance, //Pen distance to drawing surface. Unidirectional: 0.0 to 1.0
|
|
penAxisRotation, //Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down).
|
|
penAxisSlider, //Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0
|
|
penAxisTangentialPressure, //Pressure from squeezing the pen ("barrel pressure").
|
|
penAxisCount, //Total known pen axis types in this version of SDL. This number may grow in future releases!
|
|
};
|