uploading generated bindings
This commit is contained in:
commit
4d598067f3
|
|
@ -0,0 +1 @@
|
||||||
|
*tmp/
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
# generated zig bindings for SDl3
|
||||||
|
|
||||||
|
Generated by peter's scrap parser.
|
||||||
|
|
||||||
|
https://git.peterino.com/searzocom/sdlparser-scrap
|
||||||
|
|
||||||
|
These are not tested, use at your own peril
|
||||||
|
|
||||||
|
everything under castholm is generated from castholm's SDL repo
|
||||||
|
|
||||||
|
git@github.com:castholm/SDL.git
|
||||||
|
|
||||||
|
everything under official is generated from the official SDL repo
|
||||||
|
|
||||||
|
git@github.com:libsdl-org/SDL.git
|
||||||
|
|
@ -0,0 +1,244 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const PropertiesID = u32;
|
||||||
|
|
||||||
|
pub const IOStream = opaque {
|
||||||
|
pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool {
|
||||||
|
return c.SDL_LoadWAV_IO(iostream, closeio, spec, audio_buf, @ptrCast(audio_len));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const AudioFormat = enum(c_int) {
|
||||||
|
audioUnknown, //Unspecified audio format
|
||||||
|
audioU8, //Unsigned 8-bit samples
|
||||||
|
audioS8, //Signed 8-bit samples
|
||||||
|
audioS16le, //Signed 16-bit samples
|
||||||
|
audioS16be, //As above, but big-endian byte order
|
||||||
|
audioS32le, //32-bit integer samples
|
||||||
|
audioS32be, //As above, but big-endian byte order
|
||||||
|
audioF32le, //32-bit floating point samples
|
||||||
|
audioF32be, //As above, but big-endian byte order
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const AudioDeviceID = u32;
|
||||||
|
|
||||||
|
pub const AudioSpec = extern struct {
|
||||||
|
format: AudioFormat, // Audio data format
|
||||||
|
channels: c_int, // Number of channels: 1 mono, 2 stereo, etc
|
||||||
|
freq: c_int, // sample rate: sample frames per second
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const AudioStream = opaque {
|
||||||
|
pub inline fn unbindAudioStream(audiostream: *AudioStream) void {
|
||||||
|
return c.SDL_UnbindAudioStream(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID {
|
||||||
|
return c.SDL_GetAudioStreamDevice(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID {
|
||||||
|
return c.SDL_GetAudioStreamProperties(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool {
|
||||||
|
return c.SDL_GetAudioStreamFormat(audiostream, src_spec, dst_spec);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: *const AudioSpec, dst_spec: *const AudioSpec) bool {
|
||||||
|
return c.SDL_SetAudioStreamFormat(audiostream, @ptrCast(src_spec), @ptrCast(dst_spec));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 {
|
||||||
|
return c.SDL_GetAudioStreamFrequencyRatio(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool {
|
||||||
|
return c.SDL_SetAudioStreamFrequencyRatio(audiostream, ratio);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 {
|
||||||
|
return c.SDL_GetAudioStreamGain(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool {
|
||||||
|
return c.SDL_SetAudioStreamGain(audiostream, gain);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int {
|
||||||
|
return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(audiostream, @ptrCast(count)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int {
|
||||||
|
return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(audiostream, @ptrCast(count)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool {
|
||||||
|
return c.SDL_SetAudioStreamInputChannelMap(audiostream, chmap, count);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool {
|
||||||
|
return c.SDL_SetAudioStreamOutputChannelMap(audiostream, chmap, count);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool {
|
||||||
|
return c.SDL_PutAudioStreamData(audiostream, buf, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int {
|
||||||
|
return c.SDL_GetAudioStreamData(audiostream, buf, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int {
|
||||||
|
return c.SDL_GetAudioStreamAvailable(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int {
|
||||||
|
return c.SDL_GetAudioStreamQueued(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn flushAudioStream(audiostream: *AudioStream) bool {
|
||||||
|
return c.SDL_FlushAudioStream(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn clearAudioStream(audiostream: *AudioStream) bool {
|
||||||
|
return c.SDL_ClearAudioStream(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool {
|
||||||
|
return c.SDL_PauseAudioStreamDevice(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool {
|
||||||
|
return c.SDL_ResumeAudioStreamDevice(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn lockAudioStream(audiostream: *AudioStream) bool {
|
||||||
|
return c.SDL_LockAudioStream(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn unlockAudioStream(audiostream: *AudioStream) bool {
|
||||||
|
return c.SDL_UnlockAudioStream(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool {
|
||||||
|
return c.SDL_SetAudioStreamGetCallback(audiostream, callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool {
|
||||||
|
return c.SDL_SetAudioStreamPutCallback(audiostream, callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn destroyAudioStream(audiostream: *AudioStream) void {
|
||||||
|
return c.SDL_DestroyAudioStream(audiostream);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn getNumAudioDrivers() c_int {
|
||||||
|
return c.SDL_GetNumAudioDrivers();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioDriver(index: c_int) [*c]const u8 {
|
||||||
|
return c.SDL_GetAudioDriver(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCurrentAudioDriver() [*c]const u8 {
|
||||||
|
return c.SDL_GetCurrentAudioDriver();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID {
|
||||||
|
return c.SDL_GetAudioPlaybackDevices(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID {
|
||||||
|
return c.SDL_GetAudioRecordingDevices(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 {
|
||||||
|
return c.SDL_GetAudioDeviceName(devid);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool {
|
||||||
|
return c.SDL_GetAudioDeviceFormat(devid, spec, @ptrCast(sample_frames));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int {
|
||||||
|
return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openAudioDevice(devid: AudioDeviceID, spec: *const AudioSpec) AudioDeviceID {
|
||||||
|
return c.SDL_OpenAudioDevice(devid, @ptrCast(spec));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn pauseAudioDevice(dev: AudioDeviceID) bool {
|
||||||
|
return c.SDL_PauseAudioDevice(dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn resumeAudioDevice(dev: AudioDeviceID) bool {
|
||||||
|
return c.SDL_ResumeAudioDevice(dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn audioDevicePaused(dev: AudioDeviceID) bool {
|
||||||
|
return c.SDL_AudioDevicePaused(dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 {
|
||||||
|
return c.SDL_GetAudioDeviceGain(devid);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool {
|
||||||
|
return c.SDL_SetAudioDeviceGain(devid, gain);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn closeAudioDevice(devid: AudioDeviceID) void {
|
||||||
|
return c.SDL_CloseAudioDevice(devid);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c][*c]AudioStream, num_streams: c_int) bool {
|
||||||
|
return c.SDL_BindAudioStreams(devid, streams, num_streams);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool {
|
||||||
|
return c.SDL_BindAudioStream(devid, stream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn unbindAudioStreams(streams: [*c][*c]AudioStream, num_streams: c_int) void {
|
||||||
|
return c.SDL_UnbindAudioStreams(streams, num_streams);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn createAudioStream(src_spec: *const AudioSpec, dst_spec: *const AudioSpec) ?*AudioStream {
|
||||||
|
return c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const AudioStreamCallback = c.SDL_AudioStreamCallback;
|
||||||
|
|
||||||
|
pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: *const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream {
|
||||||
|
return c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback;
|
||||||
|
|
||||||
|
pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool {
|
||||||
|
return c.SDL_SetAudioPostmixCallback(devid, callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool {
|
||||||
|
return c.SDL_LoadWAV(path, spec, audio_buf, @ptrCast(audio_len));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool {
|
||||||
|
return c.SDL_MixAudio(dst, src, @bitCast(format), len, volume);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn convertAudioSamples(src_spec: *const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: *const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool {
|
||||||
|
return c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 {
|
||||||
|
return c.SDL_GetAudioFormatName(@bitCast(format));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int {
|
||||||
|
return c.SDL_GetSilenceValueForFormat(@bitCast(format));
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const BlendMode = u32;
|
||||||
|
|
||||||
|
pub const BlendOperation = enum(c_int) {
|
||||||
|
blendoperationAdd, //dst + src: supported by all renderers
|
||||||
|
blendoperationSubtract, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan
|
||||||
|
blendoperationRevSubtract, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan
|
||||||
|
blendoperationMinimum, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan
|
||||||
|
blendoperationMaximum,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const BlendFactor = enum(c_int) {
|
||||||
|
blendfactorZero, //0, 0, 0, 0
|
||||||
|
blendfactorOne, //1, 1, 1, 1
|
||||||
|
blendfactorSrcColor, //srcR, srcG, srcB, srcA
|
||||||
|
blendfactorOneMinusSrcColor, //1-srcR, 1-srcG, 1-srcB, 1-srcA
|
||||||
|
blendfactorSrcAlpha, //srcA, srcA, srcA, srcA
|
||||||
|
blendfactorOneMinusSrcAlpha, //1-srcA, 1-srcA, 1-srcA, 1-srcA
|
||||||
|
blendfactorDstColor, //dstR, dstG, dstB, dstA
|
||||||
|
blendfactorOneMinusDstColor, //1-dstR, 1-dstG, 1-dstB, 1-dstA
|
||||||
|
blendfactorDstAlpha, //dstA, dstA, dstA, dstA
|
||||||
|
blendfactorOneMinusDstAlpha,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode {
|
||||||
|
return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation)));
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,126 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const PixelFormat = enum(c_int) {
|
||||||
|
pixelformatYv12, //Planar mode: Y + V + U (3 planes)
|
||||||
|
pixelformatIyuv, //Planar mode: Y + U + V (3 planes)
|
||||||
|
pixelformatYuy2, //Packed mode: Y0+U0+Y1+V0 (1 plane)
|
||||||
|
pixelformatUyvy, //Packed mode: U0+Y0+V0+Y1 (1 plane)
|
||||||
|
pixelformatYvyu, //Packed mode: Y0+V0+Y1+U0 (1 plane)
|
||||||
|
pixelformatNv12, //Planar mode: Y + U/V interleaved (2 planes)
|
||||||
|
pixelformatNv21, //Planar mode: Y + V/U interleaved (2 planes)
|
||||||
|
pixelformatP010, //Planar mode: Y + U/V interleaved (2 planes)
|
||||||
|
pixelformatExternalOes, //Android video texture format
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Surface = opaque {};
|
||||||
|
|
||||||
|
pub const Colorspace = enum(c_int) {
|
||||||
|
colorspaceSrgb, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
|
||||||
|
colorRangeFull,
|
||||||
|
colorPrimariesBt709,
|
||||||
|
transferCharacteristicsSrgb,
|
||||||
|
matrixCoefficientsIdentity,
|
||||||
|
colorspaceSrgbLinear, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709
|
||||||
|
transferCharacteristicsLinear,
|
||||||
|
colorspaceHdr10, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020
|
||||||
|
colorPrimariesBt2020,
|
||||||
|
transferCharacteristicsPq,
|
||||||
|
colorspaceJpeg, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601
|
||||||
|
transferCharacteristicsBt601,
|
||||||
|
matrixCoefficientsBt601,
|
||||||
|
colorspaceBt601Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601
|
||||||
|
colorRangeLimited,
|
||||||
|
colorPrimariesBt601,
|
||||||
|
colorspaceBt601Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601
|
||||||
|
colorspaceBt709Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709
|
||||||
|
transferCharacteristicsBt709,
|
||||||
|
matrixCoefficientsBt709,
|
||||||
|
colorspaceBt709Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709
|
||||||
|
colorspaceBt2020Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020
|
||||||
|
matrixCoefficientsBt2020Ncl,
|
||||||
|
colorspaceBt2020Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020
|
||||||
|
colorspaceRgbDefault, //The default colorspace for RGB surfaces if no colorspace is specified
|
||||||
|
colorspaceYuvDefault, //The default colorspace for YUV surfaces if no colorspace is specified
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PropertiesID = u32;
|
||||||
|
|
||||||
|
pub const CameraID = u32;
|
||||||
|
|
||||||
|
pub const Camera = opaque {
|
||||||
|
pub inline fn getCameraPermissionState(camera: *Camera) c_int {
|
||||||
|
return c.SDL_GetCameraPermissionState(camera);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCameraID(camera: *Camera) CameraID {
|
||||||
|
return c.SDL_GetCameraID(camera);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCameraProperties(camera: *Camera) PropertiesID {
|
||||||
|
return c.SDL_GetCameraProperties(camera);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool {
|
||||||
|
return c.SDL_GetCameraFormat(camera, spec);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface {
|
||||||
|
return c.SDL_AcquireCameraFrame(camera, @ptrCast(timestampNS));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void {
|
||||||
|
return c.SDL_ReleaseCameraFrame(camera, frame);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn closeCamera(camera: *Camera) void {
|
||||||
|
return c.SDL_CloseCamera(camera);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const CameraSpec = extern struct {
|
||||||
|
format: PixelFormat, // Frame format
|
||||||
|
colorspace: Colorspace, // Frame colorspace
|
||||||
|
width: c_int, // Frame width
|
||||||
|
height: c_int, // Frame height
|
||||||
|
framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)
|
||||||
|
framerate_denominator: c_int, // Frame rate demoninator ((num / denom) == FPS, (denom / num) == duration in seconds)
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const CameraPosition = enum(c_int) {
|
||||||
|
cameraPositionUnknown,
|
||||||
|
cameraPositionFrontFacing,
|
||||||
|
cameraPositionBackFacing,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn getNumCameraDrivers() c_int {
|
||||||
|
return c.SDL_GetNumCameraDrivers();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCameraDriver(index: c_int) [*c]const u8 {
|
||||||
|
return c.SDL_GetCameraDriver(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCurrentCameraDriver() [*c]const u8 {
|
||||||
|
return c.SDL_GetCurrentCameraDriver();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCameras(count: *c_int) ?*CameraID {
|
||||||
|
return c.SDL_GetCameras(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCameraSupportedFormats(devid: CameraID, count: *c_int) [*c][*c]CameraSpec {
|
||||||
|
return c.SDL_GetCameraSupportedFormats(devid, @ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 {
|
||||||
|
return c.SDL_GetCameraName(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition {
|
||||||
|
return c.SDL_GetCameraPosition(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openCamera(instance_id: CameraID, spec: *const CameraSpec) ?*Camera {
|
||||||
|
return c.SDL_OpenCamera(instance_id, @ptrCast(spec));
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub inline fn setClipboardText(text: [*c]const u8) bool {
|
||||||
|
return c.SDL_SetClipboardText(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getClipboardText() [*c]u8 {
|
||||||
|
return c.SDL_GetClipboardText();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hasClipboardText() bool {
|
||||||
|
return c.SDL_HasClipboardText();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setPrimarySelectionText(text: [*c]const u8) bool {
|
||||||
|
return c.SDL_SetPrimarySelectionText(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getPrimarySelectionText() [*c]u8 {
|
||||||
|
return c.SDL_GetPrimarySelectionText();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hasPrimarySelectionText() bool {
|
||||||
|
return c.SDL_HasPrimarySelectionText();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback;
|
||||||
|
|
||||||
|
pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback;
|
||||||
|
|
||||||
|
pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c][*c]const u8, num_mime_types: usize) bool {
|
||||||
|
return c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn clearClipboardData() bool {
|
||||||
|
return c.SDL_ClearClipboardData();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque {
|
||||||
|
return c.SDL_GetClipboardData(mime_type, @ptrCast(size));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hasClipboardData(mime_type: [*c]const u8) bool {
|
||||||
|
return c.SDL_HasClipboardData(mime_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 {
|
||||||
|
return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types));
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const Window = opaque {};
|
||||||
|
|
||||||
|
pub const DialogFileFilter = extern struct {
|
||||||
|
name: [*c]const u8,
|
||||||
|
pattern: [*c]const u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const DialogFileCallback = c.SDL_DialogFileCallback;
|
||||||
|
|
||||||
|
pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: *const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void {
|
||||||
|
return c.SDL_ShowOpenFileDialog(callback, userdata, window, @ptrCast(filters), nfilters, default_location, allow_many);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: *const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void {
|
||||||
|
return c.SDL_ShowSaveFileDialog(callback, userdata, window, @ptrCast(filters), nfilters, default_location);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void {
|
||||||
|
return c.SDL_ShowOpenFolderDialog(callback, userdata, window, default_location, allow_many);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub inline fn outOfMemory() bool {
|
||||||
|
return c.SDL_OutOfMemory();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getError() [*c]const u8 {
|
||||||
|
return c.SDL_GetError();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn clearError() bool {
|
||||||
|
return c.SDL_ClearError();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,759 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const PenID = u32;
|
||||||
|
|
||||||
|
pub const WindowID = u32;
|
||||||
|
|
||||||
|
pub const AudioDeviceID = u32;
|
||||||
|
|
||||||
|
pub const DisplayID = u32;
|
||||||
|
|
||||||
|
pub const CameraID = u32;
|
||||||
|
|
||||||
|
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
|
||||||
|
penInputEraserTip: bool = false, // eraser tip is used
|
||||||
|
pad0: u24 = 0,
|
||||||
|
rsvd: bool = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MouseButtonFlags = packed struct(u32) {
|
||||||
|
buttonLeft: bool = false,
|
||||||
|
buttonMiddle: bool = false,
|
||||||
|
buttonX1: bool = false,
|
||||||
|
pad0: u28 = 0,
|
||||||
|
rsvd: bool = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Scancode = enum(c_int) {
|
||||||
|
scancodeBackslash,
|
||||||
|
scancodeNonushash,
|
||||||
|
scancodeGrave,
|
||||||
|
scancodeInsert,
|
||||||
|
scancodeNumlockclear,
|
||||||
|
scancodeNonusbackslash,
|
||||||
|
scancodeApplication, //windows contextual menu, compose
|
||||||
|
scancodePower,
|
||||||
|
scancodeHelp, //AL Integrated Help Center
|
||||||
|
scancodeMenu, //Menu (show menu)
|
||||||
|
scancodeStop, //AC Stop
|
||||||
|
scancodeAgain, //AC Redo/Repeat
|
||||||
|
scancodeUndo, //AC Undo
|
||||||
|
scancodeCut, //AC Cut
|
||||||
|
scancodeCopy, //AC Copy
|
||||||
|
scancodePaste, //AC Paste
|
||||||
|
scancodeFind, //AC Find
|
||||||
|
scancodeInternational1,
|
||||||
|
scancodeInternational3, //Yen
|
||||||
|
scancodeLang1, //Hangul/English toggle
|
||||||
|
scancodeLang2, //Hanja conversion
|
||||||
|
scancodeLang3, //Katakana
|
||||||
|
scancodeLang4, //Hiragana
|
||||||
|
scancodeLang5, //Zenkaku/Hankaku
|
||||||
|
scancodeLang6, //reserved
|
||||||
|
scancodeLang7, //reserved
|
||||||
|
scancodeLang8, //reserved
|
||||||
|
scancodeLang9, //reserved
|
||||||
|
scancodeAlterase, //Erase-Eaze
|
||||||
|
scancodeCancel, //AC Cancel
|
||||||
|
scancodeLalt, //alt, option
|
||||||
|
scancodeLgui, //windows, command (apple), meta
|
||||||
|
scancodeRalt, //alt gr, option
|
||||||
|
scancodeRgui, //windows, command (apple), meta
|
||||||
|
scancodeMode,
|
||||||
|
scancodeSleep, //Sleep
|
||||||
|
scancodeWake, //Wake
|
||||||
|
scancodeChannelIncrement, //Channel Increment
|
||||||
|
scancodeChannelDecrement, //Channel Decrement
|
||||||
|
scancodeMediaPlay, //Play
|
||||||
|
scancodeMediaPause, //Pause
|
||||||
|
scancodeMediaRecord, //Record
|
||||||
|
scancodeMediaFastForward, //Fast Forward
|
||||||
|
scancodeMediaRewind, //Rewind
|
||||||
|
scancodeMediaNextTrack, //Next Track
|
||||||
|
scancodeMediaPreviousTrack, //Previous Track
|
||||||
|
scancodeMediaStop, //Stop
|
||||||
|
scancodeMediaEject, //Eject
|
||||||
|
scancodeMediaPlayPause, //Play / Pause
|
||||||
|
scancodeMediaSelect,
|
||||||
|
scancodeAcNew, //AC New
|
||||||
|
scancodeAcOpen, //AC Open
|
||||||
|
scancodeAcClose, //AC Close
|
||||||
|
scancodeAcExit, //AC Exit
|
||||||
|
scancodeAcSave, //AC Save
|
||||||
|
scancodeAcPrint, //AC Print
|
||||||
|
scancodeAcProperties, //AC Properties
|
||||||
|
scancodeAcSearch, //AC Search
|
||||||
|
scancodeAcHome, //AC Home
|
||||||
|
scancodeAcBack, //AC Back
|
||||||
|
scancodeAcForward, //AC Forward
|
||||||
|
scancodeAcStop, //AC Stop
|
||||||
|
scancodeAcRefresh, //AC Refresh
|
||||||
|
scancodeAcBookmarks, //AC Bookmarks
|
||||||
|
scancodeSoftleft,
|
||||||
|
scancodeSoftright,
|
||||||
|
scancodeCall, //Used for accepting phone calls.
|
||||||
|
scancodeEndcall, //Used for rejecting phone calls.
|
||||||
|
scancodeReserved, //400-500 reserved for dynamic keycodes
|
||||||
|
scancodeCount,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const TouchID = u64;
|
||||||
|
|
||||||
|
pub const KeyboardID = u32;
|
||||||
|
|
||||||
|
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!
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MouseID = u32;
|
||||||
|
|
||||||
|
pub const MouseWheelDirection = enum(c_int) {
|
||||||
|
mousewheelNormal, //The scroll direction is normal
|
||||||
|
mousewheelFlipped, //The scroll direction is flipped / natural
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PowerState = enum(c_int) {
|
||||||
|
powerstateError, //error determining power status
|
||||||
|
powerstateUnknown, //cannot determine power status
|
||||||
|
powerstateOnBattery, //Not plugged in, running on the battery
|
||||||
|
powerstateNoBattery, //Plugged in, no battery available
|
||||||
|
powerstateCharging, //Plugged in, charging battery
|
||||||
|
powerstateCharged,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Window = opaque {};
|
||||||
|
|
||||||
|
pub const FingerID = u64;
|
||||||
|
|
||||||
|
pub const Keycode = u32;
|
||||||
|
|
||||||
|
pub const SensorID = u32;
|
||||||
|
|
||||||
|
pub const JoystickID = u32;
|
||||||
|
|
||||||
|
pub const Keymod = u16;
|
||||||
|
|
||||||
|
pub const EventType = enum(c_int) {
|
||||||
|
eventFirst, //Unused (do not remove)
|
||||||
|
eventQuit, //User-requested quit
|
||||||
|
eventTerminating,
|
||||||
|
eventLowMemory,
|
||||||
|
eventWillEnterBackground,
|
||||||
|
eventDidEnterBackground,
|
||||||
|
eventWillEnterForeground,
|
||||||
|
eventDidEnterForeground,
|
||||||
|
eventLocaleChanged, //The user's locale preferences have changed.
|
||||||
|
eventSystemThemeChanged, //The system theme changed
|
||||||
|
eventDisplayOrientation, //Display orientation has changed to data1
|
||||||
|
eventDisplayAdded, //Display has been added to the system
|
||||||
|
eventDisplayRemoved, //Display has been removed from the system
|
||||||
|
eventDisplayMoved, //Display has changed position
|
||||||
|
eventDisplayDesktopModeChanged, //Display has changed desktop mode
|
||||||
|
eventDisplayCurrentModeChanged, //Display has changed current mode
|
||||||
|
eventDisplayContentScaleChanged, //Display has changed content scale
|
||||||
|
eventWindowShown, //Window has been shown
|
||||||
|
eventWindowHidden, //Window has been hidden
|
||||||
|
eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event
|
||||||
|
eventWindowMoved, //Window has been moved to data1, data2
|
||||||
|
eventWindowResized, //Window has been resized to data1xdata2
|
||||||
|
eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2
|
||||||
|
eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed
|
||||||
|
eventWindowMinimized, //Window has been minimized
|
||||||
|
eventWindowMaximized, //Window has been maximized
|
||||||
|
eventWindowRestored, //Window has been restored to normal size and position
|
||||||
|
eventWindowMouseEnter, //Window has gained mouse focus
|
||||||
|
eventWindowMouseLeave, //Window has lost mouse focus
|
||||||
|
eventWindowFocusGained, //Window has gained keyboard focus
|
||||||
|
eventWindowFocusLost, //Window has lost keyboard focus
|
||||||
|
eventWindowCloseRequested, //The window manager requests that the window be closed
|
||||||
|
eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL
|
||||||
|
eventWindowIccprofChanged, //The ICC profile of the window's display has changed
|
||||||
|
eventWindowDisplayChanged, //Window has been moved to display data1
|
||||||
|
eventWindowDisplayScaleChanged, //Window display scale has been changed
|
||||||
|
eventWindowSafeAreaChanged, //The window safe area has been changed
|
||||||
|
eventWindowOccluded, //The window has been occluded
|
||||||
|
eventWindowEnterFullscreen, //The window has entered fullscreen mode
|
||||||
|
eventWindowLeaveFullscreen, //The window has left fullscreen mode
|
||||||
|
eventWindowDestroyed,
|
||||||
|
eventWindowHdrStateChanged, //Window HDR properties have changed
|
||||||
|
eventKeyDown, //Key pressed
|
||||||
|
eventKeyUp, //Key released
|
||||||
|
eventTextEditing, //Keyboard text editing (composition)
|
||||||
|
eventTextInput, //Keyboard text input
|
||||||
|
eventKeymapChanged,
|
||||||
|
eventKeyboardAdded, //A new keyboard has been inserted into the system
|
||||||
|
eventKeyboardRemoved, //A keyboard has been removed
|
||||||
|
eventTextEditingCandidates, //Keyboard text editing candidates
|
||||||
|
eventMouseMotion, //Mouse moved
|
||||||
|
eventMouseButtonDown, //Mouse button pressed
|
||||||
|
eventMouseButtonUp, //Mouse button released
|
||||||
|
eventMouseWheel, //Mouse wheel motion
|
||||||
|
eventMouseAdded, //A new mouse has been inserted into the system
|
||||||
|
eventMouseRemoved, //A mouse has been removed
|
||||||
|
eventJoystickAxisMotion, //Joystick axis motion
|
||||||
|
eventJoystickBallMotion, //Joystick trackball motion
|
||||||
|
eventJoystickHatMotion, //Joystick hat position change
|
||||||
|
eventJoystickButtonDown, //Joystick button pressed
|
||||||
|
eventJoystickButtonUp, //Joystick button released
|
||||||
|
eventJoystickAdded, //A new joystick has been inserted into the system
|
||||||
|
eventJoystickRemoved, //An opened joystick has been removed
|
||||||
|
eventJoystickBatteryUpdated, //Joystick battery level change
|
||||||
|
eventJoystickUpdateComplete, //Joystick update is complete
|
||||||
|
eventGamepadAxisMotion, //Gamepad axis motion
|
||||||
|
eventGamepadButtonDown, //Gamepad button pressed
|
||||||
|
eventGamepadButtonUp, //Gamepad button released
|
||||||
|
eventGamepadAdded, //A new gamepad has been inserted into the system
|
||||||
|
eventGamepadRemoved, //A gamepad has been removed
|
||||||
|
eventGamepadRemapped, //The gamepad mapping was updated
|
||||||
|
eventGamepadTouchpadDown, //Gamepad touchpad was touched
|
||||||
|
eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved
|
||||||
|
eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted
|
||||||
|
eventGamepadSensorUpdate, //Gamepad sensor was updated
|
||||||
|
eventGamepadUpdateComplete, //Gamepad update is complete
|
||||||
|
eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed
|
||||||
|
eventFingerUp,
|
||||||
|
eventFingerMotion,
|
||||||
|
eventClipboardUpdate, //The clipboard or primary selection changed
|
||||||
|
eventDropFile, //The system requests a file open
|
||||||
|
eventDropText, //text/plain drag-and-drop event
|
||||||
|
eventDropBegin, //A new set of drops is beginning (NULL filename)
|
||||||
|
eventDropComplete, //Current set of drops is now complete (NULL filename)
|
||||||
|
eventDropPosition, //Position while moving over the window
|
||||||
|
eventAudioDeviceAdded, //A new audio device is available
|
||||||
|
eventAudioDeviceRemoved, //An audio device has been removed.
|
||||||
|
eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system.
|
||||||
|
eventSensorUpdate, //A sensor was updated
|
||||||
|
eventPenProximityIn, //Pressure-sensitive pen has become available
|
||||||
|
eventPenProximityOut, //Pressure-sensitive pen has become unavailable
|
||||||
|
eventPenDown, //Pressure-sensitive pen touched drawing surface
|
||||||
|
eventPenUp, //Pressure-sensitive pen stopped touching drawing surface
|
||||||
|
eventPenButtonDown, //Pressure-sensitive pen button pressed
|
||||||
|
eventPenButtonUp, //Pressure-sensitive pen button released
|
||||||
|
eventPenMotion, //Pressure-sensitive pen is moving on the tablet
|
||||||
|
eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed
|
||||||
|
eventCameraDeviceAdded, //A new camera device is available
|
||||||
|
eventCameraDeviceRemoved, //A camera device has been removed.
|
||||||
|
eventCameraDeviceApproved, //A camera device has been approved for use by the user.
|
||||||
|
eventCameraDeviceDenied, //A camera device has been denied for use by the user.
|
||||||
|
eventRenderTargetsReset, //The render targets have been reset and their contents need to be updated
|
||||||
|
eventRenderDeviceReset, //The device has been reset and all textures need to be recreated
|
||||||
|
eventRenderDeviceLost, //The device has been lost and can't be recovered.
|
||||||
|
eventPrivate1,
|
||||||
|
eventPrivate2,
|
||||||
|
eventPrivate3,
|
||||||
|
eventPollSentinel, //Signals the end of an event poll cycle
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const CommonEvent = extern struct {
|
||||||
|
_type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const DisplayEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_DISPLAYEVENT_*
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
displayID: DisplayID, // The associated display
|
||||||
|
data1: i32, // event dependent data
|
||||||
|
data2: i32, // event dependent data
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const WindowEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_WINDOW_*
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The associated window
|
||||||
|
data1: i32, // event dependent data
|
||||||
|
data2: i32, // event dependent data
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const KeyboardDeviceEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: KeyboardID, // The keyboard instance id
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const KeyboardEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with keyboard focus, if any
|
||||||
|
which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual
|
||||||
|
scancode: Scancode, // SDL physical key code
|
||||||
|
key: Keycode, // SDL virtual key code
|
||||||
|
mod: Keymod, // current key modifiers
|
||||||
|
raw: u16, // The platform dependent scancode for this event
|
||||||
|
down: bool, // true if the key is pressed
|
||||||
|
repeat: bool, // true if this is a key repeat
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const TextEditingEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_TEXT_EDITING
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with keyboard focus, if any
|
||||||
|
text: [*c]const u8, // The editing text
|
||||||
|
start: i32, // The start cursor of selected editing text, or -1 if not set
|
||||||
|
length: i32, // The length of selected editing text, or -1 if not set
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const TextEditingCandidatesEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with keyboard focus, if any
|
||||||
|
candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available
|
||||||
|
num_candidates: i32, // The number of strings in `candidates`
|
||||||
|
selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected
|
||||||
|
horizontal: bool, // true if the list is horizontal, false if it's vertical
|
||||||
|
padding1: u8,
|
||||||
|
padding2: u8,
|
||||||
|
padding3: u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const TextInputEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_TEXT_INPUT
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with keyboard focus, if any
|
||||||
|
text: [*c]const u8, // The input text, UTF-8 encoded
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MouseDeviceEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: MouseID, // The mouse instance id
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MouseMotionEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_MOUSE_MOTION
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with mouse focus, if any
|
||||||
|
which: MouseID, // The mouse instance id or SDL_TOUCH_MOUSEID
|
||||||
|
state: MouseButtonFlags, // The current button state
|
||||||
|
x: f32, // X coordinate, relative to window
|
||||||
|
y: f32, // Y coordinate, relative to window
|
||||||
|
xrel: f32, // The relative motion in the X direction
|
||||||
|
yrel: f32, // The relative motion in the Y direction
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MouseButtonEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with mouse focus, if any
|
||||||
|
which: MouseID, // The mouse instance id, SDL_TOUCH_MOUSEID
|
||||||
|
button: u8, // The mouse button index
|
||||||
|
down: bool, // true if the button is pressed
|
||||||
|
clicks: u8, // 1 for single-click, 2 for double-click, etc.
|
||||||
|
padding: u8,
|
||||||
|
x: f32, // X coordinate, relative to window
|
||||||
|
y: f32, // Y coordinate, relative to window
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MouseWheelEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_MOUSE_WHEEL
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with mouse focus, if any
|
||||||
|
which: MouseID, // The mouse instance id, SDL_TOUCH_MOUSEID
|
||||||
|
x: f32, // The amount scrolled horizontally, positive to the right and negative to the left
|
||||||
|
y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user
|
||||||
|
direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back
|
||||||
|
mouse_x: f32, // X coordinate, relative to window
|
||||||
|
mouse_y: f32, // Y coordinate, relative to window
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const JoyAxisEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
axis: u8, // The joystick axis index
|
||||||
|
padding1: u8,
|
||||||
|
padding2: u8,
|
||||||
|
padding3: u8,
|
||||||
|
value: i16, // The axis value (range: -32768 to 32767)
|
||||||
|
padding4: u16,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const JoyBallEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
ball: u8, // The joystick trackball index
|
||||||
|
padding1: u8,
|
||||||
|
padding2: u8,
|
||||||
|
padding3: u8,
|
||||||
|
xrel: i16, // The relative motion in the X direction
|
||||||
|
yrel: i16, // The relative motion in the Y direction
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const JoyHatEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
hat: u8, // The joystick hat index
|
||||||
|
padding1: u8,
|
||||||
|
padding2: u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const JoyButtonEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
button: u8, // The joystick button index
|
||||||
|
down: bool, // true if the button is pressed
|
||||||
|
padding1: u8,
|
||||||
|
padding2: u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const JoyDeviceEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const JoyBatteryEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
state: PowerState, // The joystick battery state
|
||||||
|
percent: c_int, // The joystick battery percent charge remaining
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadAxisEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
axis: u8, // The gamepad axis (SDL_GamepadAxis)
|
||||||
|
padding1: u8,
|
||||||
|
padding2: u8,
|
||||||
|
padding3: u8,
|
||||||
|
value: i16, // The axis value (range: -32768 to 32767)
|
||||||
|
padding4: u16,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadButtonEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
button: u8, // The gamepad button (SDL_GamepadButton)
|
||||||
|
down: bool, // true if the button is pressed
|
||||||
|
padding1: u8,
|
||||||
|
padding2: u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadDeviceEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadTouchpadEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
touchpad: i32, // The index of the touchpad
|
||||||
|
finger: i32, // The index of the finger on the touchpad
|
||||||
|
x: f32, // Normalized in the range 0...1 with 0 being on the left
|
||||||
|
y: f32, // Normalized in the range 0...1 with 0 being at the top
|
||||||
|
pressure: f32, // Normalized in the range 0...1
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadSensorEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
sensor: i32, // The type of the sensor, one of the values of SDL_SensorType
|
||||||
|
data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h
|
||||||
|
sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const AudioDeviceEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing
|
||||||
|
recording: bool, // false if a playback device, true if a recording device.
|
||||||
|
padding1: u8,
|
||||||
|
padding2: u8,
|
||||||
|
padding3: u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const CameraDeviceEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: CameraID, // SDL_CameraID for the device being added or removed or changing
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const TouchFingerEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_FINGER_MOTION or SDL_EVENT_FINGER_DOWN or SDL_EVENT_FINGER_UP
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
touchID: TouchID, // The touch device id
|
||||||
|
fingerID: FingerID,
|
||||||
|
x: f32, // Normalized in the range 0...1
|
||||||
|
y: f32, // Normalized in the range 0...1
|
||||||
|
dx: f32, // Normalized in the range -1...1
|
||||||
|
dy: f32, // Normalized in the range -1...1
|
||||||
|
pressure: f32, // Normalized in the range 0...1
|
||||||
|
windowID: WindowID, // The window underneath the finger, if any
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PenProximityEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with mouse focus, if any
|
||||||
|
which: PenID, // The pen instance id
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PenMotionEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_PEN_MOTION
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with mouse focus, if any
|
||||||
|
which: PenID, // The pen instance id
|
||||||
|
pen_state: PenInputFlags, // Complete pen input state at time of event
|
||||||
|
x: f32, // X coordinate, relative to window
|
||||||
|
y: f32, // Y coordinate, relative to window
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PenTouchEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with pen focus, if any
|
||||||
|
which: PenID, // The pen instance id
|
||||||
|
pen_state: PenInputFlags, // Complete pen input state at time of event
|
||||||
|
x: f32, // X coordinate, relative to window
|
||||||
|
y: f32, // Y coordinate, relative to window
|
||||||
|
eraser: bool, // true if eraser end is used (not all pens support this).
|
||||||
|
down: bool, // true if the pen is touching or false if the pen is lifted off
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PenButtonEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with mouse focus, if any
|
||||||
|
which: PenID, // The pen instance id
|
||||||
|
pen_state: PenInputFlags, // Complete pen input state at time of event
|
||||||
|
x: f32, // X coordinate, relative to window
|
||||||
|
y: f32, // Y coordinate, relative to window
|
||||||
|
button: u8, // The pen button index (first button is 1).
|
||||||
|
down: bool, // true if the button is pressed
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PenAxisEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_PEN_AXIS
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with pen focus, if any
|
||||||
|
which: PenID, // The pen instance id
|
||||||
|
pen_state: PenInputFlags, // Complete pen input state at time of event
|
||||||
|
x: f32, // X coordinate, relative to window
|
||||||
|
y: f32, // Y coordinate, relative to window
|
||||||
|
axis: PenAxis, // Axis that has changed
|
||||||
|
value: f32, // New value of axis
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const DropEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window that was dropped on, if any
|
||||||
|
x: f32, // X coordinate, relative to window (not on begin)
|
||||||
|
y: f32, // Y coordinate, relative to window (not on begin)
|
||||||
|
source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available
|
||||||
|
data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const ClipboardEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
owner: bool, // are we owning the clipboard (internal update)
|
||||||
|
n_mime_types: i32, // number of mime types
|
||||||
|
mime_types: [*c][*c]const u8, // current mime types
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const SensorEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_SENSOR_UPDATE
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: SensorID, // The instance ID of the sensor
|
||||||
|
data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData()
|
||||||
|
sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const QuitEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_QUIT
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const UserEvent = extern struct {
|
||||||
|
_type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The associated window if any
|
||||||
|
code: i32, // User defined event code
|
||||||
|
data1: ?*anyopaque, // User defined data pointer
|
||||||
|
data2: ?*anyopaque, // User defined data pointer
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Event = extern union {
|
||||||
|
_type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration
|
||||||
|
common: CommonEvent, // Common event data
|
||||||
|
display: DisplayEvent, // Display event data
|
||||||
|
window: WindowEvent, // Window event data
|
||||||
|
kdevice: KeyboardDeviceEvent, // Keyboard device change event data
|
||||||
|
key: KeyboardEvent, // Keyboard event data
|
||||||
|
edit: TextEditingEvent, // Text editing event data
|
||||||
|
edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data
|
||||||
|
text: TextInputEvent, // Text input event data
|
||||||
|
mdevice: MouseDeviceEvent, // Mouse device change event data
|
||||||
|
motion: MouseMotionEvent, // Mouse motion event data
|
||||||
|
button: MouseButtonEvent, // Mouse button event data
|
||||||
|
wheel: MouseWheelEvent, // Mouse wheel event data
|
||||||
|
jdevice: JoyDeviceEvent, // Joystick device change event data
|
||||||
|
jaxis: JoyAxisEvent, // Joystick axis event data
|
||||||
|
jball: JoyBallEvent, // Joystick ball event data
|
||||||
|
jhat: JoyHatEvent, // Joystick hat event data
|
||||||
|
jbutton: JoyButtonEvent, // Joystick button event data
|
||||||
|
jbattery: JoyBatteryEvent, // Joystick battery event data
|
||||||
|
gdevice: GamepadDeviceEvent, // Gamepad device event data
|
||||||
|
gaxis: GamepadAxisEvent, // Gamepad axis event data
|
||||||
|
gbutton: GamepadButtonEvent, // Gamepad button event data
|
||||||
|
gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data
|
||||||
|
gsensor: GamepadSensorEvent, // Gamepad sensor event data
|
||||||
|
adevice: AudioDeviceEvent, // Audio device event data
|
||||||
|
cdevice: CameraDeviceEvent, // Camera device event data
|
||||||
|
sensor: SensorEvent, // Sensor event data
|
||||||
|
quit: QuitEvent, // Quit request event data
|
||||||
|
user: UserEvent, // Custom event data
|
||||||
|
tfinger: TouchFingerEvent, // Touch finger event data
|
||||||
|
pproximity: PenProximityEvent, // Pen proximity event data
|
||||||
|
ptouch: PenTouchEvent, // Pen tip touching event data
|
||||||
|
pmotion: PenMotionEvent, // Pen motion event data
|
||||||
|
pbutton: PenButtonEvent, // Pen button event data
|
||||||
|
paxis: PenAxisEvent, // Pen axis event data
|
||||||
|
drop: DropEvent, // Drag and drop event data
|
||||||
|
clipboard: ClipboardEvent, // Clipboard event data
|
||||||
|
padding: [128]u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn pumpEvents() void {
|
||||||
|
return c.SDL_PumpEvents();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const EventAction = enum(c_int) {
|
||||||
|
addevent, //Add events to the back of the queue.
|
||||||
|
peekevent, //Check but don't remove events from the queue front.
|
||||||
|
getevent, //Retrieve/remove events from the front of the queue.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int {
|
||||||
|
return c.SDL_PeepEvents(events, numevents, action, minType, maxType);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hasEvent(_type: u32) bool {
|
||||||
|
return c.SDL_HasEvent(_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hasEvents(minType: u32, maxType: u32) bool {
|
||||||
|
return c.SDL_HasEvents(minType, maxType);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn flushEvent(_type: u32) void {
|
||||||
|
return c.SDL_FlushEvent(_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn flushEvents(minType: u32, maxType: u32) void {
|
||||||
|
return c.SDL_FlushEvents(minType, maxType);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn pollEvent(event: ?*Event) bool {
|
||||||
|
return c.SDL_PollEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn waitEvent(event: ?*Event) bool {
|
||||||
|
return c.SDL_WaitEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool {
|
||||||
|
return c.SDL_WaitEventTimeout(event, timeoutMS);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn pushEvent(event: ?*Event) bool {
|
||||||
|
return c.SDL_PushEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const EventFilter = c.SDL_EventFilter;
|
||||||
|
|
||||||
|
pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void {
|
||||||
|
return c.SDL_SetEventFilter(filter, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool {
|
||||||
|
return c.SDL_GetEventFilter(filter, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool {
|
||||||
|
return c.SDL_AddEventWatch(filter, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void {
|
||||||
|
return c.SDL_RemoveEventWatch(filter, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void {
|
||||||
|
return c.SDL_FilterEvents(filter, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setEventEnabled(_type: u32, enabled: bool) void {
|
||||||
|
return c.SDL_SetEventEnabled(_type, enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn eventEnabled(_type: u32) bool {
|
||||||
|
return c.SDL_EventEnabled(_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn registerEvents(numevents: c_int) u32 {
|
||||||
|
return c.SDL_RegisterEvents(numevents);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowFromEvent(event: *const Event) ?*Window {
|
||||||
|
return c.SDL_GetWindowFromEvent(@ptrCast(event));
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,88 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const Time = i64;
|
||||||
|
|
||||||
|
pub inline fn getBasePath() [*c]const u8 {
|
||||||
|
return c.SDL_GetBasePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getPrefPath(org: [*c]const u8, app: [*c]const u8) [*c]u8 {
|
||||||
|
return c.SDL_GetPrefPath(org, app);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const Folder = enum(c_int) {
|
||||||
|
folderHome, //The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents.
|
||||||
|
folderDesktop, //The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons.
|
||||||
|
folderDocuments, //User document files, possibly application-specific. This is a good place to save a user's projects.
|
||||||
|
folderDownloads, //Standard folder for user files downloaded from the internet.
|
||||||
|
folderMusic, //Music files that can be played using a standard music player (mp3, ogg...).
|
||||||
|
folderPictures, //Image files that can be displayed using a standard viewer (png, jpg...).
|
||||||
|
folderPublicshare, //Files that are meant to be shared with other users on the same computer.
|
||||||
|
folderSavedgames, //Save files for games.
|
||||||
|
folderScreenshots, //Application screenshots.
|
||||||
|
folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file.
|
||||||
|
folderVideos, //Video files that can be played using a standard video player (mp4, webm...).
|
||||||
|
folderCount,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn getUserFolder(folder: Folder) [*c]const u8 {
|
||||||
|
return c.SDL_GetUserFolder(folder);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const PathType = enum(c_int) {
|
||||||
|
pathtypeNone, //path does not exist
|
||||||
|
pathtypeFile, //a normal file
|
||||||
|
pathtypeDirectory, //a directory
|
||||||
|
pathtypeOther,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PathInfo = extern struct {
|
||||||
|
_type: PathType, // the path type
|
||||||
|
size: u64, // the file size in bytes
|
||||||
|
create_time: Time, // the time when the path was created
|
||||||
|
modify_time: Time, // the last time the path was modified
|
||||||
|
access_time: Time, // the last time the path was read
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GlobFlags = packed struct(u32) {
|
||||||
|
globCaseinsensitive: bool = false,
|
||||||
|
pad0: u30 = 0,
|
||||||
|
rsvd: bool = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn createDirectory(path: [*c]const u8) bool {
|
||||||
|
return c.SDL_CreateDirectory(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const EnumerationResult = enum(c_int) {
|
||||||
|
enumContinue, //Value that requests that enumeration continue.
|
||||||
|
enumSuccess, //Value that requests that enumeration stop, successfully.
|
||||||
|
enumFailure,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback;
|
||||||
|
|
||||||
|
pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool {
|
||||||
|
return c.SDL_EnumerateDirectory(path, callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn removePath(path: [*c]const u8) bool {
|
||||||
|
return c.SDL_RemovePath(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool {
|
||||||
|
return c.SDL_RenamePath(oldpath, newpath);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool {
|
||||||
|
return c.SDL_CopyFile(oldpath, newpath);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool {
|
||||||
|
return c.SDL_GetPathInfo(path, info);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 {
|
||||||
|
return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count));
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,408 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const JoystickConnectionState = enum(c_int) {
|
||||||
|
joystickConnectionUnknown,
|
||||||
|
joystickConnectionWired,
|
||||||
|
joystickConnectionWireless,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GUID = extern struct {
|
||||||
|
data: [16]u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PropertiesID = u32;
|
||||||
|
|
||||||
|
pub const IOStream = opaque {
|
||||||
|
pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int {
|
||||||
|
return c.SDL_AddGamepadMappingsFromIO(iostream, closeio);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const JoystickID = u32;
|
||||||
|
|
||||||
|
pub const SensorType = enum(c_int) {
|
||||||
|
sensorInvalid, //Returned for an invalid sensor
|
||||||
|
sensorUnknown, //Unknown sensor type
|
||||||
|
sensorAccel, //Accelerometer
|
||||||
|
sensorGyro, //Gyroscope
|
||||||
|
sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk
|
||||||
|
sensorGyroL, //Gyroscope for left Joy-Con controller
|
||||||
|
sensorAccelR, //Accelerometer for right Joy-Con controller
|
||||||
|
sensorGyroR, //Gyroscope for right Joy-Con controller
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PowerState = enum(c_int) {
|
||||||
|
powerstateError, //error determining power status
|
||||||
|
powerstateUnknown, //cannot determine power status
|
||||||
|
powerstateOnBattery, //Not plugged in, running on the battery
|
||||||
|
powerstateNoBattery, //Plugged in, no battery available
|
||||||
|
powerstateCharging, //Plugged in, charging battery
|
||||||
|
powerstateCharged,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Joystick = opaque {};
|
||||||
|
|
||||||
|
pub const Gamepad = opaque {
|
||||||
|
pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 {
|
||||||
|
return c.SDL_GetGamepadMapping(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID {
|
||||||
|
return c.SDL_GetGamepadProperties(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID {
|
||||||
|
return c.SDL_GetGamepadID(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 {
|
||||||
|
return c.SDL_GetGamepadName(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 {
|
||||||
|
return c.SDL_GetGamepadPath(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType {
|
||||||
|
return @intFromEnum(c.SDL_GetGamepadType(gamepad));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType {
|
||||||
|
return @intFromEnum(c.SDL_GetRealGamepadType(gamepad));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int {
|
||||||
|
return c.SDL_GetGamepadPlayerIndex(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool {
|
||||||
|
return c.SDL_SetGamepadPlayerIndex(gamepad, player_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 {
|
||||||
|
return c.SDL_GetGamepadVendor(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 {
|
||||||
|
return c.SDL_GetGamepadProduct(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 {
|
||||||
|
return c.SDL_GetGamepadProductVersion(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 {
|
||||||
|
return c.SDL_GetGamepadFirmwareVersion(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 {
|
||||||
|
return c.SDL_GetGamepadSerial(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 {
|
||||||
|
return c.SDL_GetGamepadSteamHandle(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState {
|
||||||
|
return c.SDL_GetGamepadConnectionState(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState {
|
||||||
|
return c.SDL_GetGamepadPowerInfo(gamepad, @ptrCast(percent));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gamepadConnected(gamepad: *Gamepad) bool {
|
||||||
|
return c.SDL_GamepadConnected(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick {
|
||||||
|
return c.SDL_GetGamepadJoystick(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c][*c]GamepadBinding {
|
||||||
|
return c.SDL_GetGamepadBindings(gamepad, @ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool {
|
||||||
|
return c.SDL_GamepadHasAxis(gamepad, axis);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 {
|
||||||
|
return c.SDL_GetGamepadAxis(gamepad, axis);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool {
|
||||||
|
return c.SDL_GamepadHasButton(gamepad, button);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool {
|
||||||
|
return c.SDL_GetGamepadButton(gamepad, button);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel {
|
||||||
|
return c.SDL_GetGamepadButtonLabel(gamepad, button);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int {
|
||||||
|
return c.SDL_GetNumGamepadTouchpads(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int {
|
||||||
|
return c.SDL_GetNumGamepadTouchpadFingers(gamepad, touchpad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool {
|
||||||
|
return c.SDL_GetGamepadTouchpadFinger(gamepad, touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool {
|
||||||
|
return c.SDL_GamepadHasSensor(gamepad, @intFromEnum(_type));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool {
|
||||||
|
return c.SDL_SetGamepadSensorEnabled(gamepad, @intFromEnum(_type), enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool {
|
||||||
|
return c.SDL_GamepadSensorEnabled(gamepad, @intFromEnum(_type));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 {
|
||||||
|
return c.SDL_GetGamepadSensorDataRate(gamepad, @intFromEnum(_type));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool {
|
||||||
|
return c.SDL_GetGamepadSensorData(gamepad, @intFromEnum(_type), @ptrCast(data), num_values);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool {
|
||||||
|
return c.SDL_RumbleGamepad(gamepad, low_frequency_rumble, high_frequency_rumble, duration_ms);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool {
|
||||||
|
return c.SDL_RumbleGamepadTriggers(gamepad, left_rumble, right_rumble, duration_ms);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool {
|
||||||
|
return c.SDL_SetGamepadLED(gamepad, red, green, blue);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool {
|
||||||
|
return c.SDL_SendGamepadEffect(gamepad, data, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn closeGamepad(gamepad: *Gamepad) void {
|
||||||
|
return c.SDL_CloseGamepad(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 {
|
||||||
|
return c.SDL_GetGamepadAppleSFSymbolsNameForButton(gamepad, button);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 {
|
||||||
|
return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(gamepad, axis);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadType = enum(c_int) {
|
||||||
|
gamepadTypeStandard,
|
||||||
|
gamepadTypeXbox360,
|
||||||
|
gamepadTypeXboxone,
|
||||||
|
gamepadTypePs3,
|
||||||
|
gamepadTypePs4,
|
||||||
|
gamepadTypePs5,
|
||||||
|
gamepadTypeNintendoSwitchPro,
|
||||||
|
gamepadTypeNintendoSwitchJoyconLeft,
|
||||||
|
gamepadTypeNintendoSwitchJoyconRight,
|
||||||
|
gamepadTypeNintendoSwitchJoyconPair,
|
||||||
|
gamepadTypeCount,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadButton = enum(c_int) {
|
||||||
|
gamepadButtonSouth, //Bottom face button (e.g. Xbox A button)
|
||||||
|
gamepadButtonEast, //Right face button (e.g. Xbox B button)
|
||||||
|
gamepadButtonWest, //Left face button (e.g. Xbox X button)
|
||||||
|
gamepadButtonNorth, //Top face button (e.g. Xbox Y button)
|
||||||
|
gamepadButtonBack,
|
||||||
|
gamepadButtonGuide,
|
||||||
|
gamepadButtonStart,
|
||||||
|
gamepadButtonLeftStick,
|
||||||
|
gamepadButtonRightStick,
|
||||||
|
gamepadButtonLeftShoulder,
|
||||||
|
gamepadButtonRightShoulder,
|
||||||
|
gamepadButtonDpadUp,
|
||||||
|
gamepadButtonDpadDown,
|
||||||
|
gamepadButtonDpadLeft,
|
||||||
|
gamepadButtonDpadRight,
|
||||||
|
gamepadButtonMisc1, //Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button)
|
||||||
|
gamepadButtonRightPaddle1, //Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1)
|
||||||
|
gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3)
|
||||||
|
gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2)
|
||||||
|
gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4)
|
||||||
|
gamepadButtonTouchpad, //PS4/PS5 touchpad button
|
||||||
|
gamepadButtonMisc2, //Additional button
|
||||||
|
gamepadButtonMisc3, //Additional button
|
||||||
|
gamepadButtonMisc4, //Additional button
|
||||||
|
gamepadButtonMisc5, //Additional button
|
||||||
|
gamepadButtonMisc6, //Additional button
|
||||||
|
gamepadButtonCount,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadButtonLabel = enum(c_int) {
|
||||||
|
gamepadButtonLabelUnknown,
|
||||||
|
gamepadButtonLabelA,
|
||||||
|
gamepadButtonLabelB,
|
||||||
|
gamepadButtonLabelX,
|
||||||
|
gamepadButtonLabelY,
|
||||||
|
gamepadButtonLabelCross,
|
||||||
|
gamepadButtonLabelCircle,
|
||||||
|
gamepadButtonLabelSquare,
|
||||||
|
gamepadButtonLabelTriangle,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadAxis = enum(c_int) {
|
||||||
|
gamepadAxisLeftx,
|
||||||
|
gamepadAxisLefty,
|
||||||
|
gamepadAxisRightx,
|
||||||
|
gamepadAxisRighty,
|
||||||
|
gamepadAxisLeftTrigger,
|
||||||
|
gamepadAxisRightTrigger,
|
||||||
|
gamepadAxisCount,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadBindingType = enum(c_int) {
|
||||||
|
gamepadBindtypeButton,
|
||||||
|
gamepadBindtypeAxis,
|
||||||
|
gamepadBindtypeHat,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadBinding = opaque {};
|
||||||
|
|
||||||
|
pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int {
|
||||||
|
return c.SDL_AddGamepadMapping(mapping);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int {
|
||||||
|
return c.SDL_AddGamepadMappingsFromFile(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn reloadGamepadMappings() bool {
|
||||||
|
return c.SDL_ReloadGamepadMappings();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 {
|
||||||
|
return c.SDL_GetGamepadMappings(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 {
|
||||||
|
return c.SDL_GetGamepadMappingForGUID(guid);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool {
|
||||||
|
return c.SDL_SetGamepadMapping(instance_id, mapping);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hasGamepad() bool {
|
||||||
|
return c.SDL_HasGamepad();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepads(count: *c_int) ?*JoystickID {
|
||||||
|
return c.SDL_GetGamepads(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn isGamepad(instance_id: JoystickID) bool {
|
||||||
|
return c.SDL_IsGamepad(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 {
|
||||||
|
return c.SDL_GetGamepadNameForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadPathForID(instance_id: JoystickID) [*c]const u8 {
|
||||||
|
return c.SDL_GetGamepadPathForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int {
|
||||||
|
return c.SDL_GetGamepadPlayerIndexForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID {
|
||||||
|
return c.SDL_GetGamepadGUIDForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 {
|
||||||
|
return c.SDL_GetGamepadVendorForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadProductForID(instance_id: JoystickID) u16 {
|
||||||
|
return c.SDL_GetGamepadProductForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 {
|
||||||
|
return c.SDL_GetGamepadProductVersionForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType {
|
||||||
|
return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType {
|
||||||
|
return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 {
|
||||||
|
return c.SDL_GetGamepadMappingForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad {
|
||||||
|
return c.SDL_OpenGamepad(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad {
|
||||||
|
return c.SDL_GetGamepadFromID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad {
|
||||||
|
return c.SDL_GetGamepadFromPlayerIndex(player_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setGamepadEventsEnabled(enabled: bool) void {
|
||||||
|
return c.SDL_SetGamepadEventsEnabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gamepadEventsEnabled() bool {
|
||||||
|
return c.SDL_GamepadEventsEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn updateGamepads() void {
|
||||||
|
return c.SDL_UpdateGamepads();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType {
|
||||||
|
return @intFromEnum(c.SDL_GetGamepadTypeFromString(str));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 {
|
||||||
|
return c.SDL_GetGamepadStringForType(@intFromEnum(_type));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis {
|
||||||
|
return c.SDL_GetGamepadAxisFromString(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 {
|
||||||
|
return c.SDL_GetGamepadStringForAxis(axis);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton {
|
||||||
|
return c.SDL_GetGamepadButtonFromString(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 {
|
||||||
|
return c.SDL_GetGamepadStringForButton(button);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel {
|
||||||
|
return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button);
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,230 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const Joystick = opaque {
|
||||||
|
pub inline fn isJoystickHaptic(joystick: *Joystick) bool {
|
||||||
|
return c.SDL_IsJoystickHaptic(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic {
|
||||||
|
return c.SDL_OpenHapticFromJoystick(joystick);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Haptic = opaque {
|
||||||
|
pub inline fn getHapticID(haptic: *Haptic) HapticID {
|
||||||
|
return c.SDL_GetHapticID(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 {
|
||||||
|
return c.SDL_GetHapticName(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn closeHaptic(haptic: *Haptic) void {
|
||||||
|
return c.SDL_CloseHaptic(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int {
|
||||||
|
return c.SDL_GetMaxHapticEffects(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int {
|
||||||
|
return c.SDL_GetMaxHapticEffectsPlaying(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getHapticFeatures(haptic: *Haptic) u32 {
|
||||||
|
return c.SDL_GetHapticFeatures(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getNumHapticAxes(haptic: *Haptic) c_int {
|
||||||
|
return c.SDL_GetNumHapticAxes(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hapticEffectSupported(haptic: *Haptic, effect: *const HapticEffect) bool {
|
||||||
|
return c.SDL_HapticEffectSupported(haptic, @ptrCast(effect));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn createHapticEffect(haptic: *Haptic, effect: *const HapticEffect) c_int {
|
||||||
|
return c.SDL_CreateHapticEffect(haptic, @ptrCast(effect));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: *const HapticEffect) bool {
|
||||||
|
return c.SDL_UpdateHapticEffect(haptic, effect, @ptrCast(data));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool {
|
||||||
|
return c.SDL_RunHapticEffect(haptic, effect, iterations);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool {
|
||||||
|
return c.SDL_StopHapticEffect(haptic, effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void {
|
||||||
|
return c.SDL_DestroyHapticEffect(haptic, effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool {
|
||||||
|
return c.SDL_GetHapticEffectStatus(haptic, effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool {
|
||||||
|
return c.SDL_SetHapticGain(haptic, gain);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool {
|
||||||
|
return c.SDL_SetHapticAutocenter(haptic, autocenter);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn pauseHaptic(haptic: *Haptic) bool {
|
||||||
|
return c.SDL_PauseHaptic(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn resumeHaptic(haptic: *Haptic) bool {
|
||||||
|
return c.SDL_ResumeHaptic(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn stopHapticEffects(haptic: *Haptic) bool {
|
||||||
|
return c.SDL_StopHapticEffects(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hapticRumbleSupported(haptic: *Haptic) bool {
|
||||||
|
return c.SDL_HapticRumbleSupported(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn initHapticRumble(haptic: *Haptic) bool {
|
||||||
|
return c.SDL_InitHapticRumble(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool {
|
||||||
|
return c.SDL_PlayHapticRumble(haptic, strength, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn stopHapticRumble(haptic: *Haptic) bool {
|
||||||
|
return c.SDL_StopHapticRumble(haptic);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const HapticDirection = extern struct {
|
||||||
|
_type: u8, // The type of encoding.
|
||||||
|
dir: [3]i32, // The encoded direction.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const HapticConstant = extern struct {
|
||||||
|
_type: u16, // SDL_HAPTIC_CONSTANT
|
||||||
|
direction: HapticDirection, // Direction of the effect.
|
||||||
|
length: u32, // Duration of the effect.
|
||||||
|
delay: u16, // Delay before starting the effect.
|
||||||
|
button: u16, // Button that triggers the effect.
|
||||||
|
interval: u16, // How soon it can be triggered again after button.
|
||||||
|
level: i16, // Strength of the constant effect.
|
||||||
|
attack_length: u16, // Duration of the attack.
|
||||||
|
attack_level: u16, // Level at the start of the attack.
|
||||||
|
fade_length: u16, // Duration of the fade.
|
||||||
|
fade_level: u16, // Level at the end of the fade.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const HapticPeriodic = extern struct {
|
||||||
|
direction: HapticDirection, // Direction of the effect.
|
||||||
|
length: u32, // Duration of the effect.
|
||||||
|
delay: u16, // Delay before starting the effect.
|
||||||
|
button: u16, // Button that triggers the effect.
|
||||||
|
interval: u16, // How soon it can be triggered again after button.
|
||||||
|
period: u16, // Period of the wave.
|
||||||
|
magnitude: i16, // Peak value; if negative, equivalent to 180 degrees extra phase shift.
|
||||||
|
offset: i16, // Mean value of the wave.
|
||||||
|
phase: u16, // Positive phase shift given by hundredth of a degree.
|
||||||
|
attack_length: u16, // Duration of the attack.
|
||||||
|
attack_level: u16, // Level at the start of the attack.
|
||||||
|
fade_length: u16, // Duration of the fade.
|
||||||
|
fade_level: u16, // Level at the end of the fade.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const HapticCondition = extern struct {
|
||||||
|
direction: HapticDirection, // Direction of the effect - Not used ATM.
|
||||||
|
length: u32, // Duration of the effect.
|
||||||
|
delay: u16, // Delay before starting the effect.
|
||||||
|
button: u16, // Button that triggers the effect.
|
||||||
|
interval: u16, // How soon it can be triggered again after button.
|
||||||
|
right_sat: [3]u16, // Level when joystick is to the positive side; max 0xFFFF.
|
||||||
|
left_sat: [3]u16, // Level when joystick is to the negative side; max 0xFFFF.
|
||||||
|
right_coeff: [3]i16, // How fast to increase the force towards the positive side.
|
||||||
|
left_coeff: [3]i16, // How fast to increase the force towards the negative side.
|
||||||
|
deadband: [3]u16, // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered.
|
||||||
|
center: [3]i16, // Position of the dead zone.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const HapticRamp = extern struct {
|
||||||
|
_type: u16, // SDL_HAPTIC_RAMP
|
||||||
|
direction: HapticDirection, // Direction of the effect.
|
||||||
|
length: u32, // Duration of the effect.
|
||||||
|
delay: u16, // Delay before starting the effect.
|
||||||
|
button: u16, // Button that triggers the effect.
|
||||||
|
interval: u16, // How soon it can be triggered again after button.
|
||||||
|
start: i16, // Beginning strength level.
|
||||||
|
end: i16, // Ending strength level.
|
||||||
|
attack_length: u16, // Duration of the attack.
|
||||||
|
attack_level: u16, // Level at the start of the attack.
|
||||||
|
fade_length: u16, // Duration of the fade.
|
||||||
|
fade_level: u16, // Level at the end of the fade.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const HapticLeftRight = extern struct {
|
||||||
|
_type: u16, // SDL_HAPTIC_LEFTRIGHT
|
||||||
|
length: u32, // Duration of the effect in milliseconds.
|
||||||
|
large_magnitude: u16, // Control of the large controller motor.
|
||||||
|
small_magnitude: u16, // Control of the small controller motor.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const HapticCustom = extern struct {
|
||||||
|
_type: u16, // SDL_HAPTIC_CUSTOM
|
||||||
|
direction: HapticDirection, // Direction of the effect.
|
||||||
|
length: u32, // Duration of the effect.
|
||||||
|
delay: u16, // Delay before starting the effect.
|
||||||
|
button: u16, // Button that triggers the effect.
|
||||||
|
interval: u16, // How soon it can be triggered again after button.
|
||||||
|
channels: u8, // Axes to use, minimum of one.
|
||||||
|
period: u16, // Sample periods.
|
||||||
|
samples: u16, // Amount of samples.
|
||||||
|
data: *u16, // Should contain channels*samples items.
|
||||||
|
attack_length: u16, // Duration of the attack.
|
||||||
|
attack_level: u16, // Level at the start of the attack.
|
||||||
|
fade_length: u16, // Duration of the fade.
|
||||||
|
fade_level: u16, // Level at the end of the fade.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const HapticEffect = extern union {
|
||||||
|
_type: u16, // Effect type.
|
||||||
|
constant: HapticConstant, // Constant effect.
|
||||||
|
periodic: HapticPeriodic, // Periodic effect.
|
||||||
|
condition: HapticCondition, // Condition effect.
|
||||||
|
ramp: HapticRamp, // Ramp effect.
|
||||||
|
leftright: HapticLeftRight, // Left/Right effect.
|
||||||
|
custom: HapticCustom, // Custom effect.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const HapticID = u32;
|
||||||
|
|
||||||
|
pub inline fn getHaptics(count: *c_int) ?*HapticID {
|
||||||
|
return c.SDL_GetHaptics(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 {
|
||||||
|
return c.SDL_GetHapticNameForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openHaptic(instance_id: HapticID) ?*Haptic {
|
||||||
|
return c.SDL_OpenHaptic(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic {
|
||||||
|
return c.SDL_GetHapticFromID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn isMouseHaptic() bool {
|
||||||
|
return c.SDL_IsMouseHaptic();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openHapticFromMouse() ?*Haptic {
|
||||||
|
return c.SDL_OpenHapticFromMouse();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const HintPriority = enum(c_int) {
|
||||||
|
hintDefault,
|
||||||
|
hintNormal,
|
||||||
|
hintOverride,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool {
|
||||||
|
return c.SDL_SetHintWithPriority(name, value, priority);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool {
|
||||||
|
return c.SDL_SetHint(name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn resetHint(name: [*c]const u8) bool {
|
||||||
|
return c.SDL_ResetHint(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn resetHints() void {
|
||||||
|
return c.SDL_ResetHints();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getHint(name: [*c]const u8) [*c]const u8 {
|
||||||
|
return c.SDL_GetHint(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool {
|
||||||
|
return c.SDL_GetHintBoolean(name, default_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const HintCallback = c.SDL_HintCallback;
|
||||||
|
|
||||||
|
pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool {
|
||||||
|
return c.SDL_AddHintCallback(name, callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void {
|
||||||
|
return c.SDL_RemoveHintCallback(name, callback, userdata);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const InitFlags = packed struct(u32) {
|
||||||
|
initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`
|
||||||
|
initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`
|
||||||
|
initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD
|
||||||
|
initHaptic: bool = false,
|
||||||
|
initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`
|
||||||
|
initEvents: bool = false,
|
||||||
|
initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`
|
||||||
|
initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`
|
||||||
|
pad0: u23 = 0,
|
||||||
|
rsvd: bool = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const AppResult = enum(c_int) {
|
||||||
|
appContinue, //Value that requests that the app continue from the main callbacks.
|
||||||
|
appSuccess, //Value that requests termination with success from the main callbacks.
|
||||||
|
appFailure, //Value that requests termination with error from the main callbacks.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const AppInit_func = c.SDL_AppInit_func;
|
||||||
|
|
||||||
|
pub const AppIterate_func = c.SDL_AppIterate_func;
|
||||||
|
|
||||||
|
pub const AppEvent_func = c.SDL_AppEvent_func;
|
||||||
|
|
||||||
|
pub const AppQuit_func = c.SDL_AppQuit_func;
|
||||||
|
|
||||||
|
pub inline fn init(flags: InitFlags) bool {
|
||||||
|
return c.SDL_Init(@bitCast(flags));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn initSubSystem(flags: InitFlags) bool {
|
||||||
|
return c.SDL_InitSubSystem(@bitCast(flags));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn quitSubSystem(flags: InitFlags) void {
|
||||||
|
return c.SDL_QuitSubSystem(@bitCast(flags));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn wasInit(flags: InitFlags) InitFlags {
|
||||||
|
return @bitCast(c.SDL_WasInit(@bitCast(flags)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn quit() void {
|
||||||
|
return c.SDL_Quit();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool {
|
||||||
|
return c.SDL_SetAppMetadata(appname, appversion, appidentifier);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool {
|
||||||
|
return c.SDL_SetAppMetadataProperty(name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 {
|
||||||
|
return c.SDL_GetAppMetadataProperty(name);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,321 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const PropertiesID = u32;
|
||||||
|
|
||||||
|
pub const SensorType = enum(c_int) {
|
||||||
|
sensorInvalid, //Returned for an invalid sensor
|
||||||
|
sensorUnknown, //Unknown sensor type
|
||||||
|
sensorAccel, //Accelerometer
|
||||||
|
sensorGyro, //Gyroscope
|
||||||
|
sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk
|
||||||
|
sensorGyroL, //Gyroscope for left Joy-Con controller
|
||||||
|
sensorAccelR, //Accelerometer for right Joy-Con controller
|
||||||
|
sensorGyroR, //Gyroscope for right Joy-Con controller
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GUID = extern struct {
|
||||||
|
data: [16]u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PowerState = enum(c_int) {
|
||||||
|
powerstateError, //error determining power status
|
||||||
|
powerstateUnknown, //cannot determine power status
|
||||||
|
powerstateOnBattery, //Not plugged in, running on the battery
|
||||||
|
powerstateNoBattery, //Plugged in, no battery available
|
||||||
|
powerstateCharging, //Plugged in, charging battery
|
||||||
|
powerstateCharged,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Joystick = opaque {
|
||||||
|
pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool {
|
||||||
|
return c.SDL_SetJoystickVirtualAxis(joystick, axis, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool {
|
||||||
|
return c.SDL_SetJoystickVirtualBall(joystick, ball, xrel, yrel);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool {
|
||||||
|
return c.SDL_SetJoystickVirtualButton(joystick, button, down);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool {
|
||||||
|
return c.SDL_SetJoystickVirtualHat(joystick, hat, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool {
|
||||||
|
return c.SDL_SetJoystickVirtualTouchpad(joystick, touchpad, finger, down, x, y, pressure);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool {
|
||||||
|
return c.SDL_SendJoystickVirtualSensorData(joystick, @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID {
|
||||||
|
return c.SDL_GetJoystickProperties(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 {
|
||||||
|
return c.SDL_GetJoystickName(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 {
|
||||||
|
return c.SDL_GetJoystickPath(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int {
|
||||||
|
return c.SDL_GetJoystickPlayerIndex(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool {
|
||||||
|
return c.SDL_SetJoystickPlayerIndex(joystick, player_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickGUID(joystick: *Joystick) GUID {
|
||||||
|
return c.SDL_GetJoystickGUID(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickVendor(joystick: *Joystick) u16 {
|
||||||
|
return c.SDL_GetJoystickVendor(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickProduct(joystick: *Joystick) u16 {
|
||||||
|
return c.SDL_GetJoystickProduct(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 {
|
||||||
|
return c.SDL_GetJoystickProductVersion(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 {
|
||||||
|
return c.SDL_GetJoystickFirmwareVersion(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 {
|
||||||
|
return c.SDL_GetJoystickSerial(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickType(joystick: *Joystick) JoystickType {
|
||||||
|
return @intFromEnum(c.SDL_GetJoystickType(joystick));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn joystickConnected(joystick: *Joystick) bool {
|
||||||
|
return c.SDL_JoystickConnected(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickID(joystick: *Joystick) JoystickID {
|
||||||
|
return c.SDL_GetJoystickID(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int {
|
||||||
|
return c.SDL_GetNumJoystickAxes(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int {
|
||||||
|
return c.SDL_GetNumJoystickBalls(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getNumJoystickHats(joystick: *Joystick) c_int {
|
||||||
|
return c.SDL_GetNumJoystickHats(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int {
|
||||||
|
return c.SDL_GetNumJoystickButtons(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 {
|
||||||
|
return c.SDL_GetJoystickAxis(joystick, axis);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool {
|
||||||
|
return c.SDL_GetJoystickAxisInitialState(joystick, axis, @ptrCast(state));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool {
|
||||||
|
return c.SDL_GetJoystickBall(joystick, ball, @ptrCast(dx), @ptrCast(dy));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 {
|
||||||
|
return c.SDL_GetJoystickHat(joystick, hat);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool {
|
||||||
|
return c.SDL_GetJoystickButton(joystick, button);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool {
|
||||||
|
return c.SDL_RumbleJoystick(joystick, low_frequency_rumble, high_frequency_rumble, duration_ms);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool {
|
||||||
|
return c.SDL_RumbleJoystickTriggers(joystick, left_rumble, right_rumble, duration_ms);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool {
|
||||||
|
return c.SDL_SetJoystickLED(joystick, red, green, blue);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool {
|
||||||
|
return c.SDL_SendJoystickEffect(joystick, data, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn closeJoystick(joystick: *Joystick) void {
|
||||||
|
return c.SDL_CloseJoystick(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState {
|
||||||
|
return c.SDL_GetJoystickConnectionState(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState {
|
||||||
|
return c.SDL_GetJoystickPowerInfo(joystick, @ptrCast(percent));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const JoystickID = u32;
|
||||||
|
|
||||||
|
pub const JoystickType = enum(c_int) {
|
||||||
|
joystickTypeUnknown,
|
||||||
|
joystickTypeGamepad,
|
||||||
|
joystickTypeWheel,
|
||||||
|
joystickTypeArcadeStick,
|
||||||
|
joystickTypeFlightStick,
|
||||||
|
joystickTypeDancePad,
|
||||||
|
joystickTypeGuitar,
|
||||||
|
joystickTypeDrumKit,
|
||||||
|
joystickTypeArcadePad,
|
||||||
|
joystickTypeThrottle,
|
||||||
|
joystickTypeCount,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const JoystickConnectionState = enum(c_int) {
|
||||||
|
joystickConnectionUnknown,
|
||||||
|
joystickConnectionWired,
|
||||||
|
joystickConnectionWireless,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn lockJoysticks() void {
|
||||||
|
return c.SDL_LockJoysticks();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn unlockJoysticks() void {
|
||||||
|
return c.SDL_UnlockJoysticks();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hasJoystick() bool {
|
||||||
|
return c.SDL_HasJoystick();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoysticks(count: *c_int) ?*JoystickID {
|
||||||
|
return c.SDL_GetJoysticks(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 {
|
||||||
|
return c.SDL_GetJoystickNameForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickPathForID(instance_id: JoystickID) [*c]const u8 {
|
||||||
|
return c.SDL_GetJoystickPathForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int {
|
||||||
|
return c.SDL_GetJoystickPlayerIndexForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID {
|
||||||
|
return c.SDL_GetJoystickGUIDForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 {
|
||||||
|
return c.SDL_GetJoystickVendorForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickProductForID(instance_id: JoystickID) u16 {
|
||||||
|
return c.SDL_GetJoystickProductForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 {
|
||||||
|
return c.SDL_GetJoystickProductVersionForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType {
|
||||||
|
return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick {
|
||||||
|
return c.SDL_OpenJoystick(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick {
|
||||||
|
return c.SDL_GetJoystickFromID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick {
|
||||||
|
return c.SDL_GetJoystickFromPlayerIndex(player_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const VirtualJoystickTouchpadDesc = extern struct {
|
||||||
|
nfingers: u16, // the number of simultaneous fingers on this touchpad
|
||||||
|
padding: [3]u16,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const VirtualJoystickSensorDesc = extern struct {
|
||||||
|
_type: SensorType, // the type of this sensor
|
||||||
|
rate: f32, // the update frequency of this sensor, may be 0.0f
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const VirtualJoystickDesc = extern struct {
|
||||||
|
version: u32, // the version of this interface
|
||||||
|
_type: u16, // `SDL_JoystickType`
|
||||||
|
padding: u16, // unused
|
||||||
|
vendor_id: u16, // the USB vendor ID of this joystick
|
||||||
|
product_id: u16, // the USB product ID of this joystick
|
||||||
|
naxes: u16, // the number of axes on this joystick
|
||||||
|
nbuttons: u16, // the number of buttons on this joystick
|
||||||
|
nballs: u16, // the number of balls on this joystick
|
||||||
|
nhats: u16, // the number of hats on this joystick
|
||||||
|
ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions
|
||||||
|
nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions
|
||||||
|
padding2: [2]u16, // unused
|
||||||
|
name: [*c]const u8, // the name of the joystick
|
||||||
|
touchpads: *const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0
|
||||||
|
sensors: *const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0
|
||||||
|
userdata: ?*anyopaque, // User data pointer passed to callbacks
|
||||||
|
Update: ?*const anyopaque, // Called when the joystick state should be updated
|
||||||
|
SetPlayerIndex: ?*const anyopaque, // Called when the player index is set
|
||||||
|
Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick()
|
||||||
|
RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers()
|
||||||
|
SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED()
|
||||||
|
SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect()
|
||||||
|
SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled()
|
||||||
|
Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn attachVirtualJoystick(desc: *const VirtualJoystickDesc) JoystickID {
|
||||||
|
return c.SDL_AttachVirtualJoystick(@ptrCast(desc));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool {
|
||||||
|
return c.SDL_DetachVirtualJoystick(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn isJoystickVirtual(instance_id: JoystickID) bool {
|
||||||
|
return c.SDL_IsJoystickVirtual(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void {
|
||||||
|
return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setJoystickEventsEnabled(enabled: bool) void {
|
||||||
|
return c.SDL_SetJoystickEventsEnabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn joystickEventsEnabled() bool {
|
||||||
|
return c.SDL_JoystickEventsEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn updateJoysticks() void {
|
||||||
|
return c.SDL_UpdateJoysticks();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const Keycode = u32;
|
||||||
|
|
||||||
|
pub const Keymod = u16;
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const FunctionPointer = c.SDL_FunctionPointer;
|
||||||
|
|
||||||
|
pub const SharedObject = opaque {
|
||||||
|
pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer {
|
||||||
|
return c.SDL_LoadFunction(sharedobject, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn unloadObject(sharedobject: *SharedObject) void {
|
||||||
|
return c.SDL_UnloadObject(sharedobject);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject {
|
||||||
|
return c.SDL_LoadObject(sofile);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const Window = opaque {};
|
||||||
|
|
||||||
|
pub const MessageBoxFlags = packed struct(u32) {
|
||||||
|
messageboxError: bool = false, // error dialog
|
||||||
|
messageboxWarning: bool = false, // warning dialog
|
||||||
|
messageboxInformation: bool = false, // informational dialog
|
||||||
|
messageboxButtonsLeftToRight: bool = false, // buttons placed left to right
|
||||||
|
messageboxButtonsRightToLeft: bool = false, // buttons placed right to left
|
||||||
|
pad0: u26 = 0,
|
||||||
|
rsvd: bool = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MessageBoxButtonFlags = packed struct(u32) {
|
||||||
|
messageboxButtonReturnkeyDefault: bool = false, // Marks the default button when return is hit
|
||||||
|
messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit
|
||||||
|
pad0: u29 = 0,
|
||||||
|
rsvd: bool = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MessageBoxButtonData = extern struct {
|
||||||
|
flags: MessageBoxButtonFlags,
|
||||||
|
buttonID: c_int, // User defined button id (value returned via SDL_ShowMessageBox)
|
||||||
|
text: [*c]const u8, // The UTF-8 button text
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MessageBoxColor = extern struct {
|
||||||
|
r: u8,
|
||||||
|
g: u8,
|
||||||
|
b: u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MessageBoxColorType = enum(c_int) {
|
||||||
|
messageboxColorBackground,
|
||||||
|
messageboxColorText,
|
||||||
|
messageboxColorButtonBorder,
|
||||||
|
messageboxColorButtonBackground,
|
||||||
|
messageboxColorButtonSelected,
|
||||||
|
messageboxColorCount, //Size of the colors array of SDL_MessageBoxColorScheme.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MessageBoxColorScheme = extern struct {
|
||||||
|
colors: [c.SDL_MESSAGEBOX_COLOR_COUNT]MessageBoxColor,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MessageBoxData = extern struct {
|
||||||
|
flags: MessageBoxFlags,
|
||||||
|
window: ?*Window, // Parent window, can be NULL
|
||||||
|
title: [*c]const u8, // UTF-8 title
|
||||||
|
message: [*c]const u8, // UTF-8 message text
|
||||||
|
numbuttons: c_int,
|
||||||
|
buttons: *const MessageBoxButtonData,
|
||||||
|
colorScheme: *const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn showMessageBox(messageboxdata: *const MessageBoxData, buttonid: *c_int) bool {
|
||||||
|
return c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool {
|
||||||
|
return c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, window);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub inline fn openURL(url: [*c]const u8) bool {
|
||||||
|
return c.SDL_OpenURL(url);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,135 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const Window = opaque {
|
||||||
|
pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void {
|
||||||
|
return c.SDL_WarpMouseInWindow(window, x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool {
|
||||||
|
return c.SDL_SetWindowRelativeMouseMode(window, enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowRelativeMouseMode(window: *Window) bool {
|
||||||
|
return c.SDL_GetWindowRelativeMouseMode(window);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Surface = opaque {
|
||||||
|
pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor {
|
||||||
|
return c.SDL_CreateColorCursor(surface, hot_x, hot_y);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MouseID = u32;
|
||||||
|
|
||||||
|
pub const Cursor = opaque {
|
||||||
|
pub inline fn setCursor(cursor: *Cursor) bool {
|
||||||
|
return c.SDL_SetCursor(cursor);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn destroyCursor(cursor: *Cursor) void {
|
||||||
|
return c.SDL_DestroyCursor(cursor);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const SystemCursor = enum(c_int) {
|
||||||
|
systemCursorDefault, //Default cursor. Usually an arrow.
|
||||||
|
systemCursorText, //Text selection. Usually an I-beam.
|
||||||
|
systemCursorWait, //Wait. Usually an hourglass or watch or spinning ball.
|
||||||
|
systemCursorCrosshair, //Crosshair.
|
||||||
|
systemCursorProgress, //Program is busy but still interactive. Usually it's WAIT with an arrow.
|
||||||
|
systemCursorNwseResize, //Double arrow pointing northwest and southeast.
|
||||||
|
systemCursorNeswResize, //Double arrow pointing northeast and southwest.
|
||||||
|
systemCursorEwResize, //Double arrow pointing west and east.
|
||||||
|
systemCursorNsResize, //Double arrow pointing north and south.
|
||||||
|
systemCursorMove, //Four pointed arrow pointing north, south, east, and west.
|
||||||
|
systemCursorNotAllowed, //Not permitted. Usually a slashed circle or crossbones.
|
||||||
|
systemCursorPointer, //Pointer that indicates a link. Usually a pointing hand.
|
||||||
|
systemCursorNwResize, //Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE.
|
||||||
|
systemCursorNResize, //Window resize top. May be NS_RESIZE.
|
||||||
|
systemCursorNeResize, //Window resize top-right. May be NESW_RESIZE.
|
||||||
|
systemCursorEResize, //Window resize right. May be EW_RESIZE.
|
||||||
|
systemCursorSeResize, //Window resize bottom-right. May be NWSE_RESIZE.
|
||||||
|
systemCursorSResize, //Window resize bottom. May be NS_RESIZE.
|
||||||
|
systemCursorSwResize, //Window resize bottom-left. May be NESW_RESIZE.
|
||||||
|
systemCursorWResize, //Window resize left. May be EW_RESIZE.
|
||||||
|
systemCursorCount,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MouseWheelDirection = enum(c_int) {
|
||||||
|
mousewheelNormal, //The scroll direction is normal
|
||||||
|
mousewheelFlipped, //The scroll direction is flipped / natural
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MouseButtonFlags = packed struct(u32) {
|
||||||
|
buttonLeft: bool = false,
|
||||||
|
buttonMiddle: bool = false,
|
||||||
|
buttonX1: bool = false,
|
||||||
|
pad0: u28 = 0,
|
||||||
|
rsvd: bool = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn hasMouse() bool {
|
||||||
|
return c.SDL_HasMouse();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getMice(count: *c_int) ?*MouseID {
|
||||||
|
return c.SDL_GetMice(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 {
|
||||||
|
return c.SDL_GetMouseNameForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getMouseFocus() ?*Window {
|
||||||
|
return c.SDL_GetMouseFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags {
|
||||||
|
return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags {
|
||||||
|
return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags {
|
||||||
|
return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn warpMouseGlobal(x: f32, y: f32) bool {
|
||||||
|
return c.SDL_WarpMouseGlobal(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn captureMouse(enabled: bool) bool {
|
||||||
|
return c.SDL_CaptureMouse(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor {
|
||||||
|
return c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor {
|
||||||
|
return c.SDL_CreateSystemCursor(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCursor() ?*Cursor {
|
||||||
|
return c.SDL_GetCursor();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getDefaultCursor() ?*Cursor {
|
||||||
|
return c.SDL_GetDefaultCursor();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn showCursor() bool {
|
||||||
|
return c.SDL_ShowCursor();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hideCursor() bool {
|
||||||
|
return c.SDL_HideCursor();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn cursorVisible() bool {
|
||||||
|
return c.SDL_CursorVisible();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,237 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const PixelType = enum(c_int) {
|
||||||
|
pixeltypeUnknown,
|
||||||
|
pixeltypeIndex1,
|
||||||
|
pixeltypeIndex4,
|
||||||
|
pixeltypeIndex8,
|
||||||
|
pixeltypePacked8,
|
||||||
|
pixeltypePacked16,
|
||||||
|
pixeltypePacked32,
|
||||||
|
pixeltypeArrayu8,
|
||||||
|
pixeltypeArrayu16,
|
||||||
|
pixeltypeArrayu32,
|
||||||
|
pixeltypeArrayf16,
|
||||||
|
pixeltypeArrayf32,
|
||||||
|
pixeltypeIndex2,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const BitmapOrder = enum(c_int) {
|
||||||
|
bitmaporderNone,
|
||||||
|
bitmaporder4321,
|
||||||
|
bitmaporder1234,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PackedOrder = enum(c_int) {
|
||||||
|
packedorderNone,
|
||||||
|
packedorderXrgb,
|
||||||
|
packedorderRgbx,
|
||||||
|
packedorderArgb,
|
||||||
|
packedorderRgba,
|
||||||
|
packedorderXbgr,
|
||||||
|
packedorderBgrx,
|
||||||
|
packedorderAbgr,
|
||||||
|
packedorderBgra,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const ArrayOrder = enum(c_int) {
|
||||||
|
arrayorderNone,
|
||||||
|
arrayorderRgb,
|
||||||
|
arrayorderRgba,
|
||||||
|
arrayorderArgb,
|
||||||
|
arrayorderBgr,
|
||||||
|
arrayorderBgra,
|
||||||
|
arrayorderAbgr,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PackedLayout = enum(c_int) {
|
||||||
|
packedlayoutNone,
|
||||||
|
packedlayout332,
|
||||||
|
packedlayout4444,
|
||||||
|
packedlayout1555,
|
||||||
|
packedlayout5551,
|
||||||
|
packedlayout565,
|
||||||
|
packedlayout8888,
|
||||||
|
packedlayout2101010,
|
||||||
|
packedlayout1010102,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PixelFormat = enum(c_int) {
|
||||||
|
pixelformatYv12, //Planar mode: Y + V + U (3 planes)
|
||||||
|
pixelformatIyuv, //Planar mode: Y + U + V (3 planes)
|
||||||
|
pixelformatYuy2, //Packed mode: Y0+U0+Y1+V0 (1 plane)
|
||||||
|
pixelformatUyvy, //Packed mode: U0+Y0+V0+Y1 (1 plane)
|
||||||
|
pixelformatYvyu, //Packed mode: Y0+V0+Y1+U0 (1 plane)
|
||||||
|
pixelformatNv12, //Planar mode: Y + U/V interleaved (2 planes)
|
||||||
|
pixelformatNv21, //Planar mode: Y + V/U interleaved (2 planes)
|
||||||
|
pixelformatP010, //Planar mode: Y + U/V interleaved (2 planes)
|
||||||
|
pixelformatExternalOes, //Android video texture format
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const ColorRange = enum(c_int) {
|
||||||
|
colorRangeLimited, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma
|
||||||
|
colorRangeFull,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const ColorPrimaries = enum(c_int) {
|
||||||
|
colorPrimariesBt709, //ITU-R BT.709-6
|
||||||
|
colorPrimariesBt470m, //ITU-R BT.470-6 System M
|
||||||
|
colorPrimariesBt470bg, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625
|
||||||
|
colorPrimariesBt601, //ITU-R BT.601-7 525, SMPTE 170M
|
||||||
|
colorPrimariesSmpte240, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601
|
||||||
|
colorPrimariesGenericFilm, //Generic film (color filters using Illuminant C)
|
||||||
|
colorPrimariesBt2020, //ITU-R BT.2020-2 / ITU-R BT.2100-0
|
||||||
|
colorPrimariesXyz, //SMPTE ST 428-1
|
||||||
|
colorPrimariesSmpte431, //SMPTE RP 431-2
|
||||||
|
colorPrimariesSmpte432, //SMPTE EG 432-1 / DCI P3
|
||||||
|
colorPrimariesEbu3213, //EBU Tech. 3213-E
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const TransferCharacteristics = enum(c_int) {
|
||||||
|
transferCharacteristicsBt709, //Rec. ITU-R BT.709-6 / ITU-R BT1361
|
||||||
|
transferCharacteristicsGamma22, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM
|
||||||
|
transferCharacteristicsGamma28, //ITU-R BT.470-6 System B, G
|
||||||
|
transferCharacteristicsBt601, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625
|
||||||
|
transferCharacteristicsSmpte240, //SMPTE ST 240M
|
||||||
|
transferCharacteristicsIec61966, //IEC 61966-2-4
|
||||||
|
transferCharacteristicsBt1361, //ITU-R BT1361 Extended Colour Gamut
|
||||||
|
transferCharacteristicsSrgb, //IEC 61966-2-1 (sRGB or sYCC)
|
||||||
|
transferCharacteristicsBt202010bit, //ITU-R BT2020 for 10-bit system
|
||||||
|
transferCharacteristicsBt202012bit, //ITU-R BT2020 for 12-bit system
|
||||||
|
transferCharacteristicsPq, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems
|
||||||
|
transferCharacteristicsSmpte428, //SMPTE ST 428-1
|
||||||
|
transferCharacteristicsHlg, //ARIB STD-B67, known as "hybrid log-gamma" (HLG)
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MatrixCoefficients = enum(c_int) {
|
||||||
|
matrixCoefficientsBt709, //ITU-R BT.709-6
|
||||||
|
matrixCoefficientsFcc, //US FCC Title 47
|
||||||
|
matrixCoefficientsBt470bg, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601
|
||||||
|
matrixCoefficientsBt601, //ITU-R BT.601-7 525
|
||||||
|
matrixCoefficientsSmpte240, //SMPTE 240M
|
||||||
|
matrixCoefficientsBt2020Ncl, //ITU-R BT.2020-2 non-constant luminance
|
||||||
|
matrixCoefficientsBt2020Cl, //ITU-R BT.2020-2 constant luminance
|
||||||
|
matrixCoefficientsSmpte2085, //SMPTE ST 2085
|
||||||
|
matrixCoefficientsIctcp, //ITU-R BT.2100-0 ICTCP
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const ChromaLocation = enum(c_int) {
|
||||||
|
chromaLocationNone, //RGB, no chroma sampling
|
||||||
|
chromaLocationLeft, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically.
|
||||||
|
chromaLocationCenter, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel.
|
||||||
|
chromaLocationTopleft,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Colorspace = enum(c_int) {
|
||||||
|
colorspaceSrgb, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
|
||||||
|
colorRangeFull,
|
||||||
|
colorPrimariesBt709,
|
||||||
|
transferCharacteristicsSrgb,
|
||||||
|
matrixCoefficientsIdentity,
|
||||||
|
colorspaceSrgbLinear, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709
|
||||||
|
transferCharacteristicsLinear,
|
||||||
|
colorspaceHdr10, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020
|
||||||
|
colorPrimariesBt2020,
|
||||||
|
transferCharacteristicsPq,
|
||||||
|
colorspaceJpeg, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601
|
||||||
|
transferCharacteristicsBt601,
|
||||||
|
matrixCoefficientsBt601,
|
||||||
|
colorspaceBt601Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601
|
||||||
|
colorRangeLimited,
|
||||||
|
colorPrimariesBt601,
|
||||||
|
colorspaceBt601Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601
|
||||||
|
colorspaceBt709Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709
|
||||||
|
transferCharacteristicsBt709,
|
||||||
|
matrixCoefficientsBt709,
|
||||||
|
colorspaceBt709Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709
|
||||||
|
colorspaceBt2020Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020
|
||||||
|
matrixCoefficientsBt2020Ncl,
|
||||||
|
colorspaceBt2020Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020
|
||||||
|
colorspaceRgbDefault, //The default colorspace for RGB surfaces if no colorspace is specified
|
||||||
|
colorspaceYuvDefault, //The default colorspace for YUV surfaces if no colorspace is specified
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Color = extern struct {
|
||||||
|
r: u8,
|
||||||
|
g: u8,
|
||||||
|
b: u8,
|
||||||
|
a: u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const FColor = extern struct {
|
||||||
|
r: f32,
|
||||||
|
g: f32,
|
||||||
|
b: f32,
|
||||||
|
a: f32,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Palette = extern struct {
|
||||||
|
ncolors: c_int, // number of elements in `colors`.
|
||||||
|
colors: ?*Color, // an array of colors, `ncolors` long.
|
||||||
|
version: u32, // internal use only, do not touch.
|
||||||
|
refcount: c_int, // internal use only, do not touch.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PixelFormatDetails = extern struct {
|
||||||
|
format: PixelFormat,
|
||||||
|
bits_per_pixel: u8,
|
||||||
|
bytes_per_pixel: u8,
|
||||||
|
padding: [2]u8,
|
||||||
|
Rmask: u32,
|
||||||
|
Gmask: u32,
|
||||||
|
Bmask: u32,
|
||||||
|
Amask: u32,
|
||||||
|
Rbits: u8,
|
||||||
|
Gbits: u8,
|
||||||
|
Bbits: u8,
|
||||||
|
Abits: u8,
|
||||||
|
Rshift: u8,
|
||||||
|
Gshift: u8,
|
||||||
|
Bshift: u8,
|
||||||
|
Ashift: u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 {
|
||||||
|
return c.SDL_GetPixelFormatName(@bitCast(format));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool {
|
||||||
|
return c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat {
|
||||||
|
return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getPixelFormatDetails(format: PixelFormat) *const PixelFormatDetails {
|
||||||
|
return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn createPalette(ncolors: c_int) ?*Palette {
|
||||||
|
return c.SDL_CreatePalette(ncolors);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setPaletteColors(palette: ?*Palette, colors: *const Color, firstcolor: c_int, ncolors: c_int) bool {
|
||||||
|
return c.SDL_SetPaletteColors(palette, @ptrCast(colors), firstcolor, ncolors);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn destroyPalette(palette: ?*Palette) void {
|
||||||
|
return c.SDL_DestroyPalette(palette);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn mapRGB(format: *const PixelFormatDetails, palette: *const Palette, r: u8, g: u8, b: u8) u32 {
|
||||||
|
return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn mapRGBA(format: *const PixelFormatDetails, palette: *const Palette, r: u8, g: u8, b: u8, a: u8) u32 {
|
||||||
|
return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRGB(pixel: u32, format: *const PixelFormatDetails, palette: *const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void {
|
||||||
|
return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRGBA(pixel: u32, format: *const PixelFormatDetails, palette: *const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void {
|
||||||
|
return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,101 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const PropertiesID = u32;
|
||||||
|
|
||||||
|
pub const PropertyType = enum(c_int) {
|
||||||
|
propertyTypeInvalid,
|
||||||
|
propertyTypePointer,
|
||||||
|
propertyTypeString,
|
||||||
|
propertyTypeNumber,
|
||||||
|
propertyTypeFloat,
|
||||||
|
propertyTypeBoolean,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn getGlobalProperties() PropertiesID {
|
||||||
|
return c.SDL_GetGlobalProperties();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn createProperties() PropertiesID {
|
||||||
|
return c.SDL_CreateProperties();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool {
|
||||||
|
return c.SDL_CopyProperties(src, dst);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn lockProperties(props: PropertiesID) bool {
|
||||||
|
return c.SDL_LockProperties(props);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn unlockProperties(props: PropertiesID) void {
|
||||||
|
return c.SDL_UnlockProperties(props);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback;
|
||||||
|
|
||||||
|
pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool {
|
||||||
|
return c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool {
|
||||||
|
return c.SDL_SetPointerProperty(props, name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool {
|
||||||
|
return c.SDL_SetStringProperty(props, name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool {
|
||||||
|
return c.SDL_SetNumberProperty(props, name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool {
|
||||||
|
return c.SDL_SetFloatProperty(props, name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool {
|
||||||
|
return c.SDL_SetBooleanProperty(props, name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool {
|
||||||
|
return c.SDL_HasProperty(props, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType {
|
||||||
|
return @intFromEnum(c.SDL_GetPropertyType(props, name));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque {
|
||||||
|
return c.SDL_GetPointerProperty(props, name, default_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getStringProperty(props: PropertiesID, name: [*c]const u8, default_value: [*c]const u8) [*c]const u8 {
|
||||||
|
return c.SDL_GetStringProperty(props, name, default_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getNumberProperty(props: PropertiesID, name: [*c]const u8, default_value: i64) i64 {
|
||||||
|
return c.SDL_GetNumberProperty(props, name, default_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_value: f32) f32 {
|
||||||
|
return c.SDL_GetFloatProperty(props, name, default_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool {
|
||||||
|
return c.SDL_GetBooleanProperty(props, name, default_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool {
|
||||||
|
return c.SDL_ClearProperty(props, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback;
|
||||||
|
|
||||||
|
pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool {
|
||||||
|
return c.SDL_EnumerateProperties(props, callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn destroyProperties(props: PropertiesID) void {
|
||||||
|
return c.SDL_DestroyProperties(props);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,66 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const Point = extern struct {
|
||||||
|
x: c_int,
|
||||||
|
y: c_int,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const FPoint = extern struct {
|
||||||
|
x: f32,
|
||||||
|
y: f32,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Rect = extern struct {
|
||||||
|
x: c_int,
|
||||||
|
y: c_int,
|
||||||
|
w: c_int,
|
||||||
|
h: c_int,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const FRect = extern struct {
|
||||||
|
x: f32,
|
||||||
|
y: f32,
|
||||||
|
w: f32,
|
||||||
|
h: f32,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn hasRectIntersection(A: *const Rect, B: *const Rect) bool {
|
||||||
|
return c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRectIntersection(A: *const Rect, B: *const Rect, result: ?*Rect) bool {
|
||||||
|
return c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), result);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRectUnion(A: *const Rect, B: *const Rect, result: ?*Rect) bool {
|
||||||
|
return c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), result);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRectEnclosingPoints(points: *const Point, count: c_int, clip: *const Rect, result: ?*Rect) bool {
|
||||||
|
return c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), result);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRectAndLineIntersection(rect: *const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool {
|
||||||
|
return c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hasRectIntersectionFloat(A: *const FRect, B: *const FRect) bool {
|
||||||
|
return c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRectIntersectionFloat(A: *const FRect, B: *const FRect, result: ?*FRect) bool {
|
||||||
|
return c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), result);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRectUnionFloat(A: *const FRect, B: *const FRect, result: ?*FRect) bool {
|
||||||
|
return c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), result);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRectEnclosingPointsFloat(points: *const FPoint, count: c_int, clip: *const FRect, result: ?*FRect) bool {
|
||||||
|
return c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), result);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRectAndLineIntersectionFloat(rect: *const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool {
|
||||||
|
return c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2));
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,75 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const PropertiesID = u32;
|
||||||
|
|
||||||
|
pub const Sensor = opaque {
|
||||||
|
pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID {
|
||||||
|
return c.SDL_GetSensorProperties(sensor);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 {
|
||||||
|
return c.SDL_GetSensorName(sensor);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSensorType(sensor: *Sensor) SensorType {
|
||||||
|
return @intFromEnum(c.SDL_GetSensorType(sensor));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int {
|
||||||
|
return c.SDL_GetSensorNonPortableType(sensor);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSensorID(sensor: *Sensor) SensorID {
|
||||||
|
return c.SDL_GetSensorID(sensor);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool {
|
||||||
|
return c.SDL_GetSensorData(sensor, @ptrCast(data), num_values);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn closeSensor(sensor: *Sensor) void {
|
||||||
|
return c.SDL_CloseSensor(sensor);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const SensorID = u32;
|
||||||
|
|
||||||
|
pub const SensorType = enum(c_int) {
|
||||||
|
sensorInvalid, //Returned for an invalid sensor
|
||||||
|
sensorUnknown, //Unknown sensor type
|
||||||
|
sensorAccel, //Accelerometer
|
||||||
|
sensorGyro, //Gyroscope
|
||||||
|
sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk
|
||||||
|
sensorGyroL, //Gyroscope for left Joy-Con controller
|
||||||
|
sensorAccelR, //Accelerometer for right Joy-Con controller
|
||||||
|
sensorGyroR, //Gyroscope for right Joy-Con controller
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn getSensors(count: *c_int) ?*SensorID {
|
||||||
|
return c.SDL_GetSensors(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 {
|
||||||
|
return c.SDL_GetSensorNameForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType {
|
||||||
|
return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int {
|
||||||
|
return c.SDL_GetSensorNonPortableTypeForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openSensor(instance_id: SensorID) ?*Sensor {
|
||||||
|
return c.SDL_OpenSensor(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor {
|
||||||
|
return c.SDL_GetSensorFromID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn updateSensors() void {
|
||||||
|
return c.SDL_UpdateSensors();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,114 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const PathInfo = extern struct {
|
||||||
|
_type: PathType, // the path type
|
||||||
|
size: u64, // the file size in bytes
|
||||||
|
create_time: Time, // the time when the path was created
|
||||||
|
modify_time: Time, // the last time the path was modified
|
||||||
|
access_time: Time, // the last time the path was read
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PathType = enum(c_int) {
|
||||||
|
pathtypeNone, //path does not exist
|
||||||
|
pathtypeFile, //a normal file
|
||||||
|
pathtypeDirectory, //a directory
|
||||||
|
pathtypeOther,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Time = i64;
|
||||||
|
|
||||||
|
pub const GlobFlags = packed struct(u32) {
|
||||||
|
globCaseinsensitive: bool = false,
|
||||||
|
pad0: u30 = 0,
|
||||||
|
rsvd: bool = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback;
|
||||||
|
|
||||||
|
pub const PropertiesID = u32;
|
||||||
|
|
||||||
|
pub const StorageInterface = extern struct {
|
||||||
|
version: u32,
|
||||||
|
close: ?*const anyopaque,
|
||||||
|
ready: ?*const anyopaque,
|
||||||
|
enumerate: ?*const anyopaque,
|
||||||
|
info: ?*const anyopaque,
|
||||||
|
read_file: ?*const anyopaque,
|
||||||
|
write_file: ?*const anyopaque,
|
||||||
|
mkdir: ?*const anyopaque,
|
||||||
|
remove: ?*const anyopaque,
|
||||||
|
rename: ?*const anyopaque,
|
||||||
|
copy: ?*const anyopaque,
|
||||||
|
space_remaining: ?*const anyopaque,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Storage = opaque {
|
||||||
|
pub inline fn closeStorage(storage: *Storage) bool {
|
||||||
|
return c.SDL_CloseStorage(storage);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn storageReady(storage: *Storage) bool {
|
||||||
|
return c.SDL_StorageReady(storage);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool {
|
||||||
|
return c.SDL_GetStorageFileSize(storage, path, @ptrCast(length));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool {
|
||||||
|
return c.SDL_ReadStorageFile(storage, path, destination, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool {
|
||||||
|
return c.SDL_WriteStorageFile(storage, path, source, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool {
|
||||||
|
return c.SDL_CreateStorageDirectory(storage, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool {
|
||||||
|
return c.SDL_EnumerateStorageDirectory(storage, path, callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool {
|
||||||
|
return c.SDL_RemoveStoragePath(storage, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool {
|
||||||
|
return c.SDL_RenameStoragePath(storage, oldpath, newpath);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool {
|
||||||
|
return c.SDL_CopyStorageFile(storage, oldpath, newpath);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool {
|
||||||
|
return c.SDL_GetStoragePathInfo(storage, path, info);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 {
|
||||||
|
return c.SDL_GetStorageSpaceRemaining(storage);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 {
|
||||||
|
return c.SDL_GlobStorageDirectory(storage, path, pattern, @bitCast(flags), @ptrCast(count));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage {
|
||||||
|
return c.SDL_OpenTitleStorage(override, props);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage {
|
||||||
|
return c.SDL_OpenUserStorage(org, app, props);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openFileStorage(path: [*c]const u8) ?*Storage {
|
||||||
|
return c.SDL_OpenFileStorage(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openStorage(iface: *const StorageInterface, userdata: ?*anyopaque) ?*Storage {
|
||||||
|
return c.SDL_OpenStorage(@ptrCast(iface), userdata);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,320 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const PixelFormat = enum(c_int) {
|
||||||
|
pixelformatYv12, //Planar mode: Y + V + U (3 planes)
|
||||||
|
pixelformatIyuv, //Planar mode: Y + U + V (3 planes)
|
||||||
|
pixelformatYuy2, //Packed mode: Y0+U0+Y1+V0 (1 plane)
|
||||||
|
pixelformatUyvy, //Packed mode: U0+Y0+V0+Y1 (1 plane)
|
||||||
|
pixelformatYvyu, //Packed mode: Y0+V0+Y1+U0 (1 plane)
|
||||||
|
pixelformatNv12, //Planar mode: Y + U/V interleaved (2 planes)
|
||||||
|
pixelformatNv21, //Planar mode: Y + V/U interleaved (2 planes)
|
||||||
|
pixelformatP010, //Planar mode: Y + U/V interleaved (2 planes)
|
||||||
|
pixelformatExternalOes, //Android video texture format
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const BlendMode = u32;
|
||||||
|
|
||||||
|
pub const IOStream = opaque {
|
||||||
|
pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface {
|
||||||
|
return c.SDL_LoadBMP_IO(iostream, closeio);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Rect = extern struct {
|
||||||
|
x: c_int,
|
||||||
|
y: c_int,
|
||||||
|
w: c_int,
|
||||||
|
h: c_int,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Palette = extern struct {
|
||||||
|
ncolors: c_int, // number of elements in `colors`.
|
||||||
|
colors: ?*Color, // an array of colors, `ncolors` long.
|
||||||
|
version: u32, // internal use only, do not touch.
|
||||||
|
refcount: c_int, // internal use only, do not touch.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Color = extern struct {
|
||||||
|
r: u8,
|
||||||
|
g: u8,
|
||||||
|
b: u8,
|
||||||
|
a: u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Colorspace = enum(c_int) {
|
||||||
|
colorspaceSrgb, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
|
||||||
|
colorRangeFull,
|
||||||
|
colorPrimariesBt709,
|
||||||
|
transferCharacteristicsSrgb,
|
||||||
|
matrixCoefficientsIdentity,
|
||||||
|
colorspaceSrgbLinear, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709
|
||||||
|
transferCharacteristicsLinear,
|
||||||
|
colorspaceHdr10, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020
|
||||||
|
colorPrimariesBt2020,
|
||||||
|
transferCharacteristicsPq,
|
||||||
|
colorspaceJpeg, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601
|
||||||
|
transferCharacteristicsBt601,
|
||||||
|
matrixCoefficientsBt601,
|
||||||
|
colorspaceBt601Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601
|
||||||
|
colorRangeLimited,
|
||||||
|
colorPrimariesBt601,
|
||||||
|
colorspaceBt601Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601
|
||||||
|
colorspaceBt709Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709
|
||||||
|
transferCharacteristicsBt709,
|
||||||
|
matrixCoefficientsBt709,
|
||||||
|
colorspaceBt709Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709
|
||||||
|
colorspaceBt2020Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020
|
||||||
|
matrixCoefficientsBt2020Ncl,
|
||||||
|
colorspaceBt2020Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020
|
||||||
|
colorspaceRgbDefault, //The default colorspace for RGB surfaces if no colorspace is specified
|
||||||
|
colorspaceYuvDefault, //The default colorspace for YUV surfaces if no colorspace is specified
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PropertiesID = u32;
|
||||||
|
|
||||||
|
pub const SurfaceFlags = packed struct(u32) {
|
||||||
|
surfacePreallocated: bool = false, // Surface uses preallocated pixel memory
|
||||||
|
surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels
|
||||||
|
surfaceLocked: bool = false, // Surface is currently locked
|
||||||
|
surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc()
|
||||||
|
pad0: u27 = 0,
|
||||||
|
rsvd: bool = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const ScaleMode = enum(c_int) {
|
||||||
|
scalemodeNearest, //nearest pixel sampling
|
||||||
|
scalemodeLinear, //linear filtering
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const FlipMode = enum(c_int) {
|
||||||
|
flipNone, //Do not flip
|
||||||
|
flipHorizontal, //flip horizontally
|
||||||
|
flipVertical, //flip vertically
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Surface = opaque {
|
||||||
|
pub inline fn destroySurface(surface: *Surface) void {
|
||||||
|
return c.SDL_DestroySurface(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID {
|
||||||
|
return c.SDL_GetSurfaceProperties(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool {
|
||||||
|
return c.SDL_SetSurfaceColorspace(surface, colorspace);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace {
|
||||||
|
return c.SDL_GetSurfaceColorspace(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn createSurfacePalette(surface: *Surface) ?*Palette {
|
||||||
|
return c.SDL_CreateSurfacePalette(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool {
|
||||||
|
return c.SDL_SetSurfacePalette(surface, palette);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSurfacePalette(surface: *Surface) ?*Palette {
|
||||||
|
return c.SDL_GetSurfacePalette(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool {
|
||||||
|
return c.SDL_AddSurfaceAlternateImage(surface, image);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn surfaceHasAlternateImages(surface: *Surface) bool {
|
||||||
|
return c.SDL_SurfaceHasAlternateImages(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c][*c]Surface {
|
||||||
|
return c.SDL_GetSurfaceImages(surface, @ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn removeSurfaceAlternateImages(surface: *Surface) void {
|
||||||
|
return c.SDL_RemoveSurfaceAlternateImages(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn lockSurface(surface: *Surface) bool {
|
||||||
|
return c.SDL_LockSurface(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn unlockSurface(surface: *Surface) void {
|
||||||
|
return c.SDL_UnlockSurface(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool {
|
||||||
|
return c.SDL_SaveBMP_IO(surface, dst, closeio);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool {
|
||||||
|
return c.SDL_SaveBMP(surface, file);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool {
|
||||||
|
return c.SDL_SetSurfaceRLE(surface, enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn surfaceHasRLE(surface: *Surface) bool {
|
||||||
|
return c.SDL_SurfaceHasRLE(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool {
|
||||||
|
return c.SDL_SetSurfaceColorKey(surface, enabled, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn surfaceHasColorKey(surface: *Surface) bool {
|
||||||
|
return c.SDL_SurfaceHasColorKey(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool {
|
||||||
|
return c.SDL_GetSurfaceColorKey(surface, @ptrCast(key));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool {
|
||||||
|
return c.SDL_SetSurfaceColorMod(surface, r, g, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool {
|
||||||
|
return c.SDL_GetSurfaceColorMod(surface, r, g, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool {
|
||||||
|
return c.SDL_SetSurfaceAlphaMod(surface, alpha);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool {
|
||||||
|
return c.SDL_GetSurfaceAlphaMod(surface, alpha);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool {
|
||||||
|
return c.SDL_SetSurfaceBlendMode(surface, @intFromEnum(blendMode));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool {
|
||||||
|
return c.SDL_GetSurfaceBlendMode(surface, @intFromEnum(blendMode));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setSurfaceClipRect(surface: *Surface, rect: *const Rect) bool {
|
||||||
|
return c.SDL_SetSurfaceClipRect(surface, @ptrCast(rect));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool {
|
||||||
|
return c.SDL_GetSurfaceClipRect(surface, rect);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool {
|
||||||
|
return c.SDL_FlipSurface(surface, @intFromEnum(flip));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn duplicateSurface(surface: *Surface) ?*Surface {
|
||||||
|
return c.SDL_DuplicateSurface(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface {
|
||||||
|
return c.SDL_ScaleSurface(surface, width, height, @intFromEnum(scaleMode));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface {
|
||||||
|
return c.SDL_ConvertSurface(surface, @bitCast(format));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface {
|
||||||
|
return c.SDL_ConvertSurfaceAndColorspace(surface, @bitCast(format), palette, colorspace, props);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool {
|
||||||
|
return c.SDL_PremultiplySurfaceAlpha(surface, linear);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool {
|
||||||
|
return c.SDL_ClearSurface(surface, r, g, b, a);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn fillSurfaceRect(surface: *Surface, rect: *const Rect, color: u32) bool {
|
||||||
|
return c.SDL_FillSurfaceRect(surface, @ptrCast(rect), color);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn fillSurfaceRects(surface: *Surface, rects: *const Rect, count: c_int, color: u32) bool {
|
||||||
|
return c.SDL_FillSurfaceRects(surface, @ptrCast(rects), count, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn blitSurface(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect) bool {
|
||||||
|
return c.SDL_BlitSurface(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect) bool {
|
||||||
|
return c.SDL_BlitSurfaceUnchecked(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect, scaleMode: ScaleMode) bool {
|
||||||
|
return c.SDL_BlitSurfaceScaled(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect), @intFromEnum(scaleMode));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect, scaleMode: ScaleMode) bool {
|
||||||
|
return c.SDL_BlitSurfaceUncheckedScaled(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect), @intFromEnum(scaleMode));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect) bool {
|
||||||
|
return c.SDL_BlitSurfaceTiled(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: *const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: *const Rect) bool {
|
||||||
|
return c.SDL_BlitSurfaceTiledWithScale(surface, @ptrCast(srcrect), scale, @intFromEnum(scaleMode), dst, @ptrCast(dstrect));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn blitSurface9Grid(surface: *Surface, srcrect: *const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: *const Rect) bool {
|
||||||
|
return c.SDL_BlitSurface9Grid(surface, @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), dst, @ptrCast(dstrect));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 {
|
||||||
|
return c.SDL_MapSurfaceRGB(surface, r, g, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 {
|
||||||
|
return c.SDL_MapSurfaceRGBA(surface, r, g, b, a);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool {
|
||||||
|
return c.SDL_ReadSurfacePixel(surface, x, y, r, g, b, a);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool {
|
||||||
|
return c.SDL_ReadSurfacePixelFloat(surface, x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool {
|
||||||
|
return c.SDL_WriteSurfacePixel(surface, x, y, r, g, b, a);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool {
|
||||||
|
return c.SDL_WriteSurfacePixelFloat(surface, x, y, r, g, b, a);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface {
|
||||||
|
return c.SDL_CreateSurface(width, height, @bitCast(format));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface {
|
||||||
|
return c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn loadBMP(file: [*c]const u8) ?*Surface {
|
||||||
|
return c.SDL_LoadBMP(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool {
|
||||||
|
return c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool {
|
||||||
|
return c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool {
|
||||||
|
return c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, linear);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,159 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const DisplayID = u32;
|
||||||
|
|
||||||
|
pub const Window = opaque {
|
||||||
|
pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool {
|
||||||
|
return c.SDL_SetiOSAnimationCallback(window, interval, callback, callbackParam);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MSG = opaque {};
|
||||||
|
|
||||||
|
pub const WindowsMessageHook = c.SDL_WindowsMessageHook;
|
||||||
|
|
||||||
|
pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void {
|
||||||
|
return c.SDL_SetWindowsMessageHook(callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int {
|
||||||
|
return c.SDL_GetDirect3D9AdapterIndex(displayID);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool {
|
||||||
|
return c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const X11EventHook = c.SDL_X11EventHook;
|
||||||
|
|
||||||
|
pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void {
|
||||||
|
return c.SDL_SetX11EventHook(callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool {
|
||||||
|
return c.SDL_SetLinuxThreadPriority(threadID, priority);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool {
|
||||||
|
return c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback;
|
||||||
|
|
||||||
|
pub inline fn setiOSEventPump(enabled: bool) void {
|
||||||
|
return c.SDL_SetiOSEventPump(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAndroidJNIEnv() ?*anyopaque {
|
||||||
|
return c.SDL_GetAndroidJNIEnv();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAndroidActivity() ?*anyopaque {
|
||||||
|
return c.SDL_GetAndroidActivity();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAndroidSDKVersion() c_int {
|
||||||
|
return c.SDL_GetAndroidSDKVersion();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn isChromebook() bool {
|
||||||
|
return c.SDL_IsChromebook();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn isDeXMode() bool {
|
||||||
|
return c.SDL_IsDeXMode();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn sendAndroidBackButton() void {
|
||||||
|
return c.SDL_SendAndroidBackButton();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAndroidInternalStoragePath() [*c]const u8 {
|
||||||
|
return c.SDL_GetAndroidInternalStoragePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAndroidExternalStorageState() u32 {
|
||||||
|
return c.SDL_GetAndroidExternalStorageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAndroidExternalStoragePath() [*c]const u8 {
|
||||||
|
return c.SDL_GetAndroidExternalStoragePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAndroidCachePath() [*c]const u8 {
|
||||||
|
return c.SDL_GetAndroidCachePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback;
|
||||||
|
|
||||||
|
pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool {
|
||||||
|
return c.SDL_RequestAndroidPermission(permission, cb, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool {
|
||||||
|
return c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn sendAndroidMessage(command: u32, param: c_int) bool {
|
||||||
|
return c.SDL_SendAndroidMessage(command, param);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn isTablet() bool {
|
||||||
|
return c.SDL_IsTablet();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn isTV() bool {
|
||||||
|
return c.SDL_IsTV();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const Sandbox = enum(c_int) {
|
||||||
|
sandboxUnknownContainer,
|
||||||
|
sandboxFlatpak,
|
||||||
|
sandboxSnap,
|
||||||
|
sandboxMacos,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn getSandbox() Sandbox {
|
||||||
|
return c.SDL_GetSandbox();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn onApplicationWillTerminate() void {
|
||||||
|
return c.SDL_OnApplicationWillTerminate();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn onApplicationDidReceiveMemoryWarning() void {
|
||||||
|
return c.SDL_OnApplicationDidReceiveMemoryWarning();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn onApplicationWillEnterBackground() void {
|
||||||
|
return c.SDL_OnApplicationWillEnterBackground();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn onApplicationDidEnterBackground() void {
|
||||||
|
return c.SDL_OnApplicationDidEnterBackground();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn onApplicationWillEnterForeground() void {
|
||||||
|
return c.SDL_OnApplicationWillEnterForeground();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn onApplicationDidEnterForeground() void {
|
||||||
|
return c.SDL_OnApplicationDidEnterForeground();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn onApplicationDidChangeStatusBarOrientation() void {
|
||||||
|
return c.SDL_OnApplicationDidChangeStatusBarOrientation();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const XTaskQueueHandle = *anyopaque;
|
||||||
|
|
||||||
|
pub const XUserHandle = *anyopaque;
|
||||||
|
|
||||||
|
pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool {
|
||||||
|
return c.SDL_GetGDKTaskQueue(outTaskQueue);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool {
|
||||||
|
return c.SDL_GetGDKDefaultUser(outUserHandle);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,63 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const Time = i64;
|
||||||
|
|
||||||
|
pub const DateTime = extern struct {
|
||||||
|
year: c_int, // Year
|
||||||
|
month: c_int, // Month [01-12]
|
||||||
|
day: c_int, // Day of the month [01-31]
|
||||||
|
hour: c_int, // Hour [0-23]
|
||||||
|
minute: c_int, // Minute [0-59]
|
||||||
|
second: c_int, // Seconds [0-60]
|
||||||
|
nanosecond: c_int, // Nanoseconds [0-999999999]
|
||||||
|
day_of_week: c_int, // Day of the week [0-6] (0 being Sunday)
|
||||||
|
utc_offset: c_int, // Seconds east of UTC
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const DateFormat = enum(c_int) {
|
||||||
|
dateFormatYyyymmdd, //Year/Month/Day
|
||||||
|
dateFormatDdmmyyyy, //Day/Month/Year
|
||||||
|
dateFormatMmddyyyy, //Month/Day/Year
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const TimeFormat = enum(c_int) {
|
||||||
|
timeFormat24hr, //24 hour time
|
||||||
|
timeFormat12hr, //12 hour time
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool {
|
||||||
|
return c.SDL_GetDateTimeLocalePreferences(@bitCast(dateFormat), @bitCast(timeFormat));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCurrentTime(ticks: ?*Time) bool {
|
||||||
|
return c.SDL_GetCurrentTime(ticks);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool {
|
||||||
|
return c.SDL_TimeToDateTime(ticks, dt, localTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn dateTimeToTime(dt: *const DateTime, ticks: ?*Time) bool {
|
||||||
|
return c.SDL_DateTimeToTime(@ptrCast(dt), ticks);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void {
|
||||||
|
return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time {
|
||||||
|
return c.SDL_TimeFromWindows(dwLowDateTime, dwHighDateTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getDaysInMonth(year: c_int, month: c_int) c_int {
|
||||||
|
return c.SDL_GetDaysInMonth(year, month);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getDayOfYear(year: c_int, month: c_int, day: c_int) c_int {
|
||||||
|
return c.SDL_GetDayOfYear(year, month, day);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getDayOfWeek(year: c_int, month: c_int, day: c_int) c_int {
|
||||||
|
return c.SDL_GetDayOfWeek(year, month, day);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub inline fn getTicks() u64 {
|
||||||
|
return c.SDL_GetTicks();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getTicksNS() u64 {
|
||||||
|
return c.SDL_GetTicksNS();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getPerformanceCounter() u64 {
|
||||||
|
return c.SDL_GetPerformanceCounter();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getPerformanceFrequency() u64 {
|
||||||
|
return c.SDL_GetPerformanceFrequency();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn delay(ms: u32) void {
|
||||||
|
return c.SDL_Delay(ms);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn delayNS(ns: u64) void {
|
||||||
|
return c.SDL_DelayNS(ns);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn delayPrecise(ns: u64) void {
|
||||||
|
return c.SDL_DelayPrecise(ns);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const TimerID = u32;
|
||||||
|
|
||||||
|
pub const TimerCallback = c.SDL_TimerCallback;
|
||||||
|
|
||||||
|
pub inline fn addTimer(interval: u32, callback: TimerCallback, userdata: ?*anyopaque) TimerID {
|
||||||
|
return c.SDL_AddTimer(interval, callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const NSTimerCallback = c.SDL_NSTimerCallback;
|
||||||
|
|
||||||
|
pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*anyopaque) TimerID {
|
||||||
|
return c.SDL_AddTimerNS(interval, callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn removeTimer(id: TimerID) bool {
|
||||||
|
return c.SDL_RemoveTimer(id);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const TouchID = u64;
|
||||||
|
|
||||||
|
pub const FingerID = u64;
|
||||||
|
|
||||||
|
pub const TouchDeviceType = enum(c_int) {
|
||||||
|
touchDeviceDirect,
|
||||||
|
touchDeviceIndirectAbsolute,
|
||||||
|
touchDeviceIndirectRelative /* trackpad with screen cursor-relative coordinates */,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Finger = extern struct {
|
||||||
|
id: FingerID, // the finger ID
|
||||||
|
x: f32, // the x-axis location of the touch event, normalized (0...1)
|
||||||
|
y: f32, // the y-axis location of the touch event, normalized (0...1)
|
||||||
|
pressure: f32, // the quantity of pressure applied, normalized (0...1)
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn getTouchDevices(count: *c_int) ?*TouchID {
|
||||||
|
return c.SDL_GetTouchDevices(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 {
|
||||||
|
return c.SDL_GetTouchDeviceName(touchID);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType {
|
||||||
|
return @intFromEnum(c.SDL_GetTouchDeviceType(touchID));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c][*c]Finger {
|
||||||
|
return c.SDL_GetTouchFingers(touchID, @ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub inline fn getVersion() c_int {
|
||||||
|
return c.SDL_GetVersion();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRevision() [*c]const u8 {
|
||||||
|
return c.SDL_GetRevision();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,608 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const PixelFormat = enum(c_int) {
|
||||||
|
pixelformatYv12, //Planar mode: Y + V + U (3 planes)
|
||||||
|
pixelformatIyuv, //Planar mode: Y + U + V (3 planes)
|
||||||
|
pixelformatYuy2, //Packed mode: Y0+U0+Y1+V0 (1 plane)
|
||||||
|
pixelformatUyvy, //Packed mode: U0+Y0+V0+Y1 (1 plane)
|
||||||
|
pixelformatYvyu, //Packed mode: Y0+V0+Y1+U0 (1 plane)
|
||||||
|
pixelformatNv12, //Planar mode: Y + U/V interleaved (2 planes)
|
||||||
|
pixelformatNv21, //Planar mode: Y + V/U interleaved (2 planes)
|
||||||
|
pixelformatP010, //Planar mode: Y + U/V interleaved (2 planes)
|
||||||
|
pixelformatExternalOes, //Android video texture format
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Point = extern struct {
|
||||||
|
x: c_int,
|
||||||
|
y: c_int,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Surface = opaque {};
|
||||||
|
|
||||||
|
pub const PropertiesID = u32;
|
||||||
|
|
||||||
|
pub const Rect = extern struct {
|
||||||
|
x: c_int,
|
||||||
|
y: c_int,
|
||||||
|
w: c_int,
|
||||||
|
h: c_int,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const FunctionPointer = c.SDL_FunctionPointer;
|
||||||
|
|
||||||
|
pub const DisplayID = u32;
|
||||||
|
|
||||||
|
pub const WindowID = u32;
|
||||||
|
|
||||||
|
pub const SystemTheme = enum(c_int) {
|
||||||
|
systemThemeUnknown, //Unknown system theme
|
||||||
|
systemThemeLight, //Light colored system theme
|
||||||
|
systemThemeDark, //Dark colored system theme
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const DisplayModeData = opaque {};
|
||||||
|
|
||||||
|
pub const DisplayMode = extern struct {
|
||||||
|
displayID: DisplayID, // the display this mode is associated with
|
||||||
|
format: PixelFormat, // pixel format
|
||||||
|
w: c_int, // width
|
||||||
|
h: c_int, // height
|
||||||
|
pixel_density: f32, // scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)
|
||||||
|
refresh_rate: f32, // refresh rate (or 0.0f for unspecified)
|
||||||
|
refresh_rate_numerator: c_int, // precise refresh rate numerator (or 0 for unspecified)
|
||||||
|
refresh_rate_denominator: c_int, // precise refresh rate denominator
|
||||||
|
internal: ?*DisplayModeData, // Private
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const DisplayOrientation = enum(c_int) {
|
||||||
|
orientationUnknown, //The display orientation can't be determined
|
||||||
|
orientationLandscape, //The display is in landscape mode, with the right side up, relative to portrait mode
|
||||||
|
orientationLandscapeFlipped, //The display is in landscape mode, with the left side up, relative to portrait mode
|
||||||
|
orientationPortrait, //The display is in portrait mode
|
||||||
|
orientationPortraitFlipped,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Window = opaque {
|
||||||
|
pub inline fn getDisplayForWindow(window: *Window) DisplayID {
|
||||||
|
return c.SDL_GetDisplayForWindow(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowPixelDensity(window: *Window) f32 {
|
||||||
|
return c.SDL_GetWindowPixelDensity(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowDisplayScale(window: *Window) f32 {
|
||||||
|
return c.SDL_GetWindowDisplayScale(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowFullscreenMode(window: *Window, mode: *const DisplayMode) bool {
|
||||||
|
return c.SDL_SetWindowFullscreenMode(window, @ptrCast(mode));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowFullscreenMode(window: *Window) *const DisplayMode {
|
||||||
|
return @ptrCast(c.SDL_GetWindowFullscreenMode(window));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque {
|
||||||
|
return c.SDL_GetWindowICCProfile(window, @ptrCast(size));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowPixelFormat(window: *Window) PixelFormat {
|
||||||
|
return @bitCast(c.SDL_GetWindowPixelFormat(window));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn createPopupWindow(window: *Window, offset_x: c_int, offset_y: c_int, w: c_int, h: c_int, flags: WindowFlags) ?*Window {
|
||||||
|
return c.SDL_CreatePopupWindow(window, offset_x, offset_y, w, h, @bitCast(flags));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowID(window: *Window) WindowID {
|
||||||
|
return c.SDL_GetWindowID(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowParent(window: *Window) ?*Window {
|
||||||
|
return c.SDL_GetWindowParent(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowProperties(window: *Window) PropertiesID {
|
||||||
|
return c.SDL_GetWindowProperties(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowFlags(window: *Window) WindowFlags {
|
||||||
|
return @bitCast(c.SDL_GetWindowFlags(window));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool {
|
||||||
|
return c.SDL_SetWindowTitle(window, title);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowTitle(window: *Window) [*c]const u8 {
|
||||||
|
return c.SDL_GetWindowTitle(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool {
|
||||||
|
return c.SDL_SetWindowIcon(window, icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool {
|
||||||
|
return c.SDL_SetWindowPosition(window, x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool {
|
||||||
|
return c.SDL_GetWindowPosition(window, @ptrCast(x), @ptrCast(y));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool {
|
||||||
|
return c.SDL_SetWindowSize(window, w, h);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool {
|
||||||
|
return c.SDL_GetWindowSize(window, @ptrCast(w), @ptrCast(h));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool {
|
||||||
|
return c.SDL_GetWindowSafeArea(window, rect);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool {
|
||||||
|
return c.SDL_SetWindowAspectRatio(window, min_aspect, max_aspect);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool {
|
||||||
|
return c.SDL_GetWindowAspectRatio(window, @ptrCast(min_aspect), @ptrCast(max_aspect));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowBordersSize(window: *Window, top: *c_int, left: *c_int, bottom: *c_int, right: *c_int) bool {
|
||||||
|
return c.SDL_GetWindowBordersSize(window, @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool {
|
||||||
|
return c.SDL_GetWindowSizeInPixels(window, @ptrCast(w), @ptrCast(h));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool {
|
||||||
|
return c.SDL_SetWindowMinimumSize(window, min_w, min_h);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool {
|
||||||
|
return c.SDL_GetWindowMinimumSize(window, @ptrCast(w), @ptrCast(h));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool {
|
||||||
|
return c.SDL_SetWindowMaximumSize(window, max_w, max_h);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool {
|
||||||
|
return c.SDL_GetWindowMaximumSize(window, @ptrCast(w), @ptrCast(h));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowBordered(window: *Window, bordered: bool) bool {
|
||||||
|
return c.SDL_SetWindowBordered(window, bordered);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowResizable(window: *Window, resizable: bool) bool {
|
||||||
|
return c.SDL_SetWindowResizable(window, resizable);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool {
|
||||||
|
return c.SDL_SetWindowAlwaysOnTop(window, on_top);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn showWindow(window: *Window) bool {
|
||||||
|
return c.SDL_ShowWindow(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hideWindow(window: *Window) bool {
|
||||||
|
return c.SDL_HideWindow(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn raiseWindow(window: *Window) bool {
|
||||||
|
return c.SDL_RaiseWindow(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn maximizeWindow(window: *Window) bool {
|
||||||
|
return c.SDL_MaximizeWindow(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn minimizeWindow(window: *Window) bool {
|
||||||
|
return c.SDL_MinimizeWindow(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn restoreWindow(window: *Window) bool {
|
||||||
|
return c.SDL_RestoreWindow(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool {
|
||||||
|
return c.SDL_SetWindowFullscreen(window, fullscreen);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn syncWindow(window: *Window) bool {
|
||||||
|
return c.SDL_SyncWindow(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn windowHasSurface(window: *Window) bool {
|
||||||
|
return c.SDL_WindowHasSurface(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowSurface(window: *Window) ?*Surface {
|
||||||
|
return c.SDL_GetWindowSurface(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool {
|
||||||
|
return c.SDL_SetWindowSurfaceVSync(window, vsync);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool {
|
||||||
|
return c.SDL_GetWindowSurfaceVSync(window, @ptrCast(vsync));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn updateWindowSurface(window: *Window) bool {
|
||||||
|
return c.SDL_UpdateWindowSurface(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn updateWindowSurfaceRects(window: *Window, rects: *const Rect, numrects: c_int) bool {
|
||||||
|
return c.SDL_UpdateWindowSurfaceRects(window, @ptrCast(rects), numrects);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn destroyWindowSurface(window: *Window) bool {
|
||||||
|
return c.SDL_DestroyWindowSurface(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool {
|
||||||
|
return c.SDL_SetWindowKeyboardGrab(window, grabbed);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool {
|
||||||
|
return c.SDL_SetWindowMouseGrab(window, grabbed);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowKeyboardGrab(window: *Window) bool {
|
||||||
|
return c.SDL_GetWindowKeyboardGrab(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowMouseGrab(window: *Window) bool {
|
||||||
|
return c.SDL_GetWindowMouseGrab(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowMouseRect(window: *Window, rect: *const Rect) bool {
|
||||||
|
return c.SDL_SetWindowMouseRect(window, @ptrCast(rect));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowMouseRect(window: *Window) *const Rect {
|
||||||
|
return @ptrCast(c.SDL_GetWindowMouseRect(window));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool {
|
||||||
|
return c.SDL_SetWindowOpacity(window, opacity);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowOpacity(window: *Window) f32 {
|
||||||
|
return c.SDL_GetWindowOpacity(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool {
|
||||||
|
return c.SDL_SetWindowParent(window, parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowModal(window: *Window, modal: bool) bool {
|
||||||
|
return c.SDL_SetWindowModal(window, modal);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool {
|
||||||
|
return c.SDL_SetWindowFocusable(window, focusable);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool {
|
||||||
|
return c.SDL_ShowWindowSystemMenu(window, x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool {
|
||||||
|
return c.SDL_SetWindowHitTest(window, callback, callback_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool {
|
||||||
|
return c.SDL_SetWindowShape(window, shape);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool {
|
||||||
|
return c.SDL_FlashWindow(window, @intFromEnum(operation));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn destroyWindow(window: *Window) void {
|
||||||
|
return c.SDL_DestroyWindow(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gl_CreateContext(window: *Window) GLContext {
|
||||||
|
return c.SDL_GL_CreateContext(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool {
|
||||||
|
return c.SDL_GL_MakeCurrent(window, context);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface {
|
||||||
|
return c.SDL_EGL_GetWindowSurface(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gl_SwapWindow(window: *Window) bool {
|
||||||
|
return c.SDL_GL_SwapWindow(window);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const WindowFlags = packed struct(u64) {
|
||||||
|
windowFullscreen: bool = false, // window is in fullscreen mode
|
||||||
|
windowOpengl: bool = false, // window usable with OpenGL context
|
||||||
|
windowOccluded: bool = false, // window is occluded
|
||||||
|
windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible
|
||||||
|
windowBorderless: bool = false, // no window decoration
|
||||||
|
windowResizable: bool = false, // window can be resized
|
||||||
|
windowMinimized: bool = false, // window is minimized
|
||||||
|
windowMaximized: bool = false, // window is maximized
|
||||||
|
windowMouseGrabbed: bool = false, // window has grabbed mouse input
|
||||||
|
windowInputFocus: bool = false, // window has input focus
|
||||||
|
windowMouseFocus: bool = false, // window has mouse focus
|
||||||
|
windowExternal: bool = false, // window not created by SDL
|
||||||
|
windowModal: bool = false, // window is modal
|
||||||
|
windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible
|
||||||
|
windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED)
|
||||||
|
windowMouseRelativeMode: bool = false, // window has relative mode enabled
|
||||||
|
windowAlwaysOnTop: bool = false, // window should always be above others
|
||||||
|
windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list
|
||||||
|
windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window
|
||||||
|
windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window
|
||||||
|
windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input
|
||||||
|
windowVulkan: bool = false, // window usable for Vulkan surface
|
||||||
|
windowMetal: bool = false, // window usable for Metal view
|
||||||
|
windowTransparent: bool = false, // window with transparent buffer
|
||||||
|
windowNotFocusable: bool = false, // window should not be focusable
|
||||||
|
pad0: u38 = 0,
|
||||||
|
rsvd: bool = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const FlashOperation = enum(c_int) {
|
||||||
|
flashCancel, //Cancel any window flash state
|
||||||
|
flashBriefly, //Flash the window briefly to get attention
|
||||||
|
flashUntilFocused, //Flash the window until it gets focus
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GLContext = *anyopaque;
|
||||||
|
|
||||||
|
pub const EGLDisplay = ?*anyopaque;
|
||||||
|
|
||||||
|
pub const EGLConfig = ?*anyopaque;
|
||||||
|
|
||||||
|
pub const EGLSurface = ?*anyopaque;
|
||||||
|
|
||||||
|
pub const EGLAttrib = isize;
|
||||||
|
|
||||||
|
pub const EGLint = c_int;
|
||||||
|
|
||||||
|
pub const EGLAttribArrayCallback = c.SDL_EGLAttribArrayCallback;
|
||||||
|
|
||||||
|
pub const EGLIntArrayCallback = c.SDL_EGLIntArrayCallback;
|
||||||
|
|
||||||
|
pub const GLAttr = enum(c_int) {
|
||||||
|
glRedSize, //the minimum number of bits for the red channel of the color buffer; defaults to 3.
|
||||||
|
glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 3.
|
||||||
|
glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 2.
|
||||||
|
glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 0.
|
||||||
|
glBufferSize, //the minimum number of bits for frame buffer size; defaults to 0.
|
||||||
|
glDoublebuffer, //whether the output is single or double buffered; defaults to double buffering on.
|
||||||
|
glDepthSize, //the minimum number of bits in the depth buffer; defaults to 16.
|
||||||
|
glStencilSize, //the minimum number of bits in the stencil buffer; defaults to 0.
|
||||||
|
glAccumRedSize, //the minimum number of bits for the red channel of the accumulation buffer; defaults to 0.
|
||||||
|
glAccumGreenSize, //the minimum number of bits for the green channel of the accumulation buffer; defaults to 0.
|
||||||
|
glAccumBlueSize, //the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0.
|
||||||
|
glAccumAlphaSize, //the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0.
|
||||||
|
glStereo, //whether the output is stereo 3D; defaults to off.
|
||||||
|
glMultisamplebuffers, //the number of buffers used for multisample anti-aliasing; defaults to 0.
|
||||||
|
glMultisamplesamples, //the number of samples used around the current pixel used for multisample anti-aliasing.
|
||||||
|
glAcceleratedVisual, //set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either.
|
||||||
|
glRetainedBacking, //not used (deprecated).
|
||||||
|
glContextMajorVersion, //OpenGL context major version.
|
||||||
|
glContextMinorVersion, //OpenGL context minor version.
|
||||||
|
glContextFlags, //some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0.
|
||||||
|
glContextProfileMask, //type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform.
|
||||||
|
glShareWithCurrentContext, //OpenGL context sharing; defaults to 0.
|
||||||
|
glFramebufferSrgbCapable, //requests sRGB capable visual; defaults to 0.
|
||||||
|
glContextReleaseBehavior, //sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH.
|
||||||
|
glContextResetNotification, //set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION.
|
||||||
|
glContextNoError,
|
||||||
|
glFloatbuffers,
|
||||||
|
glEglPlatform,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GLProfile = u32;
|
||||||
|
|
||||||
|
pub const GLContextFlag = u32;
|
||||||
|
|
||||||
|
pub const GLContextReleaseFlag = u32;
|
||||||
|
|
||||||
|
pub const GLContextResetNotification = u32;
|
||||||
|
|
||||||
|
pub inline fn getNumVideoDrivers() c_int {
|
||||||
|
return c.SDL_GetNumVideoDrivers();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getVideoDriver(index: c_int) [*c]const u8 {
|
||||||
|
return c.SDL_GetVideoDriver(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCurrentVideoDriver() [*c]const u8 {
|
||||||
|
return c.SDL_GetCurrentVideoDriver();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSystemTheme() SystemTheme {
|
||||||
|
return c.SDL_GetSystemTheme();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getDisplays(count: *c_int) ?*DisplayID {
|
||||||
|
return c.SDL_GetDisplays(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getPrimaryDisplay() DisplayID {
|
||||||
|
return c.SDL_GetPrimaryDisplay();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID {
|
||||||
|
return c.SDL_GetDisplayProperties(displayID);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 {
|
||||||
|
return c.SDL_GetDisplayName(displayID);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool {
|
||||||
|
return c.SDL_GetDisplayBounds(displayID, rect);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool {
|
||||||
|
return c.SDL_GetDisplayUsableBounds(displayID, rect);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation {
|
||||||
|
return c.SDL_GetNaturalDisplayOrientation(displayID);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation {
|
||||||
|
return c.SDL_GetCurrentDisplayOrientation(displayID);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getDisplayContentScale(displayID: DisplayID) f32 {
|
||||||
|
return c.SDL_GetDisplayContentScale(displayID);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) [*c][*c]DisplayMode {
|
||||||
|
return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getClosestFullscreenDisplayMode(displayID: DisplayID, w: c_int, h: c_int, refresh_rate: f32, include_high_density_modes: bool, mode: ?*DisplayMode) bool {
|
||||||
|
return c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, include_high_density_modes, @intFromEnum(mode));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getDesktopDisplayMode(displayID: DisplayID) *const DisplayMode {
|
||||||
|
return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCurrentDisplayMode(displayID: DisplayID) *const DisplayMode {
|
||||||
|
return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getDisplayForPoint(point: *const Point) DisplayID {
|
||||||
|
return c.SDL_GetDisplayForPoint(@ptrCast(point));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getDisplayForRect(rect: *const Rect) DisplayID {
|
||||||
|
return c.SDL_GetDisplayForRect(@ptrCast(rect));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindows(count: *c_int) [*c][*c]Window {
|
||||||
|
return c.SDL_GetWindows(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn createWindow(title: [*c]const u8, w: c_int, h: c_int, flags: WindowFlags) ?*Window {
|
||||||
|
return c.SDL_CreateWindow(title, w, h, @bitCast(flags));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window {
|
||||||
|
return c.SDL_CreateWindowWithProperties(props);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowFromID(id: WindowID) ?*Window {
|
||||||
|
return c.SDL_GetWindowFromID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGrabbedWindow() ?*Window {
|
||||||
|
return c.SDL_GetGrabbedWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const HitTestResult = enum(c_int) {
|
||||||
|
hittestNormal, //Region is normal. No special properties.
|
||||||
|
hittestDraggable, //Region can drag entire window.
|
||||||
|
hittestResizeTopleft, //Region is the resizable top-left corner border.
|
||||||
|
hittestResizeTop, //Region is the resizable top border.
|
||||||
|
hittestResizeTopright, //Region is the resizable top-right corner border.
|
||||||
|
hittestResizeRight, //Region is the resizable right border.
|
||||||
|
hittestResizeBottomright, //Region is the resizable bottom-right corner border.
|
||||||
|
hittestResizeBottom, //Region is the resizable bottom border.
|
||||||
|
hittestResizeBottomleft, //Region is the resizable bottom-left corner border.
|
||||||
|
hittestResizeLeft, //Region is the resizable left border.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const HitTest = c.SDL_HitTest;
|
||||||
|
|
||||||
|
pub inline fn screenSaverEnabled() bool {
|
||||||
|
return c.SDL_ScreenSaverEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn enableScreenSaver() bool {
|
||||||
|
return c.SDL_EnableScreenSaver();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn disableScreenSaver() bool {
|
||||||
|
return c.SDL_DisableScreenSaver();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gl_LoadLibrary(path: [*c]const u8) bool {
|
||||||
|
return c.SDL_GL_LoadLibrary(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer {
|
||||||
|
return c.SDL_GL_GetProcAddress(proc);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer {
|
||||||
|
return c.SDL_EGL_GetProcAddress(proc);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gl_UnloadLibrary() void {
|
||||||
|
return c.SDL_GL_UnloadLibrary();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool {
|
||||||
|
return c.SDL_GL_ExtensionSupported(extension);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gl_ResetAttributes() void {
|
||||||
|
return c.SDL_GL_ResetAttributes();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool {
|
||||||
|
return c.SDL_GL_SetAttribute(attr, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool {
|
||||||
|
return c.SDL_GL_GetAttribute(attr, @ptrCast(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gl_GetCurrentWindow() ?*Window {
|
||||||
|
return c.SDL_GL_GetCurrentWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gl_GetCurrentContext() GLContext {
|
||||||
|
return c.SDL_GL_GetCurrentContext();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn egl_GetCurrentDisplay() EGLDisplay {
|
||||||
|
return c.SDL_EGL_GetCurrentDisplay();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn egl_GetCurrentConfig() EGLConfig {
|
||||||
|
return c.SDL_EGL_GetCurrentConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn egl_SetAttributeCallbacks(platformAttribCallback: EGLAttribArrayCallback, surfaceAttribCallback: EGLIntArrayCallback, contextAttribCallback: EGLIntArrayCallback, userdata: ?*anyopaque) void {
|
||||||
|
return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gl_SetSwapInterval(interval: c_int) bool {
|
||||||
|
return c.SDL_GL_SetSwapInterval(interval);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gl_GetSwapInterval(interval: *c_int) bool {
|
||||||
|
return c.SDL_GL_GetSwapInterval(@ptrCast(interval));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gl_DestroyContext(context: GLContext) bool {
|
||||||
|
return c.SDL_GL_DestroyContext(context);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const TouchID = u64;
|
||||||
|
|
||||||
|
pub const FingerID = u64;
|
||||||
|
|
||||||
|
pub const TouchDeviceType = enum(c_int) {
|
||||||
|
touchDeviceDirect,
|
||||||
|
touchDeviceIndirectAbsolute,
|
||||||
|
touchDeviceIndirectRelative /* trackpad with screen cursor-relative coordinates */,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Finger = extern struct {
|
||||||
|
id: FingerID, // the finger ID
|
||||||
|
x: f32, // the x-axis location of the touch event, normalized (0...1)
|
||||||
|
y: f32, // the y-axis location of the touch event, normalized (0...1)
|
||||||
|
pressure: f32, // the quantity of pressure applied, normalized (0...1)
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn getTouchDevices(count: *c_int) ?*TouchID {
|
||||||
|
return c.SDL_GetTouchDevices(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 {
|
||||||
|
return c.SDL_GetTouchDeviceName(touchID);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType {
|
||||||
|
return @intFromEnum(c.SDL_GetTouchDeviceType(touchID));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c][*c]Finger {
|
||||||
|
return c.SDL_GetTouchFingers(touchID, @ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,825 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_audio.h",
|
||||||
|
"opaque_types": [
|
||||||
|
{
|
||||||
|
"name": "SDL_AudioStream"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"typedefs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_AudioDeviceID",
|
||||||
|
"underlying_type": "Uint32"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [
|
||||||
|
{
|
||||||
|
"name": "SDL_AudioStreamCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_AudioPostmixCallback"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"enums": [
|
||||||
|
{
|
||||||
|
"name": "SDL_AudioFormat",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_AUDIO_UNKNOWN",
|
||||||
|
"value": "0x0000u",
|
||||||
|
"comment": "Unspecified audio format"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_AUDIO_U8",
|
||||||
|
"value": "0x0008u",
|
||||||
|
"comment": "Unsigned 8-bit samples"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_AUDIO_S8",
|
||||||
|
"value": "0x8008u",
|
||||||
|
"comment": "Signed 8-bit samples"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_AUDIO_S16LE",
|
||||||
|
"value": "0x8010u",
|
||||||
|
"comment": "Signed 16-bit samples"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_AUDIO_S16BE",
|
||||||
|
"value": "0x9010u",
|
||||||
|
"comment": "As above, but big-endian byte order"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_AUDIO_S32LE",
|
||||||
|
"value": "0x8020u",
|
||||||
|
"comment": "32-bit integer samples"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_AUDIO_S32BE",
|
||||||
|
"value": "0x9020u",
|
||||||
|
"comment": "As above, but big-endian byte order"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_AUDIO_F32LE",
|
||||||
|
"value": "0x8120u",
|
||||||
|
"comment": "32-bit floating point samples"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_AUDIO_F32BE",
|
||||||
|
"value": "0x9120u",
|
||||||
|
"comment": "As above, but big-endian byte order"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"structs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_AudioSpec",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "format",
|
||||||
|
"type": "SDL_AudioFormat",
|
||||||
|
"comment": "Audio data format"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "channels",
|
||||||
|
"type": "int",
|
||||||
|
"comment": "Number of channels: 1 mono, 2 stereo, etc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "freq",
|
||||||
|
"type": "int",
|
||||||
|
"comment": "sample rate: sample frames per second"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_GetNumAudioDrivers",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAudioDriver",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "index",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetCurrentAudioDriver",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAudioPlaybackDevices",
|
||||||
|
"return_type": "SDL_AudioDeviceID *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "count",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAudioRecordingDevices",
|
||||||
|
"return_type": "SDL_AudioDeviceID *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "count",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAudioDeviceName",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "devid",
|
||||||
|
"type": "SDL_AudioDeviceID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAudioDeviceFormat",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "devid",
|
||||||
|
"type": "SDL_AudioDeviceID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "spec",
|
||||||
|
"type": "SDL_AudioSpec *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "sample_frames",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAudioDeviceChannelMap",
|
||||||
|
"return_type": "int *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "devid",
|
||||||
|
"type": "SDL_AudioDeviceID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "count",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_OpenAudioDevice",
|
||||||
|
"return_type": "SDL_AudioDeviceID",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "devid",
|
||||||
|
"type": "SDL_AudioDeviceID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "spec",
|
||||||
|
"type": "const SDL_AudioSpec *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PauseAudioDevice",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "dev",
|
||||||
|
"type": "SDL_AudioDeviceID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ResumeAudioDevice",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "dev",
|
||||||
|
"type": "SDL_AudioDeviceID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_AudioDevicePaused",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "dev",
|
||||||
|
"type": "SDL_AudioDeviceID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAudioDeviceGain",
|
||||||
|
"return_type": "float",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "devid",
|
||||||
|
"type": "SDL_AudioDeviceID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetAudioDeviceGain",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "devid",
|
||||||
|
"type": "SDL_AudioDeviceID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gain",
|
||||||
|
"type": "float"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CloseAudioDevice",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "devid",
|
||||||
|
"type": "SDL_AudioDeviceID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BindAudioStreams",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "devid",
|
||||||
|
"type": "SDL_AudioDeviceID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "streams",
|
||||||
|
"type": "SDL_AudioStream **"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "num_streams",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BindAudioStream",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "devid",
|
||||||
|
"type": "SDL_AudioDeviceID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_UnbindAudioStreams",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "streams",
|
||||||
|
"type": "SDL_AudioStream **"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "num_streams",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_UnbindAudioStream",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAudioStreamDevice",
|
||||||
|
"return_type": "SDL_AudioDeviceID",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CreateAudioStream",
|
||||||
|
"return_type": "SDL_AudioStream *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "src_spec",
|
||||||
|
"type": "const SDL_AudioSpec *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dst_spec",
|
||||||
|
"type": "const SDL_AudioSpec *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAudioStreamProperties",
|
||||||
|
"return_type": "SDL_PropertiesID",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAudioStreamFormat",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "src_spec",
|
||||||
|
"type": "SDL_AudioSpec *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dst_spec",
|
||||||
|
"type": "SDL_AudioSpec *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetAudioStreamFormat",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "src_spec",
|
||||||
|
"type": "const SDL_AudioSpec *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dst_spec",
|
||||||
|
"type": "const SDL_AudioSpec *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAudioStreamFrequencyRatio",
|
||||||
|
"return_type": "float",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetAudioStreamFrequencyRatio",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ratio",
|
||||||
|
"type": "float"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAudioStreamGain",
|
||||||
|
"return_type": "float",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetAudioStreamGain",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gain",
|
||||||
|
"type": "float"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAudioStreamInputChannelMap",
|
||||||
|
"return_type": "int *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "count",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAudioStreamOutputChannelMap",
|
||||||
|
"return_type": "int *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "count",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetAudioStreamInputChannelMap",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "chmap",
|
||||||
|
"type": "const int *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "count",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetAudioStreamOutputChannelMap",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "chmap",
|
||||||
|
"type": "const int *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "count",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PutAudioStreamData",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "buf",
|
||||||
|
"type": "const void *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "len",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAudioStreamData",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "buf",
|
||||||
|
"type": "void *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "len",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAudioStreamAvailable",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAudioStreamQueued",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_FlushAudioStream",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ClearAudioStream",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PauseAudioStreamDevice",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ResumeAudioStreamDevice",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_LockAudioStream",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_UnlockAudioStream",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetAudioStreamGetCallback",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "callback",
|
||||||
|
"type": "SDL_AudioStreamCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userdata",
|
||||||
|
"type": "void *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetAudioStreamPutCallback",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "callback",
|
||||||
|
"type": "SDL_AudioStreamCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userdata",
|
||||||
|
"type": "void *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_DestroyAudioStream",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "stream",
|
||||||
|
"type": "SDL_AudioStream *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_OpenAudioDeviceStream",
|
||||||
|
"return_type": "SDL_AudioStream *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "devid",
|
||||||
|
"type": "SDL_AudioDeviceID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "spec",
|
||||||
|
"type": "const SDL_AudioSpec *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "callback",
|
||||||
|
"type": "SDL_AudioStreamCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userdata",
|
||||||
|
"type": "void *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetAudioPostmixCallback",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "devid",
|
||||||
|
"type": "SDL_AudioDeviceID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "callback",
|
||||||
|
"type": "SDL_AudioPostmixCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userdata",
|
||||||
|
"type": "void *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_LoadWAV_IO",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "src",
|
||||||
|
"type": "SDL_IOStream *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "closeio",
|
||||||
|
"type": "bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "spec",
|
||||||
|
"type": "SDL_AudioSpec *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "audio_buf",
|
||||||
|
"type": "Uint8 **"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "audio_len",
|
||||||
|
"type": "Uint32 *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_LoadWAV",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "path",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "spec",
|
||||||
|
"type": "SDL_AudioSpec *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "audio_buf",
|
||||||
|
"type": "Uint8 **"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "audio_len",
|
||||||
|
"type": "Uint32 *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MixAudio",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "dst",
|
||||||
|
"type": "Uint8 *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "src",
|
||||||
|
"type": "const Uint8 *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "format",
|
||||||
|
"type": "SDL_AudioFormat"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "len",
|
||||||
|
"type": "Uint32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "volume",
|
||||||
|
"type": "float"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ConvertAudioSamples",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "src_spec",
|
||||||
|
"type": "const SDL_AudioSpec *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "src_data",
|
||||||
|
"type": "const Uint8 *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "src_len",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dst_spec",
|
||||||
|
"type": "const SDL_AudioSpec *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dst_data",
|
||||||
|
"type": "Uint8 **"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dst_len",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAudioFormatName",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "format",
|
||||||
|
"type": "SDL_AudioFormat"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetSilenceValueForFormat",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "format",
|
||||||
|
"type": "SDL_AudioFormat"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,132 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_blendmode.h",
|
||||||
|
"opaque_types": [],
|
||||||
|
"typedefs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_BlendMode",
|
||||||
|
"underlying_type": "Uint32"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [],
|
||||||
|
"enums": [
|
||||||
|
{
|
||||||
|
"name": "SDL_BlendOperation",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_BLENDOPERATION_ADD",
|
||||||
|
"value": "0x1",
|
||||||
|
"comment": "dst + src: supported by all renderers"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BLENDOPERATION_SUBTRACT",
|
||||||
|
"value": "0x2",
|
||||||
|
"comment": "src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BLENDOPERATION_REV_SUBTRACT",
|
||||||
|
"value": "0x3",
|
||||||
|
"comment": "dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BLENDOPERATION_MINIMUM",
|
||||||
|
"value": "0x4",
|
||||||
|
"comment": "min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BLENDOPERATION_MAXIMUM",
|
||||||
|
"value": "0x5"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BlendFactor",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_BLENDFACTOR_ZERO",
|
||||||
|
"value": "0x1",
|
||||||
|
"comment": "0, 0, 0, 0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BLENDFACTOR_ONE",
|
||||||
|
"value": "0x2",
|
||||||
|
"comment": "1, 1, 1, 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BLENDFACTOR_SRC_COLOR",
|
||||||
|
"value": "0x3",
|
||||||
|
"comment": "srcR, srcG, srcB, srcA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR",
|
||||||
|
"value": "0x4",
|
||||||
|
"comment": "1-srcR, 1-srcG, 1-srcB, 1-srcA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BLENDFACTOR_SRC_ALPHA",
|
||||||
|
"value": "0x5",
|
||||||
|
"comment": "srcA, srcA, srcA, srcA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA",
|
||||||
|
"value": "0x6",
|
||||||
|
"comment": "1-srcA, 1-srcA, 1-srcA, 1-srcA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BLENDFACTOR_DST_COLOR",
|
||||||
|
"value": "0x7",
|
||||||
|
"comment": "dstR, dstG, dstB, dstA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR",
|
||||||
|
"value": "0x8",
|
||||||
|
"comment": "1-dstR, 1-dstG, 1-dstB, 1-dstA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BLENDFACTOR_DST_ALPHA",
|
||||||
|
"value": "0x9",
|
||||||
|
"comment": "dstA, dstA, dstA, dstA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA",
|
||||||
|
"value": "0xA"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"structs": [],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_ComposeCustomBlendMode",
|
||||||
|
"return_type": "SDL_BlendMode",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "srcColorFactor",
|
||||||
|
"type": "SDL_BlendFactor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dstColorFactor",
|
||||||
|
"type": "SDL_BlendFactor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "colorOperation",
|
||||||
|
"type": "SDL_BlendOperation"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "srcAlphaFactor",
|
||||||
|
"type": "SDL_BlendFactor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dstAlphaFactor",
|
||||||
|
"type": "SDL_BlendFactor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "alphaOperation",
|
||||||
|
"type": "SDL_BlendOperation"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,233 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_camera.h",
|
||||||
|
"opaque_types": [
|
||||||
|
{
|
||||||
|
"name": "SDL_Camera"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"typedefs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_CameraID",
|
||||||
|
"underlying_type": "Uint32"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [],
|
||||||
|
"enums": [
|
||||||
|
{
|
||||||
|
"name": "SDL_CameraPosition",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_CAMERA_POSITION_UNKNOWN"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CAMERA_POSITION_FRONT_FACING"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CAMERA_POSITION_BACK_FACING"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"structs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_CameraSpec",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "format",
|
||||||
|
"type": "SDL_PixelFormat",
|
||||||
|
"comment": "Frame format"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "colorspace",
|
||||||
|
"type": "SDL_Colorspace",
|
||||||
|
"comment": "Frame colorspace"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "width",
|
||||||
|
"type": "int",
|
||||||
|
"comment": "Frame width"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "height",
|
||||||
|
"type": "int",
|
||||||
|
"comment": "Frame height"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "framerate_numerator",
|
||||||
|
"type": "int",
|
||||||
|
"comment": "Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "framerate_denominator",
|
||||||
|
"type": "int",
|
||||||
|
"comment": "Frame rate demoninator ((num / denom) == FPS, (denom / num) == duration in seconds)"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_GetNumCameraDrivers",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetCameraDriver",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "index",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetCurrentCameraDriver",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetCameras",
|
||||||
|
"return_type": "SDL_CameraID *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "count",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetCameraSupportedFormats",
|
||||||
|
"return_type": "SDL_CameraSpec **",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "devid",
|
||||||
|
"type": "SDL_CameraID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "count",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetCameraName",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_CameraID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetCameraPosition",
|
||||||
|
"return_type": "SDL_CameraPosition",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_CameraID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_OpenCamera",
|
||||||
|
"return_type": "SDL_Camera *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_CameraID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "spec",
|
||||||
|
"type": "const SDL_CameraSpec *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetCameraPermissionState",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "camera",
|
||||||
|
"type": "SDL_Camera *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetCameraID",
|
||||||
|
"return_type": "SDL_CameraID",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "camera",
|
||||||
|
"type": "SDL_Camera *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetCameraProperties",
|
||||||
|
"return_type": "SDL_PropertiesID",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "camera",
|
||||||
|
"type": "SDL_Camera *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetCameraFormat",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "camera",
|
||||||
|
"type": "SDL_Camera *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "spec",
|
||||||
|
"type": "SDL_CameraSpec *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_AcquireCameraFrame",
|
||||||
|
"return_type": "SDL_Surface *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "camera",
|
||||||
|
"type": "SDL_Camera *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "timestampNS",
|
||||||
|
"type": "Uint64 *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ReleaseCameraFrame",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "camera",
|
||||||
|
"type": "SDL_Camera *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "frame",
|
||||||
|
"type": "SDL_Surface *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CloseCamera",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "camera",
|
||||||
|
"type": "SDL_Camera *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,125 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_clipboard.h",
|
||||||
|
"opaque_types": [],
|
||||||
|
"typedefs": [],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [
|
||||||
|
{
|
||||||
|
"name": "SDL_ClipboardDataCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ClipboardCleanupCallback"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"enums": [],
|
||||||
|
"structs": [],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_SetClipboardText",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "text",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetClipboardText",
|
||||||
|
"return_type": "char *",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_HasClipboardText",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetPrimarySelectionText",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "text",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetPrimarySelectionText",
|
||||||
|
"return_type": "char *",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_HasPrimarySelectionText",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetClipboardData",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "callback",
|
||||||
|
"type": "SDL_ClipboardDataCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "cleanup",
|
||||||
|
"type": "SDL_ClipboardCleanupCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userdata",
|
||||||
|
"type": "void *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "mime_types",
|
||||||
|
"type": "const char **"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "num_mime_types",
|
||||||
|
"type": "size_t"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ClearClipboardData",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetClipboardData",
|
||||||
|
"return_type": "void *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "mime_type",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "size",
|
||||||
|
"type": "size_t *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_HasClipboardData",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "mime_type",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetClipboardMimeTypes",
|
||||||
|
"return_type": "char **",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "num_mime_types",
|
||||||
|
"type": "size_t *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,121 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_dialog.h",
|
||||||
|
"opaque_types": [],
|
||||||
|
"typedefs": [],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [
|
||||||
|
{
|
||||||
|
"name": "SDL_DialogFileCallback"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"enums": [],
|
||||||
|
"structs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_DialogFileFilter",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "pattern",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_ShowOpenFileDialog",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "callback",
|
||||||
|
"type": "SDL_DialogFileCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userdata",
|
||||||
|
"type": "void *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "window",
|
||||||
|
"type": "SDL_Window *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "filters",
|
||||||
|
"type": "const SDL_DialogFileFilter *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "nfilters",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "default_location",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "allow_many",
|
||||||
|
"type": "bool"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ShowSaveFileDialog",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "callback",
|
||||||
|
"type": "SDL_DialogFileCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userdata",
|
||||||
|
"type": "void *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "window",
|
||||||
|
"type": "SDL_Window *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "filters",
|
||||||
|
"type": "const SDL_DialogFileFilter *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "nfilters",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "default_location",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ShowOpenFolderDialog",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "callback",
|
||||||
|
"type": "SDL_DialogFileCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userdata",
|
||||||
|
"type": "void *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "window",
|
||||||
|
"type": "SDL_Window *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "default_location",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "allow_many",
|
||||||
|
"type": "bool"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_endian.h",
|
||||||
|
"opaque_types": [],
|
||||||
|
"typedefs": [],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [],
|
||||||
|
"enums": [],
|
||||||
|
"structs": [],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": []
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_error.h",
|
||||||
|
"opaque_types": [],
|
||||||
|
"typedefs": [],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [],
|
||||||
|
"enums": [],
|
||||||
|
"structs": [],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_OutOfMemory",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetError",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ClearError",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,279 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_filesystem.h",
|
||||||
|
"opaque_types": [],
|
||||||
|
"typedefs": [],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [
|
||||||
|
{
|
||||||
|
"name": "SDL_EnumerateDirectoryCallback"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"enums": [
|
||||||
|
{
|
||||||
|
"name": "SDL_Folder",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_FOLDER_HOME",
|
||||||
|
"comment": "The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_FOLDER_DESKTOP",
|
||||||
|
"comment": "The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_FOLDER_DOCUMENTS",
|
||||||
|
"comment": "User document files, possibly application-specific. This is a good place to save a user's projects."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_FOLDER_DOWNLOADS",
|
||||||
|
"comment": "Standard folder for user files downloaded from the internet."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_FOLDER_MUSIC",
|
||||||
|
"comment": "Music files that can be played using a standard music player (mp3, ogg...)."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_FOLDER_PICTURES",
|
||||||
|
"comment": "Image files that can be displayed using a standard viewer (png, jpg...)."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_FOLDER_PUBLICSHARE",
|
||||||
|
"comment": "Files that are meant to be shared with other users on the same computer."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_FOLDER_SAVEDGAMES",
|
||||||
|
"comment": "Save files for games."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_FOLDER_SCREENSHOTS",
|
||||||
|
"comment": "Application screenshots."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_FOLDER_TEMPLATES",
|
||||||
|
"comment": "Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as \"New Text File.txt\". Any file in the Templates folder can be used as a starting point for a new file."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_FOLDER_VIDEOS",
|
||||||
|
"comment": "Video files that can be played using a standard video player (mp4, webm...)."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_FOLDER_COUNT"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PathType",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_PATHTYPE_NONE",
|
||||||
|
"comment": "path does not exist"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PATHTYPE_FILE",
|
||||||
|
"comment": "a normal file"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PATHTYPE_DIRECTORY",
|
||||||
|
"comment": "a directory"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PATHTYPE_OTHER"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_EnumerationResult",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_ENUM_CONTINUE",
|
||||||
|
"comment": "Value that requests that enumeration continue."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ENUM_SUCCESS",
|
||||||
|
"comment": "Value that requests that enumeration stop, successfully."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ENUM_FAILURE"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"structs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_PathInfo",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "_type",
|
||||||
|
"type": "SDL_PathType",
|
||||||
|
"comment": "the path type"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "size",
|
||||||
|
"type": "Uint64",
|
||||||
|
"comment": "the file size in bytes"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "create_time",
|
||||||
|
"type": "SDL_Time",
|
||||||
|
"comment": "the time when the path was created"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "modify_time",
|
||||||
|
"type": "SDL_Time",
|
||||||
|
"comment": "the last time the path was modified"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "access_time",
|
||||||
|
"type": "SDL_Time",
|
||||||
|
"comment": "the last time the path was read"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [
|
||||||
|
{
|
||||||
|
"name": "SDL_GlobFlags",
|
||||||
|
"underlying_type": "Uint32",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_GLOB_CASEINSENSITIVE",
|
||||||
|
"value": "(1u << 0)"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_GetBasePath",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetPrefPath",
|
||||||
|
"return_type": "char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "org",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "app",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetUserFolder",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "folder",
|
||||||
|
"type": "SDL_Folder"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CreateDirectory",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "path",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_EnumerateDirectory",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "path",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "callback",
|
||||||
|
"type": "SDL_EnumerateDirectoryCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userdata",
|
||||||
|
"type": "void *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_RemovePath",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "path",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_RenamePath",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "oldpath",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "newpath",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CopyFile",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "oldpath",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "newpath",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetPathInfo",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "path",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "info",
|
||||||
|
"type": "SDL_PathInfo *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GlobDirectory",
|
||||||
|
"return_type": "char **",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "path",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "pattern",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "flags",
|
||||||
|
"type": "SDL_GlobFlags"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "count",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,786 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_haptic.h",
|
||||||
|
"opaque_types": [
|
||||||
|
{
|
||||||
|
"name": "SDL_Haptic"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"typedefs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_HapticID",
|
||||||
|
"underlying_type": "Uint32"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [],
|
||||||
|
"enums": [],
|
||||||
|
"structs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_HapticDirection",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "_type",
|
||||||
|
"type": "Uint8",
|
||||||
|
"comment": "The type of encoding."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dir",
|
||||||
|
"type": "Sint32[3]",
|
||||||
|
"comment": "The encoded direction."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_HapticConstant",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "_type",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "SDL_HAPTIC_CONSTANT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "direction",
|
||||||
|
"type": "SDL_HapticDirection",
|
||||||
|
"comment": "Direction of the effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "length",
|
||||||
|
"type": "Uint32",
|
||||||
|
"comment": "Duration of the effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "delay",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Delay before starting the effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "button",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Button that triggers the effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "interval",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "How soon it can be triggered again after button."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "level",
|
||||||
|
"type": "Sint16",
|
||||||
|
"comment": "Strength of the constant effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "attack_length",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Duration of the attack."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "attack_level",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Level at the start of the attack."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "fade_length",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Duration of the fade."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "fade_level",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Level at the end of the fade."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_HapticPeriodic",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "direction",
|
||||||
|
"type": "SDL_HapticDirection",
|
||||||
|
"comment": "Direction of the effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "length",
|
||||||
|
"type": "Uint32",
|
||||||
|
"comment": "Duration of the effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "delay",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Delay before starting the effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "button",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Button that triggers the effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "interval",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "How soon it can be triggered again after button."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "period",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Period of the wave."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "magnitude",
|
||||||
|
"type": "Sint16",
|
||||||
|
"comment": "Peak value; if negative, equivalent to 180 degrees extra phase shift."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "offset",
|
||||||
|
"type": "Sint16",
|
||||||
|
"comment": "Mean value of the wave."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "phase",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Positive phase shift given by hundredth of a degree."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "attack_length",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Duration of the attack."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "attack_level",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Level at the start of the attack."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "fade_length",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Duration of the fade."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "fade_level",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Level at the end of the fade."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_HapticCondition",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "direction",
|
||||||
|
"type": "SDL_HapticDirection",
|
||||||
|
"comment": "Direction of the effect - Not used ATM."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "length",
|
||||||
|
"type": "Uint32",
|
||||||
|
"comment": "Duration of the effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "delay",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Delay before starting the effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "button",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Button that triggers the effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "interval",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "How soon it can be triggered again after button."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "right_sat",
|
||||||
|
"type": "Uint16[3]",
|
||||||
|
"comment": "Level when joystick is to the positive side; max 0xFFFF."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "left_sat",
|
||||||
|
"type": "Uint16[3]",
|
||||||
|
"comment": "Level when joystick is to the negative side; max 0xFFFF."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "right_coeff",
|
||||||
|
"type": "Sint16[3]",
|
||||||
|
"comment": "How fast to increase the force towards the positive side."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "left_coeff",
|
||||||
|
"type": "Sint16[3]",
|
||||||
|
"comment": "How fast to increase the force towards the negative side."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "deadband",
|
||||||
|
"type": "Uint16[3]",
|
||||||
|
"comment": "Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "center",
|
||||||
|
"type": "Sint16[3]",
|
||||||
|
"comment": "Position of the dead zone."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_HapticRamp",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "_type",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "SDL_HAPTIC_RAMP"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "direction",
|
||||||
|
"type": "SDL_HapticDirection",
|
||||||
|
"comment": "Direction of the effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "length",
|
||||||
|
"type": "Uint32",
|
||||||
|
"comment": "Duration of the effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "delay",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Delay before starting the effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "button",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Button that triggers the effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "interval",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "How soon it can be triggered again after button."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "start",
|
||||||
|
"type": "Sint16",
|
||||||
|
"comment": "Beginning strength level."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "end",
|
||||||
|
"type": "Sint16",
|
||||||
|
"comment": "Ending strength level."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "attack_length",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Duration of the attack."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "attack_level",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Level at the start of the attack."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "fade_length",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Duration of the fade."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "fade_level",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Level at the end of the fade."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_HapticLeftRight",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "_type",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "SDL_HAPTIC_LEFTRIGHT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "length",
|
||||||
|
"type": "Uint32",
|
||||||
|
"comment": "Duration of the effect in milliseconds."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "large_magnitude",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Control of the large controller motor."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "small_magnitude",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Control of the small controller motor."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_HapticCustom",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "_type",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "SDL_HAPTIC_CUSTOM"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "direction",
|
||||||
|
"type": "SDL_HapticDirection",
|
||||||
|
"comment": "Direction of the effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "length",
|
||||||
|
"type": "Uint32",
|
||||||
|
"comment": "Duration of the effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "delay",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Delay before starting the effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "button",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Button that triggers the effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "interval",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "How soon it can be triggered again after button."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "channels",
|
||||||
|
"type": "Uint8",
|
||||||
|
"comment": "Axes to use, minimum of one."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "period",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Sample periods."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "samples",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Amount of samples."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "data",
|
||||||
|
"type": "Uint16 *",
|
||||||
|
"comment": "Should contain channels*samples items."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "attack_length",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Duration of the attack."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "attack_level",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Level at the start of the attack."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "fade_length",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Duration of the fade."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "fade_level",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Level at the end of the fade."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"unions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_HapticEffect",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "_type",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "Effect type."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "constant",
|
||||||
|
"type": "SDL_HapticConstant",
|
||||||
|
"comment": "Constant effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "periodic",
|
||||||
|
"type": "SDL_HapticPeriodic",
|
||||||
|
"comment": "Periodic effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "condition",
|
||||||
|
"type": "SDL_HapticCondition",
|
||||||
|
"comment": "Condition effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ramp",
|
||||||
|
"type": "SDL_HapticRamp",
|
||||||
|
"comment": "Ramp effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "leftright",
|
||||||
|
"type": "SDL_HapticLeftRight",
|
||||||
|
"comment": "Left/Right effect."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "custom",
|
||||||
|
"type": "SDL_HapticCustom",
|
||||||
|
"comment": "Custom effect."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"flags": [],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_GetHaptics",
|
||||||
|
"return_type": "SDL_HapticID *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "count",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetHapticNameForID",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_HapticID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_OpenHaptic",
|
||||||
|
"return_type": "SDL_Haptic *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_HapticID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetHapticFromID",
|
||||||
|
"return_type": "SDL_Haptic *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_HapticID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetHapticID",
|
||||||
|
"return_type": "SDL_HapticID",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetHapticName",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_IsMouseHaptic",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_OpenHapticFromMouse",
|
||||||
|
"return_type": "SDL_Haptic *",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_IsJoystickHaptic",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_OpenHapticFromJoystick",
|
||||||
|
"return_type": "SDL_Haptic *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CloseHaptic",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetMaxHapticEffects",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetMaxHapticEffectsPlaying",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetHapticFeatures",
|
||||||
|
"return_type": "Uint32",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetNumHapticAxes",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_HapticEffectSupported",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "effect",
|
||||||
|
"type": "const SDL_HapticEffect *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CreateHapticEffect",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "effect",
|
||||||
|
"type": "const SDL_HapticEffect *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_UpdateHapticEffect",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "effect",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "data",
|
||||||
|
"type": "const SDL_HapticEffect *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_RunHapticEffect",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "effect",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "iterations",
|
||||||
|
"type": "Uint32"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_StopHapticEffect",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "effect",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_DestroyHapticEffect",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "effect",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetHapticEffectStatus",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "effect",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetHapticGain",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gain",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetHapticAutocenter",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "autocenter",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PauseHaptic",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ResumeHaptic",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_StopHapticEffects",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_HapticRumbleSupported",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_InitHapticRumble",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PlayHapticRumble",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "strength",
|
||||||
|
"type": "float"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "length",
|
||||||
|
"type": "Uint32"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_StopHapticRumble",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "haptic",
|
||||||
|
"type": "SDL_Haptic *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,139 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_hints.h",
|
||||||
|
"opaque_types": [],
|
||||||
|
"typedefs": [],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [
|
||||||
|
{
|
||||||
|
"name": "SDL_HintCallback"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"enums": [
|
||||||
|
{
|
||||||
|
"name": "SDL_HintPriority",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_HINT_DEFAULT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_HINT_NORMAL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_HINT_OVERRIDE"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"structs": [],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_SetHintWithPriority",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "value",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "priority",
|
||||||
|
"type": "SDL_HintPriority"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetHint",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "value",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ResetHint",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ResetHints",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetHint",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetHintBoolean",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "default_value",
|
||||||
|
"type": "bool"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_AddHintCallback",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "callback",
|
||||||
|
"type": "SDL_HintCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userdata",
|
||||||
|
"type": "void *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_RemoveHintCallback",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "callback",
|
||||||
|
"type": "SDL_HintCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userdata",
|
||||||
|
"type": "void *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,176 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_init.h",
|
||||||
|
"opaque_types": [],
|
||||||
|
"typedefs": [],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [
|
||||||
|
{
|
||||||
|
"name": "SDL_AppInit_func"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_AppIterate_func"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_AppEvent_func"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_AppQuit_func"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"enums": [
|
||||||
|
{
|
||||||
|
"name": "SDL_AppResult",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_APP_CONTINUE",
|
||||||
|
"comment": "Value that requests that the app continue from the main callbacks."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_APP_SUCCESS",
|
||||||
|
"comment": "Value that requests termination with success from the main callbacks."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_APP_FAILURE",
|
||||||
|
"comment": "Value that requests termination with error from the main callbacks."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"structs": [],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [
|
||||||
|
{
|
||||||
|
"name": "SDL_InitFlags",
|
||||||
|
"underlying_type": "Uint32",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_INIT_AUDIO",
|
||||||
|
"value": "0x00000010u",
|
||||||
|
"comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_INIT_VIDEO",
|
||||||
|
"value": "0x00000020u",
|
||||||
|
"comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_INIT_JOYSTICK",
|
||||||
|
"value": "0x00000200u",
|
||||||
|
"comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_INIT_HAPTIC",
|
||||||
|
"value": "0x00001000u"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_INIT_GAMEPAD",
|
||||||
|
"value": "0x00002000u",
|
||||||
|
"comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_INIT_EVENTS",
|
||||||
|
"value": "0x00004000u"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_INIT_SENSOR",
|
||||||
|
"value": "0x00008000u",
|
||||||
|
"comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_INIT_CAMERA",
|
||||||
|
"value": "0x00010000u",
|
||||||
|
"comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_Init",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "flags",
|
||||||
|
"type": "SDL_InitFlags"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_InitSubSystem",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "flags",
|
||||||
|
"type": "SDL_InitFlags"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_QuitSubSystem",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "flags",
|
||||||
|
"type": "SDL_InitFlags"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_WasInit",
|
||||||
|
"return_type": "SDL_InitFlags",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "flags",
|
||||||
|
"type": "SDL_InitFlags"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_Quit",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetAppMetadata",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "appname",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "appversion",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "appidentifier",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetAppMetadataProperty",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "value",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAppMetadataProperty",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,961 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_joystick.h",
|
||||||
|
"opaque_types": [
|
||||||
|
{
|
||||||
|
"name": "SDL_Joystick"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"typedefs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_JoystickID",
|
||||||
|
"underlying_type": "Uint32"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [],
|
||||||
|
"enums": [
|
||||||
|
{
|
||||||
|
"name": "SDL_JoystickType",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_JOYSTICK_TYPE_UNKNOWN"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_JOYSTICK_TYPE_GAMEPAD"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_JOYSTICK_TYPE_WHEEL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_JOYSTICK_TYPE_ARCADE_STICK"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_JOYSTICK_TYPE_FLIGHT_STICK"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_JOYSTICK_TYPE_DANCE_PAD"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_JOYSTICK_TYPE_GUITAR"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_JOYSTICK_TYPE_DRUM_KIT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_JOYSTICK_TYPE_ARCADE_PAD"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_JOYSTICK_TYPE_THROTTLE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_JOYSTICK_TYPE_COUNT"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_JoystickConnectionState",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_JOYSTICK_CONNECTION_UNKNOWN"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_JOYSTICK_CONNECTION_WIRED"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_JOYSTICK_CONNECTION_WIRELESS"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"structs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_VirtualJoystickTouchpadDesc",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "nfingers",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "the number of simultaneous fingers on this touchpad"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "padding",
|
||||||
|
"type": "Uint16[3]"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_VirtualJoystickSensorDesc",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "_type",
|
||||||
|
"type": "SDL_SensorType",
|
||||||
|
"comment": "the type of this sensor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "rate",
|
||||||
|
"type": "float",
|
||||||
|
"comment": "the update frequency of this sensor, may be 0.0f"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_VirtualJoystickDesc",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "version",
|
||||||
|
"type": "Uint32",
|
||||||
|
"comment": "the version of this interface"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "_type",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "`SDL_JoystickType`"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "padding",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "unused"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vendor_id",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "the USB vendor ID of this joystick"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "product_id",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "the USB product ID of this joystick"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "naxes",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "the number of axes on this joystick"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "nbuttons",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "the number of buttons on this joystick"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "nballs",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "the number of balls on this joystick"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "nhats",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "the number of hats on this joystick"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ntouchpads",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "nsensors",
|
||||||
|
"type": "Uint16",
|
||||||
|
"comment": "the number of sensors on this joystick, requires `sensors` to point at valid descriptions"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "padding2",
|
||||||
|
"type": "Uint16[2]",
|
||||||
|
"comment": "unused"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *",
|
||||||
|
"comment": "the name of the joystick"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "touchpads",
|
||||||
|
"type": "const SDL_VirtualJoystickTouchpadDesc *",
|
||||||
|
"comment": "A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "sensors",
|
||||||
|
"type": "const SDL_VirtualJoystickSensorDesc *",
|
||||||
|
"comment": "A pointer to an array of sensor descriptions, required if `nsensors` is > 0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userdata",
|
||||||
|
"type": "void *",
|
||||||
|
"comment": "User data pointer passed to callbacks"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Update",
|
||||||
|
"type": "void (SDLCALL *Update)(void *userdata)",
|
||||||
|
"comment": "Called when the joystick state should be updated"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SetPlayerIndex",
|
||||||
|
"type": "void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index)",
|
||||||
|
"comment": "Called when the player index is set"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Rumble",
|
||||||
|
"type": "bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)",
|
||||||
|
"comment": "Implements SDL_RumbleJoystick()"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "RumbleTriggers",
|
||||||
|
"type": "bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble)",
|
||||||
|
"comment": "Implements SDL_RumbleJoystickTriggers()"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SetLED",
|
||||||
|
"type": "bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue)",
|
||||||
|
"comment": "Implements SDL_SetJoystickLED()"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SendEffect",
|
||||||
|
"type": "bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size)",
|
||||||
|
"comment": "Implements SDL_SendJoystickEffect()"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SetSensorsEnabled",
|
||||||
|
"type": "bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled)",
|
||||||
|
"comment": "Implements SDL_SetGamepadSensorEnabled()"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Cleanup",
|
||||||
|
"type": "void (SDLCALL *Cleanup)(void *userdata)",
|
||||||
|
"comment": "Cleans up the userdata when the joystick is detached"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_LockJoysticks",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_UnlockJoysticks",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_HasJoystick",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoysticks",
|
||||||
|
"return_type": "SDL_JoystickID *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "count",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickNameForID",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_JoystickID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickPathForID",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_JoystickID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickPlayerIndexForID",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_JoystickID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickGUIDForID",
|
||||||
|
"return_type": "SDL_GUID",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_JoystickID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickVendorForID",
|
||||||
|
"return_type": "Uint16",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_JoystickID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickProductForID",
|
||||||
|
"return_type": "Uint16",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_JoystickID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickProductVersionForID",
|
||||||
|
"return_type": "Uint16",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_JoystickID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickTypeForID",
|
||||||
|
"return_type": "SDL_JoystickType",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_JoystickID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_OpenJoystick",
|
||||||
|
"return_type": "SDL_Joystick *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_JoystickID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickFromID",
|
||||||
|
"return_type": "SDL_Joystick *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_JoystickID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickFromPlayerIndex",
|
||||||
|
"return_type": "SDL_Joystick *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "player_index",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_AttachVirtualJoystick",
|
||||||
|
"return_type": "SDL_JoystickID",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "desc",
|
||||||
|
"type": "const SDL_VirtualJoystickDesc *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_DetachVirtualJoystick",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_JoystickID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_IsJoystickVirtual",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_JoystickID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetJoystickVirtualAxis",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "axis",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "value",
|
||||||
|
"type": "Sint16"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetJoystickVirtualBall",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ball",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "xrel",
|
||||||
|
"type": "Sint16"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "yrel",
|
||||||
|
"type": "Sint16"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetJoystickVirtualButton",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "button",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "down",
|
||||||
|
"type": "bool"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetJoystickVirtualHat",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hat",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "value",
|
||||||
|
"type": "Uint8"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetJoystickVirtualTouchpad",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "touchpad",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "finger",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "down",
|
||||||
|
"type": "bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "x",
|
||||||
|
"type": "float"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "y",
|
||||||
|
"type": "float"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "pressure",
|
||||||
|
"type": "float"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SendJoystickVirtualSensorData",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "_type",
|
||||||
|
"type": "SDL_SensorType"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "sensor_timestamp",
|
||||||
|
"type": "Uint64"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "data",
|
||||||
|
"type": "const float *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "num_values",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickProperties",
|
||||||
|
"return_type": "SDL_PropertiesID",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickName",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickPath",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickPlayerIndex",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetJoystickPlayerIndex",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "player_index",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickGUID",
|
||||||
|
"return_type": "SDL_GUID",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickVendor",
|
||||||
|
"return_type": "Uint16",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickProduct",
|
||||||
|
"return_type": "Uint16",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickProductVersion",
|
||||||
|
"return_type": "Uint16",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickFirmwareVersion",
|
||||||
|
"return_type": "Uint16",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickSerial",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickType",
|
||||||
|
"return_type": "SDL_JoystickType",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickGUIDInfo",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "guid",
|
||||||
|
"type": "SDL_GUID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vendor",
|
||||||
|
"type": "Uint16 *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "product",
|
||||||
|
"type": "Uint16 *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "version",
|
||||||
|
"type": "Uint16 *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "crc16",
|
||||||
|
"type": "Uint16 *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_JoystickConnected",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickID",
|
||||||
|
"return_type": "SDL_JoystickID",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetNumJoystickAxes",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetNumJoystickBalls",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetNumJoystickHats",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetNumJoystickButtons",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetJoystickEventsEnabled",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "enabled",
|
||||||
|
"type": "bool"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_JoystickEventsEnabled",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_UpdateJoysticks",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickAxis",
|
||||||
|
"return_type": "Sint16",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "axis",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickAxisInitialState",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "axis",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "state",
|
||||||
|
"type": "Sint16 *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickBall",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ball",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dx",
|
||||||
|
"type": "int *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dy",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickHat",
|
||||||
|
"return_type": "Uint8",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hat",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickButton",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "button",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_RumbleJoystick",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "low_frequency_rumble",
|
||||||
|
"type": "Uint16"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "high_frequency_rumble",
|
||||||
|
"type": "Uint16"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "duration_ms",
|
||||||
|
"type": "Uint32"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_RumbleJoystickTriggers",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "left_rumble",
|
||||||
|
"type": "Uint16"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "right_rumble",
|
||||||
|
"type": "Uint16"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "duration_ms",
|
||||||
|
"type": "Uint32"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetJoystickLED",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "red",
|
||||||
|
"type": "Uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "green",
|
||||||
|
"type": "Uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "blue",
|
||||||
|
"type": "Uint8"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SendJoystickEffect",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "data",
|
||||||
|
"type": "const void *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "size",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CloseJoystick",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickConnectionState",
|
||||||
|
"return_type": "SDL_JoystickConnectionState",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetJoystickPowerInfo",
|
||||||
|
"return_type": "SDL_PowerState",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "joystick",
|
||||||
|
"type": "SDL_Joystick *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "percent",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_keycode.h",
|
||||||
|
"opaque_types": [],
|
||||||
|
"typedefs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_Keycode",
|
||||||
|
"underlying_type": "Uint32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_Keymod",
|
||||||
|
"underlying_type": "Uint16"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [],
|
||||||
|
"enums": [],
|
||||||
|
"structs": [],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": []
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_loadso.h",
|
||||||
|
"opaque_types": [
|
||||||
|
{
|
||||||
|
"name": "SDL_SharedObject"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"typedefs": [],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [],
|
||||||
|
"enums": [],
|
||||||
|
"structs": [],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_LoadObject",
|
||||||
|
"return_type": "SDL_SharedObject *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "sofile",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_LoadFunction",
|
||||||
|
"return_type": "SDL_FunctionPointer",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "handle",
|
||||||
|
"type": "SDL_SharedObject *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_UnloadObject",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "handle",
|
||||||
|
"type": "SDL_SharedObject *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,205 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_messagebox.h",
|
||||||
|
"opaque_types": [],
|
||||||
|
"typedefs": [],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [],
|
||||||
|
"enums": [
|
||||||
|
{
|
||||||
|
"name": "SDL_MessageBoxColorType",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_MESSAGEBOX_COLOR_BACKGROUND"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MESSAGEBOX_COLOR_TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MESSAGEBOX_COLOR_COUNT",
|
||||||
|
"comment": "Size of the colors array of SDL_MessageBoxColorScheme."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"structs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_MessageBoxButtonData",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "flags",
|
||||||
|
"type": "SDL_MessageBoxButtonFlags"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "buttonID",
|
||||||
|
"type": "int",
|
||||||
|
"comment": "User defined button id (value returned via SDL_ShowMessageBox)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "text",
|
||||||
|
"type": "const char *",
|
||||||
|
"comment": "The UTF-8 button text"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MessageBoxColor",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "r",
|
||||||
|
"type": "Uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "g",
|
||||||
|
"type": "Uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "b",
|
||||||
|
"type": "Uint8"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MessageBoxColorScheme",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "colors",
|
||||||
|
"type": "SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_COUNT]"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MessageBoxData",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "flags",
|
||||||
|
"type": "SDL_MessageBoxFlags"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "window",
|
||||||
|
"type": "SDL_Window *",
|
||||||
|
"comment": "Parent window, can be NULL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "title",
|
||||||
|
"type": "const char *",
|
||||||
|
"comment": "UTF-8 title"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "message",
|
||||||
|
"type": "const char *",
|
||||||
|
"comment": "UTF-8 message text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "numbuttons",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "buttons",
|
||||||
|
"type": "const SDL_MessageBoxButtonData *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "colorScheme",
|
||||||
|
"type": "const SDL_MessageBoxColorScheme *",
|
||||||
|
"comment": "SDL_MessageBoxColorScheme, can be NULL to use system settings"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [
|
||||||
|
{
|
||||||
|
"name": "SDL_MessageBoxFlags",
|
||||||
|
"underlying_type": "Uint32",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_MESSAGEBOX_ERROR",
|
||||||
|
"value": "0x00000010u",
|
||||||
|
"comment": "error dialog"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MESSAGEBOX_WARNING",
|
||||||
|
"value": "0x00000020u",
|
||||||
|
"comment": "warning dialog"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MESSAGEBOX_INFORMATION",
|
||||||
|
"value": "0x00000040u",
|
||||||
|
"comment": "informational dialog"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT",
|
||||||
|
"value": "0x00000080u",
|
||||||
|
"comment": "buttons placed left to right"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT",
|
||||||
|
"value": "0x00000100u",
|
||||||
|
"comment": "buttons placed right to left"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MessageBoxButtonFlags",
|
||||||
|
"underlying_type": "Uint32",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT",
|
||||||
|
"value": "0x00000001u",
|
||||||
|
"comment": "Marks the default button when return is hit"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT",
|
||||||
|
"value": "0x00000002u",
|
||||||
|
"comment": "Marks the default button when escape is hit"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_ShowMessageBox",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "messageboxdata",
|
||||||
|
"type": "const SDL_MessageBoxData *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "buttonid",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ShowSimpleMessageBox",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "flags",
|
||||||
|
"type": "SDL_MessageBoxFlags"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "title",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "message",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "window",
|
||||||
|
"type": "SDL_Window *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_misc.h",
|
||||||
|
"opaque_types": [],
|
||||||
|
"typedefs": [],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [],
|
||||||
|
"enums": [],
|
||||||
|
"structs": [],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_OpenURL",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "url",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,392 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_mouse.h",
|
||||||
|
"opaque_types": [
|
||||||
|
{
|
||||||
|
"name": "SDL_Cursor"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"typedefs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_MouseID",
|
||||||
|
"underlying_type": "Uint32"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [],
|
||||||
|
"enums": [
|
||||||
|
{
|
||||||
|
"name": "SDL_SystemCursor",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_SYSTEM_CURSOR_DEFAULT",
|
||||||
|
"comment": "Default cursor. Usually an arrow."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SYSTEM_CURSOR_TEXT",
|
||||||
|
"comment": "Text selection. Usually an I-beam."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SYSTEM_CURSOR_WAIT",
|
||||||
|
"comment": "Wait. Usually an hourglass or watch or spinning ball."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SYSTEM_CURSOR_CROSSHAIR",
|
||||||
|
"comment": "Crosshair."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SYSTEM_CURSOR_PROGRESS",
|
||||||
|
"comment": "Program is busy but still interactive. Usually it's WAIT with an arrow."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SYSTEM_CURSOR_NWSE_RESIZE",
|
||||||
|
"comment": "Double arrow pointing northwest and southeast."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SYSTEM_CURSOR_NESW_RESIZE",
|
||||||
|
"comment": "Double arrow pointing northeast and southwest."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SYSTEM_CURSOR_EW_RESIZE",
|
||||||
|
"comment": "Double arrow pointing west and east."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SYSTEM_CURSOR_NS_RESIZE",
|
||||||
|
"comment": "Double arrow pointing north and south."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SYSTEM_CURSOR_MOVE",
|
||||||
|
"comment": "Four pointed arrow pointing north, south, east, and west."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SYSTEM_CURSOR_NOT_ALLOWED",
|
||||||
|
"comment": "Not permitted. Usually a slashed circle or crossbones."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SYSTEM_CURSOR_POINTER",
|
||||||
|
"comment": "Pointer that indicates a link. Usually a pointing hand."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SYSTEM_CURSOR_NW_RESIZE",
|
||||||
|
"comment": "Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SYSTEM_CURSOR_N_RESIZE",
|
||||||
|
"comment": "Window resize top. May be NS_RESIZE."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SYSTEM_CURSOR_NE_RESIZE",
|
||||||
|
"comment": "Window resize top-right. May be NESW_RESIZE."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SYSTEM_CURSOR_E_RESIZE",
|
||||||
|
"comment": "Window resize right. May be EW_RESIZE."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SYSTEM_CURSOR_SE_RESIZE",
|
||||||
|
"comment": "Window resize bottom-right. May be NWSE_RESIZE."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SYSTEM_CURSOR_S_RESIZE",
|
||||||
|
"comment": "Window resize bottom. May be NS_RESIZE."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SYSTEM_CURSOR_SW_RESIZE",
|
||||||
|
"comment": "Window resize bottom-left. May be NESW_RESIZE."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SYSTEM_CURSOR_W_RESIZE",
|
||||||
|
"comment": "Window resize left. May be EW_RESIZE."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SYSTEM_CURSOR_COUNT"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MouseWheelDirection",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_MOUSEWHEEL_NORMAL",
|
||||||
|
"comment": "The scroll direction is normal"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MOUSEWHEEL_FLIPPED",
|
||||||
|
"comment": "The scroll direction is flipped / natural"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"structs": [],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [
|
||||||
|
{
|
||||||
|
"name": "SDL_MouseButtonFlags",
|
||||||
|
"underlying_type": "Uint32",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_BUTTON_LEFT",
|
||||||
|
"value": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BUTTON_MIDDLE",
|
||||||
|
"value": "2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BUTTON_RIGHT",
|
||||||
|
"value": "3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BUTTON_X1",
|
||||||
|
"value": "4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BUTTON_X2",
|
||||||
|
"value": "5"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_HasMouse",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetMice",
|
||||||
|
"return_type": "SDL_MouseID *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "count",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetMouseNameForID",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_MouseID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetMouseFocus",
|
||||||
|
"return_type": "SDL_Window *",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetMouseState",
|
||||||
|
"return_type": "SDL_MouseButtonFlags",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "x",
|
||||||
|
"type": "float *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "y",
|
||||||
|
"type": "float *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetGlobalMouseState",
|
||||||
|
"return_type": "SDL_MouseButtonFlags",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "x",
|
||||||
|
"type": "float *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "y",
|
||||||
|
"type": "float *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetRelativeMouseState",
|
||||||
|
"return_type": "SDL_MouseButtonFlags",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "x",
|
||||||
|
"type": "float *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "y",
|
||||||
|
"type": "float *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_WarpMouseInWindow",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "window",
|
||||||
|
"type": "SDL_Window *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "x",
|
||||||
|
"type": "float"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "y",
|
||||||
|
"type": "float"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_WarpMouseGlobal",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "x",
|
||||||
|
"type": "float"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "y",
|
||||||
|
"type": "float"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetWindowRelativeMouseMode",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "window",
|
||||||
|
"type": "SDL_Window *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "enabled",
|
||||||
|
"type": "bool"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetWindowRelativeMouseMode",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "window",
|
||||||
|
"type": "SDL_Window *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CaptureMouse",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "enabled",
|
||||||
|
"type": "bool"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CreateCursor",
|
||||||
|
"return_type": "SDL_Cursor *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "data",
|
||||||
|
"type": "const Uint8 *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "mask",
|
||||||
|
"type": "const Uint8 *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "w",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "h",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hot_x",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hot_y",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CreateColorCursor",
|
||||||
|
"return_type": "SDL_Cursor *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "surface",
|
||||||
|
"type": "SDL_Surface *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hot_x",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hot_y",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CreateSystemCursor",
|
||||||
|
"return_type": "SDL_Cursor *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"type": "SDL_SystemCursor"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetCursor",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "cursor",
|
||||||
|
"type": "SDL_Cursor *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetCursor",
|
||||||
|
"return_type": "SDL_Cursor *",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetDefaultCursor",
|
||||||
|
"return_type": "SDL_Cursor *",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_DestroyCursor",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "cursor",
|
||||||
|
"type": "SDL_Cursor *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ShowCursor",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_HideCursor",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CursorVisible",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,916 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_pixels.h",
|
||||||
|
"opaque_types": [],
|
||||||
|
"typedefs": [],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [],
|
||||||
|
"enums": [
|
||||||
|
{
|
||||||
|
"name": "SDL_PixelType",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELTYPE_UNKNOWN"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELTYPE_INDEX1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELTYPE_INDEX4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELTYPE_INDEX8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELTYPE_PACKED8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELTYPE_PACKED16"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELTYPE_PACKED32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELTYPE_ARRAYU8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELTYPE_ARRAYU16"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELTYPE_ARRAYU32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELTYPE_ARRAYF16"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELTYPE_ARRAYF32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELTYPE_INDEX2"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BitmapOrder",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_BITMAPORDER_NONE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BITMAPORDER_4321"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_BITMAPORDER_1234"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PackedOrder",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_PACKEDORDER_NONE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PACKEDORDER_XRGB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PACKEDORDER_RGBX"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PACKEDORDER_ARGB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PACKEDORDER_RGBA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PACKEDORDER_XBGR"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PACKEDORDER_BGRX"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PACKEDORDER_ABGR"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PACKEDORDER_BGRA"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ArrayOrder",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_ARRAYORDER_NONE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ARRAYORDER_RGB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ARRAYORDER_RGBA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ARRAYORDER_ARGB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ARRAYORDER_BGR"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ARRAYORDER_BGRA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ARRAYORDER_ABGR"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PackedLayout",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_PACKEDLAYOUT_NONE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PACKEDLAYOUT_332"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PACKEDLAYOUT_4444"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PACKEDLAYOUT_1555"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PACKEDLAYOUT_5551"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PACKEDLAYOUT_565"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PACKEDLAYOUT_8888"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PACKEDLAYOUT_2101010"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PACKEDLAYOUT_1010102"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PixelFormat",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELFORMAT_YV12",
|
||||||
|
"value": "0x32315659u",
|
||||||
|
"comment": "Planar mode: Y + V + U (3 planes)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELFORMAT_IYUV",
|
||||||
|
"value": "0x56555949u",
|
||||||
|
"comment": "Planar mode: Y + U + V (3 planes)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELFORMAT_YUY2",
|
||||||
|
"value": "0x32595559u",
|
||||||
|
"comment": "Packed mode: Y0+U0+Y1+V0 (1 plane)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELFORMAT_UYVY",
|
||||||
|
"value": "0x59565955u",
|
||||||
|
"comment": "Packed mode: U0+Y0+V0+Y1 (1 plane)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELFORMAT_YVYU",
|
||||||
|
"value": "0x55595659u",
|
||||||
|
"comment": "Packed mode: Y0+V0+Y1+U0 (1 plane)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELFORMAT_NV12",
|
||||||
|
"value": "0x3231564eu",
|
||||||
|
"comment": "Planar mode: Y + U/V interleaved (2 planes)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELFORMAT_NV21",
|
||||||
|
"value": "0x3132564eu",
|
||||||
|
"comment": "Planar mode: Y + V/U interleaved (2 planes)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELFORMAT_P010",
|
||||||
|
"value": "0x30313050u",
|
||||||
|
"comment": "Planar mode: Y + U/V interleaved (2 planes)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PIXELFORMAT_EXTERNAL_OES",
|
||||||
|
"value": "0x2053454fu",
|
||||||
|
"comment": "Android video texture format"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ColorType",
|
||||||
|
"values": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ColorRange",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_COLOR_RANGE_LIMITED",
|
||||||
|
"value": "1",
|
||||||
|
"comment": "Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLOR_RANGE_FULL",
|
||||||
|
"value": "2"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ColorPrimaries",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_COLOR_PRIMARIES_BT709",
|
||||||
|
"value": "1",
|
||||||
|
"comment": "ITU-R BT.709-6"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLOR_PRIMARIES_BT470M",
|
||||||
|
"value": "4",
|
||||||
|
"comment": "ITU-R BT.470-6 System M"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLOR_PRIMARIES_BT470BG",
|
||||||
|
"value": "5",
|
||||||
|
"comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLOR_PRIMARIES_BT601",
|
||||||
|
"value": "6",
|
||||||
|
"comment": "ITU-R BT.601-7 525, SMPTE 170M"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLOR_PRIMARIES_SMPTE240",
|
||||||
|
"value": "7",
|
||||||
|
"comment": "SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLOR_PRIMARIES_GENERIC_FILM",
|
||||||
|
"value": "8",
|
||||||
|
"comment": "Generic film (color filters using Illuminant C)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLOR_PRIMARIES_BT2020",
|
||||||
|
"value": "9",
|
||||||
|
"comment": "ITU-R BT.2020-2 / ITU-R BT.2100-0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLOR_PRIMARIES_XYZ",
|
||||||
|
"value": "10",
|
||||||
|
"comment": "SMPTE ST 428-1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLOR_PRIMARIES_SMPTE431",
|
||||||
|
"value": "11",
|
||||||
|
"comment": "SMPTE RP 431-2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLOR_PRIMARIES_SMPTE432",
|
||||||
|
"value": "12",
|
||||||
|
"comment": "SMPTE EG 432-1 / DCI P3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLOR_PRIMARIES_EBU3213",
|
||||||
|
"value": "22",
|
||||||
|
"comment": "EBU Tech. 3213-E"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TransferCharacteristics",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_TRANSFER_CHARACTERISTICS_BT709",
|
||||||
|
"value": "1",
|
||||||
|
"comment": "Rec. ITU-R BT.709-6 / ITU-R BT1361"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA22",
|
||||||
|
"value": "4",
|
||||||
|
"comment": "ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TRANSFER_CHARACTERISTICS_GAMMA28",
|
||||||
|
"value": "5",
|
||||||
|
"comment": "ITU-R BT.470-6 System B, G"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TRANSFER_CHARACTERISTICS_BT601",
|
||||||
|
"value": "6",
|
||||||
|
"comment": "SMPTE ST 170M / ITU-R BT.601-7 525 or 625"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE240",
|
||||||
|
"value": "7",
|
||||||
|
"comment": "SMPTE ST 240M"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TRANSFER_CHARACTERISTICS_IEC61966",
|
||||||
|
"value": "11",
|
||||||
|
"comment": "IEC 61966-2-4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TRANSFER_CHARACTERISTICS_BT1361",
|
||||||
|
"value": "12",
|
||||||
|
"comment": "ITU-R BT1361 Extended Colour Gamut"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TRANSFER_CHARACTERISTICS_SRGB",
|
||||||
|
"value": "13",
|
||||||
|
"comment": "IEC 61966-2-1 (sRGB or sYCC)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT",
|
||||||
|
"value": "14",
|
||||||
|
"comment": "ITU-R BT2020 for 10-bit system"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT",
|
||||||
|
"value": "15",
|
||||||
|
"comment": "ITU-R BT2020 for 12-bit system"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TRANSFER_CHARACTERISTICS_PQ",
|
||||||
|
"value": "16",
|
||||||
|
"comment": "SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TRANSFER_CHARACTERISTICS_SMPTE428",
|
||||||
|
"value": "17",
|
||||||
|
"comment": "SMPTE ST 428-1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TRANSFER_CHARACTERISTICS_HLG",
|
||||||
|
"value": "18",
|
||||||
|
"comment": "ARIB STD-B67, known as \"hybrid log-gamma\" (HLG)"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MatrixCoefficients",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_MATRIX_COEFFICIENTS_BT709",
|
||||||
|
"value": "1",
|
||||||
|
"comment": "ITU-R BT.709-6"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MATRIX_COEFFICIENTS_FCC",
|
||||||
|
"value": "4",
|
||||||
|
"comment": "US FCC Title 47"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MATRIX_COEFFICIENTS_BT470BG",
|
||||||
|
"value": "5",
|
||||||
|
"comment": "ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MATRIX_COEFFICIENTS_BT601",
|
||||||
|
"value": "6",
|
||||||
|
"comment": "ITU-R BT.601-7 525"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MATRIX_COEFFICIENTS_SMPTE240",
|
||||||
|
"value": "7",
|
||||||
|
"comment": "SMPTE 240M"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL",
|
||||||
|
"value": "9",
|
||||||
|
"comment": "ITU-R BT.2020-2 non-constant luminance"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MATRIX_COEFFICIENTS_BT2020_CL",
|
||||||
|
"value": "10",
|
||||||
|
"comment": "ITU-R BT.2020-2 constant luminance"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MATRIX_COEFFICIENTS_SMPTE2085",
|
||||||
|
"value": "11",
|
||||||
|
"comment": "SMPTE ST 2085"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MATRIX_COEFFICIENTS_ICTCP",
|
||||||
|
"value": "14",
|
||||||
|
"comment": "ITU-R BT.2100-0 ICTCP"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ChromaLocation",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_CHROMA_LOCATION_NONE",
|
||||||
|
"value": "0",
|
||||||
|
"comment": "RGB, no chroma sampling"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CHROMA_LOCATION_LEFT",
|
||||||
|
"value": "1",
|
||||||
|
"comment": "In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CHROMA_LOCATION_CENTER",
|
||||||
|
"value": "2",
|
||||||
|
"comment": "In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CHROMA_LOCATION_TOPLEFT",
|
||||||
|
"value": "3"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_Colorspace",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_COLORSPACE_SRGB",
|
||||||
|
"value": "0x120005a0u",
|
||||||
|
"comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLOR_RANGE_FULL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLOR_PRIMARIES_BT709"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TRANSFER_CHARACTERISTICS_SRGB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MATRIX_COEFFICIENTS_IDENTITY"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLORSPACE_SRGB_LINEAR",
|
||||||
|
"value": "0x12000500u",
|
||||||
|
"comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLORSPACE_HDR10",
|
||||||
|
"value": "0x12002600u",
|
||||||
|
"comment": "Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLOR_PRIMARIES_BT2020"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TRANSFER_CHARACTERISTICS_PQ"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLORSPACE_JPEG",
|
||||||
|
"value": "0x220004c6u",
|
||||||
|
"comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TRANSFER_CHARACTERISTICS_BT601"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MATRIX_COEFFICIENTS_BT601"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLORSPACE_BT601_LIMITED",
|
||||||
|
"value": "0x211018c6u",
|
||||||
|
"comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLOR_RANGE_LIMITED"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLOR_PRIMARIES_BT601"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLORSPACE_BT601_FULL",
|
||||||
|
"value": "0x221018c6u",
|
||||||
|
"comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLORSPACE_BT709_LIMITED",
|
||||||
|
"value": "0x21100421u",
|
||||||
|
"comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TRANSFER_CHARACTERISTICS_BT709"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MATRIX_COEFFICIENTS_BT709"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLORSPACE_BT709_FULL",
|
||||||
|
"value": "0x22100421u",
|
||||||
|
"comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLORSPACE_BT2020_LIMITED",
|
||||||
|
"value": "0x21102609u",
|
||||||
|
"comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MATRIX_COEFFICIENTS_BT2020_NCL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLORSPACE_BT2020_FULL",
|
||||||
|
"value": "0x22102609u",
|
||||||
|
"comment": "Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLORSPACE_RGB_DEFAULT",
|
||||||
|
"value": "SDL_COLORSPACE_SRGB",
|
||||||
|
"comment": "The default colorspace for RGB surfaces if no colorspace is specified"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_COLORSPACE_YUV_DEFAULT",
|
||||||
|
"value": "SDL_COLORSPACE_JPEG",
|
||||||
|
"comment": "The default colorspace for YUV surfaces if no colorspace is specified"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"structs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_Color",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "r",
|
||||||
|
"type": "Uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "g",
|
||||||
|
"type": "Uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "b",
|
||||||
|
"type": "Uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "a",
|
||||||
|
"type": "Uint8"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_FColor",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "r",
|
||||||
|
"type": "float"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "g",
|
||||||
|
"type": "float"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "b",
|
||||||
|
"type": "float"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "a",
|
||||||
|
"type": "float"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_Palette",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "ncolors",
|
||||||
|
"type": "int",
|
||||||
|
"comment": "number of elements in `colors`."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "colors",
|
||||||
|
"type": "SDL_Color *",
|
||||||
|
"comment": "an array of colors, `ncolors` long."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "version",
|
||||||
|
"type": "Uint32",
|
||||||
|
"comment": "internal use only, do not touch."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "refcount",
|
||||||
|
"type": "int",
|
||||||
|
"comment": "internal use only, do not touch."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PixelFormatDetails",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "format",
|
||||||
|
"type": "SDL_PixelFormat"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "bits_per_pixel",
|
||||||
|
"type": "Uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "bytes_per_pixel",
|
||||||
|
"type": "Uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "padding",
|
||||||
|
"type": "Uint8[2]"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Rmask",
|
||||||
|
"type": "Uint32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Gmask",
|
||||||
|
"type": "Uint32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Bmask",
|
||||||
|
"type": "Uint32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Amask",
|
||||||
|
"type": "Uint32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Rbits",
|
||||||
|
"type": "Uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Gbits",
|
||||||
|
"type": "Uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Bbits",
|
||||||
|
"type": "Uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Abits",
|
||||||
|
"type": "Uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Rshift",
|
||||||
|
"type": "Uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Gshift",
|
||||||
|
"type": "Uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Bshift",
|
||||||
|
"type": "Uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Ashift",
|
||||||
|
"type": "Uint8"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_GetPixelFormatName",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "format",
|
||||||
|
"type": "SDL_PixelFormat"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetMasksForPixelFormat",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "format",
|
||||||
|
"type": "SDL_PixelFormat"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "bpp",
|
||||||
|
"type": "int *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Rmask",
|
||||||
|
"type": "Uint32 *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Gmask",
|
||||||
|
"type": "Uint32 *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Bmask",
|
||||||
|
"type": "Uint32 *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Amask",
|
||||||
|
"type": "Uint32 *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetPixelFormatForMasks",
|
||||||
|
"return_type": "SDL_PixelFormat",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "bpp",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Rmask",
|
||||||
|
"type": "Uint32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Gmask",
|
||||||
|
"type": "Uint32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Bmask",
|
||||||
|
"type": "Uint32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Amask",
|
||||||
|
"type": "Uint32"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetPixelFormatDetails",
|
||||||
|
"return_type": "const SDL_PixelFormatDetails *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "format",
|
||||||
|
"type": "SDL_PixelFormat"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CreatePalette",
|
||||||
|
"return_type": "SDL_Palette *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "ncolors",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetPaletteColors",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "palette",
|
||||||
|
"type": "SDL_Palette *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "colors",
|
||||||
|
"type": "const SDL_Color *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "firstcolor",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ncolors",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_DestroyPalette",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "palette",
|
||||||
|
"type": "SDL_Palette *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MapRGB",
|
||||||
|
"return_type": "Uint32",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "format",
|
||||||
|
"type": "const SDL_PixelFormatDetails *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "palette",
|
||||||
|
"type": "const SDL_Palette *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "r",
|
||||||
|
"type": "Uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "g",
|
||||||
|
"type": "Uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "b",
|
||||||
|
"type": "Uint8"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_MapRGBA",
|
||||||
|
"return_type": "Uint32",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "format",
|
||||||
|
"type": "const SDL_PixelFormatDetails *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "palette",
|
||||||
|
"type": "const SDL_Palette *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "r",
|
||||||
|
"type": "Uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "g",
|
||||||
|
"type": "Uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "b",
|
||||||
|
"type": "Uint8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "a",
|
||||||
|
"type": "Uint8"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetRGB",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "pixel",
|
||||||
|
"type": "Uint32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "format",
|
||||||
|
"type": "const SDL_PixelFormatDetails *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "palette",
|
||||||
|
"type": "const SDL_Palette *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "r",
|
||||||
|
"type": "Uint8 *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "g",
|
||||||
|
"type": "Uint8 *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "b",
|
||||||
|
"type": "Uint8 *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetRGBA",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "pixel",
|
||||||
|
"type": "Uint32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "format",
|
||||||
|
"type": "const SDL_PixelFormatDetails *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "palette",
|
||||||
|
"type": "const SDL_Palette *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "r",
|
||||||
|
"type": "Uint8 *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "g",
|
||||||
|
"type": "Uint8 *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "b",
|
||||||
|
"type": "Uint8 *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "a",
|
||||||
|
"type": "Uint8 *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,369 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_properties.h",
|
||||||
|
"opaque_types": [],
|
||||||
|
"typedefs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_PropertiesID",
|
||||||
|
"underlying_type": "Uint32"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [
|
||||||
|
{
|
||||||
|
"name": "SDL_CleanupPropertyCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_EnumeratePropertiesCallback"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"enums": [
|
||||||
|
{
|
||||||
|
"name": "SDL_PropertyType",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_PROPERTY_TYPE_INVALID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PROPERTY_TYPE_POINTER"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PROPERTY_TYPE_STRING"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PROPERTY_TYPE_NUMBER"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PROPERTY_TYPE_FLOAT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_PROPERTY_TYPE_BOOLEAN"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"structs": [],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_GetGlobalProperties",
|
||||||
|
"return_type": "SDL_PropertiesID",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CreateProperties",
|
||||||
|
"return_type": "SDL_PropertiesID",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CopyProperties",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "src",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dst",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_LockProperties",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "props",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_UnlockProperties",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "props",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetPointerPropertyWithCleanup",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "props",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "value",
|
||||||
|
"type": "void *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "cleanup",
|
||||||
|
"type": "SDL_CleanupPropertyCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userdata",
|
||||||
|
"type": "void *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetPointerProperty",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "props",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "value",
|
||||||
|
"type": "void *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetStringProperty",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "props",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "value",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetNumberProperty",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "props",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "value",
|
||||||
|
"type": "Sint64"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetFloatProperty",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "props",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "value",
|
||||||
|
"type": "float"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetBooleanProperty",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "props",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "value",
|
||||||
|
"type": "bool"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_HasProperty",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "props",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetPropertyType",
|
||||||
|
"return_type": "SDL_PropertyType",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "props",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetPointerProperty",
|
||||||
|
"return_type": "void *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "props",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "default_value",
|
||||||
|
"type": "void *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetStringProperty",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "props",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "default_value",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetNumberProperty",
|
||||||
|
"return_type": "Sint64",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "props",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "default_value",
|
||||||
|
"type": "Sint64"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetFloatProperty",
|
||||||
|
"return_type": "float",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "props",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "default_value",
|
||||||
|
"type": "float"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetBooleanProperty",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "props",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "default_value",
|
||||||
|
"type": "bool"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ClearProperty",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "props",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_EnumerateProperties",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "props",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "callback",
|
||||||
|
"type": "SDL_EnumeratePropertiesCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userdata",
|
||||||
|
"type": "void *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_DestroyProperties",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "props",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,278 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_rect.h",
|
||||||
|
"opaque_types": [],
|
||||||
|
"typedefs": [],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [],
|
||||||
|
"enums": [],
|
||||||
|
"structs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_Point",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "x",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "y",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_FPoint",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "x",
|
||||||
|
"type": "float"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "y",
|
||||||
|
"type": "float"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_Rect",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "x",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "y",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "w",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "h",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_FRect",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "x",
|
||||||
|
"type": "float"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "y",
|
||||||
|
"type": "float"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "w",
|
||||||
|
"type": "float"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "h",
|
||||||
|
"type": "float"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_HasRectIntersection",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "A",
|
||||||
|
"type": "const SDL_Rect *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "B",
|
||||||
|
"type": "const SDL_Rect *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetRectIntersection",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "A",
|
||||||
|
"type": "const SDL_Rect *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "B",
|
||||||
|
"type": "const SDL_Rect *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "result",
|
||||||
|
"type": "SDL_Rect *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetRectUnion",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "A",
|
||||||
|
"type": "const SDL_Rect *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "B",
|
||||||
|
"type": "const SDL_Rect *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "result",
|
||||||
|
"type": "SDL_Rect *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetRectEnclosingPoints",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "points",
|
||||||
|
"type": "const SDL_Point *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "count",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "clip",
|
||||||
|
"type": "const SDL_Rect *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "result",
|
||||||
|
"type": "SDL_Rect *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetRectAndLineIntersection",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "rect",
|
||||||
|
"type": "const SDL_Rect *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "X1",
|
||||||
|
"type": "int *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Y1",
|
||||||
|
"type": "int *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "X2",
|
||||||
|
"type": "int *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Y2",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_HasRectIntersectionFloat",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "A",
|
||||||
|
"type": "const SDL_FRect *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "B",
|
||||||
|
"type": "const SDL_FRect *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetRectIntersectionFloat",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "A",
|
||||||
|
"type": "const SDL_FRect *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "B",
|
||||||
|
"type": "const SDL_FRect *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "result",
|
||||||
|
"type": "SDL_FRect *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetRectUnionFloat",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "A",
|
||||||
|
"type": "const SDL_FRect *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "B",
|
||||||
|
"type": "const SDL_FRect *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "result",
|
||||||
|
"type": "SDL_FRect *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetRectEnclosingPointsFloat",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "points",
|
||||||
|
"type": "const SDL_FPoint *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "count",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "clip",
|
||||||
|
"type": "const SDL_FRect *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "result",
|
||||||
|
"type": "SDL_FRect *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetRectAndLineIntersectionFloat",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "rect",
|
||||||
|
"type": "const SDL_FRect *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "X1",
|
||||||
|
"type": "float *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Y1",
|
||||||
|
"type": "float *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "X2",
|
||||||
|
"type": "float *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Y2",
|
||||||
|
"type": "float *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,204 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_sensor.h",
|
||||||
|
"opaque_types": [
|
||||||
|
{
|
||||||
|
"name": "SDL_Sensor"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"typedefs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_SensorID",
|
||||||
|
"underlying_type": "Uint32"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [],
|
||||||
|
"enums": [
|
||||||
|
{
|
||||||
|
"name": "SDL_SensorType",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_SENSOR_INVALID",
|
||||||
|
"value": "-1",
|
||||||
|
"comment": "Returned for an invalid sensor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SENSOR_UNKNOWN",
|
||||||
|
"comment": "Unknown sensor type"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SENSOR_ACCEL",
|
||||||
|
"comment": "Accelerometer"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SENSOR_GYRO",
|
||||||
|
"comment": "Gyroscope"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SENSOR_ACCEL_L",
|
||||||
|
"comment": "Accelerometer for left Joy-Con controller and Wii nunchuk"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SENSOR_GYRO_L",
|
||||||
|
"comment": "Gyroscope for left Joy-Con controller"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SENSOR_ACCEL_R",
|
||||||
|
"comment": "Accelerometer for right Joy-Con controller"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SENSOR_GYRO_R",
|
||||||
|
"comment": "Gyroscope for right Joy-Con controller"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"structs": [],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_GetSensors",
|
||||||
|
"return_type": "SDL_SensorID *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "count",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetSensorNameForID",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_SensorID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetSensorTypeForID",
|
||||||
|
"return_type": "SDL_SensorType",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_SensorID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetSensorNonPortableTypeForID",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_SensorID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_OpenSensor",
|
||||||
|
"return_type": "SDL_Sensor *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_SensorID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetSensorFromID",
|
||||||
|
"return_type": "SDL_Sensor *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance_id",
|
||||||
|
"type": "SDL_SensorID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetSensorProperties",
|
||||||
|
"return_type": "SDL_PropertiesID",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "sensor",
|
||||||
|
"type": "SDL_Sensor *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetSensorName",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "sensor",
|
||||||
|
"type": "SDL_Sensor *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetSensorType",
|
||||||
|
"return_type": "SDL_SensorType",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "sensor",
|
||||||
|
"type": "SDL_Sensor *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetSensorNonPortableType",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "sensor",
|
||||||
|
"type": "SDL_Sensor *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetSensorID",
|
||||||
|
"return_type": "SDL_SensorID",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "sensor",
|
||||||
|
"type": "SDL_Sensor *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetSensorData",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "sensor",
|
||||||
|
"type": "SDL_Sensor *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "data",
|
||||||
|
"type": "float *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "num_values",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CloseSensor",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "sensor",
|
||||||
|
"type": "SDL_Sensor *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_UpdateSensors",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,349 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_storage.h",
|
||||||
|
"opaque_types": [
|
||||||
|
{
|
||||||
|
"name": "SDL_Storage"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"typedefs": [],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [],
|
||||||
|
"enums": [],
|
||||||
|
"structs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_StorageInterface",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "version",
|
||||||
|
"type": "Uint32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "close",
|
||||||
|
"type": "bool (SDLCALL *close)(void *userdata)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ready",
|
||||||
|
"type": "bool (SDLCALL *ready)(void *userdata)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "enumerate",
|
||||||
|
"type": "bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "info",
|
||||||
|
"type": "bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "read_file",
|
||||||
|
"type": "bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "write_file",
|
||||||
|
"type": "bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "mkdir",
|
||||||
|
"type": "bool (SDLCALL *mkdir)(void *userdata, const char *path)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "remove",
|
||||||
|
"type": "bool (SDLCALL *remove)(void *userdata, const char *path)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "rename",
|
||||||
|
"type": "bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "copy",
|
||||||
|
"type": "bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "space_remaining",
|
||||||
|
"type": "Uint64 (SDLCALL *space_remaining)(void *userdata)"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_OpenTitleStorage",
|
||||||
|
"return_type": "SDL_Storage *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "override",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "props",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_OpenUserStorage",
|
||||||
|
"return_type": "SDL_Storage *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "org",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "app",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "props",
|
||||||
|
"type": "SDL_PropertiesID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_OpenFileStorage",
|
||||||
|
"return_type": "SDL_Storage *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "path",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_OpenStorage",
|
||||||
|
"return_type": "SDL_Storage *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "iface",
|
||||||
|
"type": "const SDL_StorageInterface *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userdata",
|
||||||
|
"type": "void *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CloseStorage",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "storage",
|
||||||
|
"type": "SDL_Storage *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_StorageReady",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "storage",
|
||||||
|
"type": "SDL_Storage *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetStorageFileSize",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "storage",
|
||||||
|
"type": "SDL_Storage *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "path",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "length",
|
||||||
|
"type": "Uint64 *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ReadStorageFile",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "storage",
|
||||||
|
"type": "SDL_Storage *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "path",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "destination",
|
||||||
|
"type": "void *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "length",
|
||||||
|
"type": "Uint64"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_WriteStorageFile",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "storage",
|
||||||
|
"type": "SDL_Storage *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "path",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "source",
|
||||||
|
"type": "const void *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "length",
|
||||||
|
"type": "Uint64"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CreateStorageDirectory",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "storage",
|
||||||
|
"type": "SDL_Storage *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "path",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_EnumerateStorageDirectory",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "storage",
|
||||||
|
"type": "SDL_Storage *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "path",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "callback",
|
||||||
|
"type": "SDL_EnumerateDirectoryCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userdata",
|
||||||
|
"type": "void *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_RemoveStoragePath",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "storage",
|
||||||
|
"type": "SDL_Storage *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "path",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_RenameStoragePath",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "storage",
|
||||||
|
"type": "SDL_Storage *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "oldpath",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "newpath",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_CopyStorageFile",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "storage",
|
||||||
|
"type": "SDL_Storage *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "oldpath",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "newpath",
|
||||||
|
"type": "const char *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetStoragePathInfo",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "storage",
|
||||||
|
"type": "SDL_Storage *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "path",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "info",
|
||||||
|
"type": "SDL_PathInfo *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetStorageSpaceRemaining",
|
||||||
|
"return_type": "Uint64",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "storage",
|
||||||
|
"type": "SDL_Storage *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GlobStorageDirectory",
|
||||||
|
"return_type": "char **",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "storage",
|
||||||
|
"type": "SDL_Storage *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "path",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "pattern",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "flags",
|
||||||
|
"type": "SDL_GlobFlags"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "count",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,355 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_system.h",
|
||||||
|
"opaque_types": [
|
||||||
|
{
|
||||||
|
"name": "MSG"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"typedefs": [
|
||||||
|
{
|
||||||
|
"name": "XTaskQueueHandle",
|
||||||
|
"underlying_type": "struct XTaskQueueObject *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "XUserHandle",
|
||||||
|
"underlying_type": "struct XUser *"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [
|
||||||
|
{
|
||||||
|
"name": "SDL_WindowsMessageHook"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_X11EventHook"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_iOSAnimationCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_RequestAndroidPermissionCallback"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"enums": [
|
||||||
|
{
|
||||||
|
"name": "SDL_Sandbox",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_SANDBOX_UNKNOWN_CONTAINER"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SANDBOX_FLATPAK"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SANDBOX_SNAP"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SANDBOX_MACOS"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"structs": [],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_SetWindowsMessageHook",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "callback",
|
||||||
|
"type": "SDL_WindowsMessageHook"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userdata",
|
||||||
|
"type": "void *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetDirect3D9AdapterIndex",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "displayID",
|
||||||
|
"type": "SDL_DisplayID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetDXGIOutputInfo",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "displayID",
|
||||||
|
"type": "SDL_DisplayID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "adapterIndex",
|
||||||
|
"type": "int *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "outputIndex",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetX11EventHook",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "callback",
|
||||||
|
"type": "SDL_X11EventHook"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userdata",
|
||||||
|
"type": "void *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetLinuxThreadPriority",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "threadID",
|
||||||
|
"type": "Sint64"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "priority",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetLinuxThreadPriorityAndPolicy",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "threadID",
|
||||||
|
"type": "Sint64"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "sdlPriority",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "schedPolicy",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetiOSAnimationCallback",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "window",
|
||||||
|
"type": "SDL_Window *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "interval",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "callback",
|
||||||
|
"type": "SDL_iOSAnimationCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "callbackParam",
|
||||||
|
"type": "void *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SetiOSEventPump",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "enabled",
|
||||||
|
"type": "bool"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAndroidJNIEnv",
|
||||||
|
"return_type": "void *",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAndroidActivity",
|
||||||
|
"return_type": "void *",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAndroidSDKVersion",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_IsChromebook",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_IsDeXMode",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SendAndroidBackButton",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAndroidInternalStoragePath",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAndroidExternalStorageState",
|
||||||
|
"return_type": "Uint32",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAndroidExternalStoragePath",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetAndroidCachePath",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_RequestAndroidPermission",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "permission",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "cb",
|
||||||
|
"type": "SDL_RequestAndroidPermissionCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userdata",
|
||||||
|
"type": "void *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_ShowAndroidToast",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "message",
|
||||||
|
"type": "const char *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "duration",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gravity",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "xoffset",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "yoffset",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_SendAndroidMessage",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "command",
|
||||||
|
"type": "Uint32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "param",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_IsTablet",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_IsTV",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetSandbox",
|
||||||
|
"return_type": "SDL_Sandbox",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_OnApplicationWillTerminate",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_OnApplicationDidReceiveMemoryWarning",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_OnApplicationWillEnterBackground",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_OnApplicationDidEnterBackground",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_OnApplicationWillEnterForeground",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_OnApplicationDidEnterForeground",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_OnApplicationDidChangeStatusBarOrientation",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetGDKTaskQueue",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "outTaskQueue",
|
||||||
|
"type": "XTaskQueueHandle *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetGDKDefaultUser",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "outUserHandle",
|
||||||
|
"type": "XUserHandle *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,238 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_time.h",
|
||||||
|
"opaque_types": [],
|
||||||
|
"typedefs": [],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [],
|
||||||
|
"enums": [
|
||||||
|
{
|
||||||
|
"name": "SDL_DateFormat",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_DATE_FORMAT_YYYYMMDD",
|
||||||
|
"value": "0",
|
||||||
|
"comment": "Year/Month/Day"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_DATE_FORMAT_DDMMYYYY",
|
||||||
|
"value": "1",
|
||||||
|
"comment": "Day/Month/Year"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_DATE_FORMAT_MMDDYYYY",
|
||||||
|
"value": "2",
|
||||||
|
"comment": "Month/Day/Year"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TimeFormat",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_TIME_FORMAT_24HR",
|
||||||
|
"value": "0",
|
||||||
|
"comment": "24 hour time"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TIME_FORMAT_12HR",
|
||||||
|
"value": "1",
|
||||||
|
"comment": "12 hour time"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"structs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_DateTime",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "year",
|
||||||
|
"type": "int",
|
||||||
|
"comment": "Year"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "month",
|
||||||
|
"type": "int",
|
||||||
|
"comment": "Month [01-12]"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "day",
|
||||||
|
"type": "int",
|
||||||
|
"comment": "Day of the month [01-31]"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hour",
|
||||||
|
"type": "int",
|
||||||
|
"comment": "Hour [0-23]"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "minute",
|
||||||
|
"type": "int",
|
||||||
|
"comment": "Minute [0-59]"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "second",
|
||||||
|
"type": "int",
|
||||||
|
"comment": "Seconds [0-60]"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "nanosecond",
|
||||||
|
"type": "int",
|
||||||
|
"comment": "Nanoseconds [0-999999999]"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "day_of_week",
|
||||||
|
"type": "int",
|
||||||
|
"comment": "Day of the week [0-6] (0 being Sunday)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "utc_offset",
|
||||||
|
"type": "int",
|
||||||
|
"comment": "Seconds east of UTC"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_GetDateTimeLocalePreferences",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "dateFormat",
|
||||||
|
"type": "SDL_DateFormat *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "timeFormat",
|
||||||
|
"type": "SDL_TimeFormat *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetCurrentTime",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "ticks",
|
||||||
|
"type": "SDL_Time *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TimeToDateTime",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "ticks",
|
||||||
|
"type": "SDL_Time"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dt",
|
||||||
|
"type": "SDL_DateTime *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "localTime",
|
||||||
|
"type": "bool"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_DateTimeToTime",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "dt",
|
||||||
|
"type": "const SDL_DateTime *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ticks",
|
||||||
|
"type": "SDL_Time *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TimeToWindows",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "ticks",
|
||||||
|
"type": "SDL_Time"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dwLowDateTime",
|
||||||
|
"type": "Uint32 *"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dwHighDateTime",
|
||||||
|
"type": "Uint32 *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TimeFromWindows",
|
||||||
|
"return_type": "SDL_Time",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "dwLowDateTime",
|
||||||
|
"type": "Uint32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "dwHighDateTime",
|
||||||
|
"type": "Uint32"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetDaysInMonth",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "year",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "month",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetDayOfYear",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "year",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "month",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "day",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetDayOfWeek",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "year",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "month",
|
||||||
|
"type": "int"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "day",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,121 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_timer.h",
|
||||||
|
"opaque_types": [],
|
||||||
|
"typedefs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_TimerID",
|
||||||
|
"underlying_type": "Uint32"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [
|
||||||
|
{
|
||||||
|
"name": "SDL_TimerCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_NSTimerCallback"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"enums": [],
|
||||||
|
"structs": [],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_GetTicks",
|
||||||
|
"return_type": "Uint64",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetTicksNS",
|
||||||
|
"return_type": "Uint64",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetPerformanceCounter",
|
||||||
|
"return_type": "Uint64",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetPerformanceFrequency",
|
||||||
|
"return_type": "Uint64",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_Delay",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "ms",
|
||||||
|
"type": "Uint32"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_DelayNS",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "ns",
|
||||||
|
"type": "Uint64"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_DelayPrecise",
|
||||||
|
"return_type": "void",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "ns",
|
||||||
|
"type": "Uint64"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_AddTimer",
|
||||||
|
"return_type": "SDL_TimerID",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "interval",
|
||||||
|
"type": "Uint32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "callback",
|
||||||
|
"type": "SDL_TimerCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userdata",
|
||||||
|
"type": "void *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_AddTimerNS",
|
||||||
|
"return_type": "SDL_TimerID",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "interval",
|
||||||
|
"type": "Uint64"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "callback",
|
||||||
|
"type": "SDL_NSTimerCallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userdata",
|
||||||
|
"type": "void *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_RemoveTimer",
|
||||||
|
"return_type": "bool",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"type": "SDL_TimerID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,107 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_touch.h",
|
||||||
|
"opaque_types": [],
|
||||||
|
"typedefs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_TouchID",
|
||||||
|
"underlying_type": "Uint64"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_FingerID",
|
||||||
|
"underlying_type": "Uint64"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [],
|
||||||
|
"enums": [
|
||||||
|
{
|
||||||
|
"name": "SDL_TouchDeviceType",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "SDL_TOUCH_DEVICE_DIRECT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_TOUCH_DEVICE_INDIRECT_RELATIVE /* trackpad with screen cursor-relative coordinates */"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"structs": [
|
||||||
|
{
|
||||||
|
"name": "SDL_Finger",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"type": "SDL_FingerID",
|
||||||
|
"comment": "the finger ID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "x",
|
||||||
|
"type": "float",
|
||||||
|
"comment": "the x-axis location of the touch event, normalized (0...1)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "y",
|
||||||
|
"type": "float",
|
||||||
|
"comment": "the y-axis location of the touch event, normalized (0...1)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "pressure",
|
||||||
|
"type": "float",
|
||||||
|
"comment": "the quantity of pressure applied, normalized (0...1)"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_GetTouchDevices",
|
||||||
|
"return_type": "SDL_TouchID *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "count",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetTouchDeviceName",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "touchID",
|
||||||
|
"type": "SDL_TouchID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetTouchDeviceType",
|
||||||
|
"return_type": "SDL_TouchDeviceType",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "touchID",
|
||||||
|
"type": "SDL_TouchID"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetTouchFingers",
|
||||||
|
"return_type": "SDL_Finger **",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "touchID",
|
||||||
|
"type": "SDL_TouchID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "count",
|
||||||
|
"type": "int *"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"header": "SDL_version.h",
|
||||||
|
"opaque_types": [],
|
||||||
|
"typedefs": [],
|
||||||
|
"function_pointers": [],
|
||||||
|
"c_type_aliases": [],
|
||||||
|
"enums": [],
|
||||||
|
"structs": [],
|
||||||
|
"unions": [],
|
||||||
|
"flags": [],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"name": "SDL_GetVersion",
|
||||||
|
"return_type": "int",
|
||||||
|
"parameters": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SDL_GetRevision",
|
||||||
|
"return_type": "const char *",
|
||||||
|
"parameters": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,252 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const PropertiesID = u32;
|
||||||
|
|
||||||
|
pub const IOStream = opaque {
|
||||||
|
pub inline fn loadWAV_IO(iostream: *IOStream, closeio: bool, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool {
|
||||||
|
return c.SDL_LoadWAV_IO(iostream, closeio, spec, audio_buf, @ptrCast(audio_len));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const AudioFormat = enum(c_int) {
|
||||||
|
audioUnknown, //Unspecified audio format
|
||||||
|
audioU8, //Unsigned 8-bit samples
|
||||||
|
audioS8, //Signed 8-bit samples
|
||||||
|
audioS16le, //Signed 16-bit samples
|
||||||
|
audioS16be, //As above, but big-endian byte order
|
||||||
|
audioS32le, //32-bit integer samples
|
||||||
|
audioS32be, //As above, but big-endian byte order
|
||||||
|
audioF32le, //32-bit floating point samples
|
||||||
|
audioF32be, //As above, but big-endian byte order
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const AudioDeviceID = u32;
|
||||||
|
|
||||||
|
pub const AudioSpec = extern struct {
|
||||||
|
format: AudioFormat, // Audio data format
|
||||||
|
channels: c_int, // Number of channels: 1 mono, 2 stereo, etc
|
||||||
|
freq: c_int, // sample rate: sample frames per second
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const AudioStream = opaque {
|
||||||
|
pub inline fn unbindAudioStream(audiostream: *AudioStream) void {
|
||||||
|
return c.SDL_UnbindAudioStream(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioStreamDevice(audiostream: *AudioStream) AudioDeviceID {
|
||||||
|
return c.SDL_GetAudioStreamDevice(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioStreamProperties(audiostream: *AudioStream) PropertiesID {
|
||||||
|
return c.SDL_GetAudioStreamProperties(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioStreamFormat(audiostream: *AudioStream, src_spec: ?*AudioSpec, dst_spec: ?*AudioSpec) bool {
|
||||||
|
return c.SDL_GetAudioStreamFormat(audiostream, src_spec, dst_spec);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setAudioStreamFormat(audiostream: *AudioStream, src_spec: *const AudioSpec, dst_spec: *const AudioSpec) bool {
|
||||||
|
return c.SDL_SetAudioStreamFormat(audiostream, @ptrCast(src_spec), @ptrCast(dst_spec));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioStreamFrequencyRatio(audiostream: *AudioStream) f32 {
|
||||||
|
return c.SDL_GetAudioStreamFrequencyRatio(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setAudioStreamFrequencyRatio(audiostream: *AudioStream, ratio: f32) bool {
|
||||||
|
return c.SDL_SetAudioStreamFrequencyRatio(audiostream, ratio);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioStreamGain(audiostream: *AudioStream) f32 {
|
||||||
|
return c.SDL_GetAudioStreamGain(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setAudioStreamGain(audiostream: *AudioStream, gain: f32) bool {
|
||||||
|
return c.SDL_SetAudioStreamGain(audiostream, gain);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioStreamInputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int {
|
||||||
|
return @ptrCast(c.SDL_GetAudioStreamInputChannelMap(audiostream, @ptrCast(count)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioStreamOutputChannelMap(audiostream: *AudioStream, count: *c_int) *c_int {
|
||||||
|
return @ptrCast(c.SDL_GetAudioStreamOutputChannelMap(audiostream, @ptrCast(count)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setAudioStreamInputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool {
|
||||||
|
return c.SDL_SetAudioStreamInputChannelMap(audiostream, chmap, count);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setAudioStreamOutputChannelMap(audiostream: *AudioStream, chmap: [*c]const c_int, count: c_int) bool {
|
||||||
|
return c.SDL_SetAudioStreamOutputChannelMap(audiostream, chmap, count);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn putAudioStreamData(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int) bool {
|
||||||
|
return c.SDL_PutAudioStreamData(audiostream, buf, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int {
|
||||||
|
return c.SDL_GetAudioStreamData(audiostream, buf, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioStreamAvailable(audiostream: *AudioStream) c_int {
|
||||||
|
return c.SDL_GetAudioStreamAvailable(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioStreamQueued(audiostream: *AudioStream) c_int {
|
||||||
|
return c.SDL_GetAudioStreamQueued(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn flushAudioStream(audiostream: *AudioStream) bool {
|
||||||
|
return c.SDL_FlushAudioStream(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn clearAudioStream(audiostream: *AudioStream) bool {
|
||||||
|
return c.SDL_ClearAudioStream(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn pauseAudioStreamDevice(audiostream: *AudioStream) bool {
|
||||||
|
return c.SDL_PauseAudioStreamDevice(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn resumeAudioStreamDevice(audiostream: *AudioStream) bool {
|
||||||
|
return c.SDL_ResumeAudioStreamDevice(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn lockAudioStream(audiostream: *AudioStream) bool {
|
||||||
|
return c.SDL_LockAudioStream(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn unlockAudioStream(audiostream: *AudioStream) bool {
|
||||||
|
return c.SDL_UnlockAudioStream(audiostream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setAudioStreamGetCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool {
|
||||||
|
return c.SDL_SetAudioStreamGetCallback(audiostream, callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setAudioStreamPutCallback(audiostream: *AudioStream, callback: AudioStreamCallback, userdata: ?*anyopaque) bool {
|
||||||
|
return c.SDL_SetAudioStreamPutCallback(audiostream, callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn destroyAudioStream(audiostream: *AudioStream) void {
|
||||||
|
return c.SDL_DestroyAudioStream(audiostream);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn getNumAudioDrivers() c_int {
|
||||||
|
return c.SDL_GetNumAudioDrivers();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioDriver(index: c_int) [*c]const u8 {
|
||||||
|
return c.SDL_GetAudioDriver(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCurrentAudioDriver() [*c]const u8 {
|
||||||
|
return c.SDL_GetCurrentAudioDriver();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioPlaybackDevices(count: *c_int) ?*AudioDeviceID {
|
||||||
|
return c.SDL_GetAudioPlaybackDevices(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioRecordingDevices(count: *c_int) ?*AudioDeviceID {
|
||||||
|
return c.SDL_GetAudioRecordingDevices(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioDeviceName(devid: AudioDeviceID) [*c]const u8 {
|
||||||
|
return c.SDL_GetAudioDeviceName(devid);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioDeviceFormat(devid: AudioDeviceID, spec: ?*AudioSpec, sample_frames: *c_int) bool {
|
||||||
|
return c.SDL_GetAudioDeviceFormat(devid, spec, @ptrCast(sample_frames));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioDeviceChannelMap(devid: AudioDeviceID, count: *c_int) *c_int {
|
||||||
|
return @ptrCast(c.SDL_GetAudioDeviceChannelMap(devid, @ptrCast(count)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openAudioDevice(devid: AudioDeviceID, spec: *const AudioSpec) AudioDeviceID {
|
||||||
|
return c.SDL_OpenAudioDevice(devid, @ptrCast(spec));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn isAudioDevicePhysical(devid: AudioDeviceID) bool {
|
||||||
|
return c.SDL_IsAudioDevicePhysical(devid);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool {
|
||||||
|
return c.SDL_IsAudioDevicePlayback(devid);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn pauseAudioDevice(dev: AudioDeviceID) bool {
|
||||||
|
return c.SDL_PauseAudioDevice(dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn resumeAudioDevice(dev: AudioDeviceID) bool {
|
||||||
|
return c.SDL_ResumeAudioDevice(dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn audioDevicePaused(dev: AudioDeviceID) bool {
|
||||||
|
return c.SDL_AudioDevicePaused(dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 {
|
||||||
|
return c.SDL_GetAudioDeviceGain(devid);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setAudioDeviceGain(devid: AudioDeviceID, gain: f32) bool {
|
||||||
|
return c.SDL_SetAudioDeviceGain(devid, gain);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn closeAudioDevice(devid: AudioDeviceID) void {
|
||||||
|
return c.SDL_CloseAudioDevice(devid);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn bindAudioStreams(devid: AudioDeviceID, streams: [*c]*const AudioStream, num_streams: c_int) bool {
|
||||||
|
return c.SDL_BindAudioStreams(devid, streams, num_streams);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn bindAudioStream(devid: AudioDeviceID, stream: ?*AudioStream) bool {
|
||||||
|
return c.SDL_BindAudioStream(devid, stream);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn unbindAudioStreams(streams: [*c]*const AudioStream, num_streams: c_int) void {
|
||||||
|
return c.SDL_UnbindAudioStreams(streams, num_streams);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn createAudioStream(src_spec: *const AudioSpec, dst_spec: *const AudioSpec) ?*AudioStream {
|
||||||
|
return c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const AudioStreamCallback = c.SDL_AudioStreamCallback;
|
||||||
|
|
||||||
|
pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: *const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream {
|
||||||
|
return c.SDL_OpenAudioDeviceStream(devid, @ptrCast(spec), callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const AudioPostmixCallback = c.SDL_AudioPostmixCallback;
|
||||||
|
|
||||||
|
pub inline fn setAudioPostmixCallback(devid: AudioDeviceID, callback: AudioPostmixCallback, userdata: ?*anyopaque) bool {
|
||||||
|
return c.SDL_SetAudioPostmixCallback(devid, callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn loadWAV(path: [*c]const u8, spec: ?*AudioSpec, audio_buf: [*c][*c]u8, audio_len: *u32) bool {
|
||||||
|
return c.SDL_LoadWAV(path, spec, audio_buf, @ptrCast(audio_len));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn mixAudio(dst: [*c]u8, src: [*c]const u8, format: AudioFormat, len: u32, volume: f32) bool {
|
||||||
|
return c.SDL_MixAudio(dst, src, @bitCast(format), len, volume);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn convertAudioSamples(src_spec: *const AudioSpec, src_data: [*c]const u8, src_len: c_int, dst_spec: *const AudioSpec, dst_data: [*c][*c]u8, dst_len: *c_int) bool {
|
||||||
|
return c.SDL_ConvertAudioSamples(@ptrCast(src_spec), src_data, src_len, @ptrCast(dst_spec), dst_data, @ptrCast(dst_len));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAudioFormatName(format: AudioFormat) [*c]const u8 {
|
||||||
|
return c.SDL_GetAudioFormatName(@bitCast(format));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSilenceValueForFormat(format: AudioFormat) c_int {
|
||||||
|
return c.SDL_GetSilenceValueForFormat(@bitCast(format));
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const BlendMode = u32;
|
||||||
|
|
||||||
|
pub const BlendOperation = enum(c_int) {
|
||||||
|
blendoperationAdd, //dst + src: supported by all renderers
|
||||||
|
blendoperationSubtract, //src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan
|
||||||
|
blendoperationRevSubtract, //dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan
|
||||||
|
blendoperationMinimum, //min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan
|
||||||
|
blendoperationMaximum,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const BlendFactor = enum(c_int) {
|
||||||
|
blendfactorZero, //0, 0, 0, 0
|
||||||
|
blendfactorOne, //1, 1, 1, 1
|
||||||
|
blendfactorSrcColor, //srcR, srcG, srcB, srcA
|
||||||
|
blendfactorOneMinusSrcColor, //1-srcR, 1-srcG, 1-srcB, 1-srcA
|
||||||
|
blendfactorSrcAlpha, //srcA, srcA, srcA, srcA
|
||||||
|
blendfactorOneMinusSrcAlpha, //1-srcA, 1-srcA, 1-srcA, 1-srcA
|
||||||
|
blendfactorDstColor, //dstR, dstG, dstB, dstA
|
||||||
|
blendfactorOneMinusDstColor, //1-dstR, 1-dstG, 1-dstB, 1-dstA
|
||||||
|
blendfactorDstAlpha, //dstA, dstA, dstA, dstA
|
||||||
|
blendfactorOneMinusDstAlpha,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn composeCustomBlendMode(srcColorFactor: BlendFactor, dstColorFactor: BlendFactor, colorOperation: BlendOperation, srcAlphaFactor: BlendFactor, dstAlphaFactor: BlendFactor, alphaOperation: BlendOperation) BlendMode {
|
||||||
|
return @intFromEnum(c.SDL_ComposeCustomBlendMode(srcColorFactor, dstColorFactor, @intFromEnum(colorOperation), srcAlphaFactor, dstAlphaFactor, @intFromEnum(alphaOperation)));
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,126 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const PixelFormat = enum(c_int) {
|
||||||
|
pixelformatYv12, //Planar mode: Y + V + U (3 planes)
|
||||||
|
pixelformatIyuv, //Planar mode: Y + U + V (3 planes)
|
||||||
|
pixelformatYuy2, //Packed mode: Y0+U0+Y1+V0 (1 plane)
|
||||||
|
pixelformatUyvy, //Packed mode: U0+Y0+V0+Y1 (1 plane)
|
||||||
|
pixelformatYvyu, //Packed mode: Y0+V0+Y1+U0 (1 plane)
|
||||||
|
pixelformatNv12, //Planar mode: Y + U/V interleaved (2 planes)
|
||||||
|
pixelformatNv21, //Planar mode: Y + V/U interleaved (2 planes)
|
||||||
|
pixelformatP010, //Planar mode: Y + U/V interleaved (2 planes)
|
||||||
|
pixelformatExternalOes, //Android video texture format
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Surface = opaque {};
|
||||||
|
|
||||||
|
pub const Colorspace = enum(c_int) {
|
||||||
|
colorspaceSrgb, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
|
||||||
|
colorRangeFull,
|
||||||
|
colorPrimariesBt709,
|
||||||
|
transferCharacteristicsSrgb,
|
||||||
|
matrixCoefficientsIdentity,
|
||||||
|
colorspaceSrgbLinear, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709
|
||||||
|
transferCharacteristicsLinear,
|
||||||
|
colorspaceHdr10, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020
|
||||||
|
colorPrimariesBt2020,
|
||||||
|
transferCharacteristicsPq,
|
||||||
|
colorspaceJpeg, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601
|
||||||
|
transferCharacteristicsBt601,
|
||||||
|
matrixCoefficientsBt601,
|
||||||
|
colorspaceBt601Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601
|
||||||
|
colorRangeLimited,
|
||||||
|
colorPrimariesBt601,
|
||||||
|
colorspaceBt601Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601
|
||||||
|
colorspaceBt709Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709
|
||||||
|
transferCharacteristicsBt709,
|
||||||
|
matrixCoefficientsBt709,
|
||||||
|
colorspaceBt709Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709
|
||||||
|
colorspaceBt2020Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020
|
||||||
|
matrixCoefficientsBt2020Ncl,
|
||||||
|
colorspaceBt2020Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020
|
||||||
|
colorspaceRgbDefault, //The default colorspace for RGB surfaces if no colorspace is specified
|
||||||
|
colorspaceYuvDefault, //The default colorspace for YUV surfaces if no colorspace is specified
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PropertiesID = u32;
|
||||||
|
|
||||||
|
pub const CameraID = u32;
|
||||||
|
|
||||||
|
pub const Camera = opaque {
|
||||||
|
pub inline fn getCameraPermissionState(camera: *Camera) c_int {
|
||||||
|
return c.SDL_GetCameraPermissionState(camera);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCameraID(camera: *Camera) CameraID {
|
||||||
|
return c.SDL_GetCameraID(camera);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCameraProperties(camera: *Camera) PropertiesID {
|
||||||
|
return c.SDL_GetCameraProperties(camera);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCameraFormat(camera: *Camera, spec: ?*CameraSpec) bool {
|
||||||
|
return c.SDL_GetCameraFormat(camera, spec);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn acquireCameraFrame(camera: *Camera, timestampNS: *u64) ?*Surface {
|
||||||
|
return c.SDL_AcquireCameraFrame(camera, @ptrCast(timestampNS));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn releaseCameraFrame(camera: *Camera, frame: ?*Surface) void {
|
||||||
|
return c.SDL_ReleaseCameraFrame(camera, frame);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn closeCamera(camera: *Camera) void {
|
||||||
|
return c.SDL_CloseCamera(camera);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const CameraSpec = extern struct {
|
||||||
|
format: PixelFormat, // Frame format
|
||||||
|
colorspace: Colorspace, // Frame colorspace
|
||||||
|
width: c_int, // Frame width
|
||||||
|
height: c_int, // Frame height
|
||||||
|
framerate_numerator: c_int, // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)
|
||||||
|
framerate_denominator: c_int, // Frame rate demoninator ((num / denom) == FPS, (denom / num) == duration in seconds)
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const CameraPosition = enum(c_int) {
|
||||||
|
cameraPositionUnknown,
|
||||||
|
cameraPositionFrontFacing,
|
||||||
|
cameraPositionBackFacing,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn getNumCameraDrivers() c_int {
|
||||||
|
return c.SDL_GetNumCameraDrivers();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCameraDriver(index: c_int) [*c]const u8 {
|
||||||
|
return c.SDL_GetCameraDriver(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCurrentCameraDriver() [*c]const u8 {
|
||||||
|
return c.SDL_GetCurrentCameraDriver();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCameras(count: *c_int) ?*CameraID {
|
||||||
|
return c.SDL_GetCameras(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCameraSupportedFormats(devid: CameraID, count: *c_int) [*c][*c]CameraSpec {
|
||||||
|
return c.SDL_GetCameraSupportedFormats(devid, @ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 {
|
||||||
|
return c.SDL_GetCameraName(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCameraPosition(instance_id: CameraID) CameraPosition {
|
||||||
|
return c.SDL_GetCameraPosition(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openCamera(instance_id: CameraID, spec: *const CameraSpec) ?*Camera {
|
||||||
|
return c.SDL_OpenCamera(instance_id, @ptrCast(spec));
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub inline fn setClipboardText(text: [*c]const u8) bool {
|
||||||
|
return c.SDL_SetClipboardText(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getClipboardText() [*c]u8 {
|
||||||
|
return c.SDL_GetClipboardText();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hasClipboardText() bool {
|
||||||
|
return c.SDL_HasClipboardText();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setPrimarySelectionText(text: [*c]const u8) bool {
|
||||||
|
return c.SDL_SetPrimarySelectionText(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getPrimarySelectionText() [*c]u8 {
|
||||||
|
return c.SDL_GetPrimarySelectionText();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hasPrimarySelectionText() bool {
|
||||||
|
return c.SDL_HasPrimarySelectionText();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const ClipboardDataCallback = c.SDL_ClipboardDataCallback;
|
||||||
|
|
||||||
|
pub const ClipboardCleanupCallback = c.SDL_ClipboardCleanupCallback;
|
||||||
|
|
||||||
|
pub inline fn setClipboardData(callback: ClipboardDataCallback, cleanup: ClipboardCleanupCallback, userdata: ?*anyopaque, mime_types: [*c][*c]const u8, num_mime_types: usize) bool {
|
||||||
|
return c.SDL_SetClipboardData(callback, cleanup, userdata, mime_types, num_mime_types);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn clearClipboardData() bool {
|
||||||
|
return c.SDL_ClearClipboardData();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getClipboardData(mime_type: [*c]const u8, size: *usize) ?*anyopaque {
|
||||||
|
return c.SDL_GetClipboardData(mime_type, @ptrCast(size));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hasClipboardData(mime_type: [*c]const u8) bool {
|
||||||
|
return c.SDL_HasClipboardData(mime_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getClipboardMimeTypes(num_mime_types: *usize) [*c][*c]u8 {
|
||||||
|
return c.SDL_GetClipboardMimeTypes(@ptrCast(num_mime_types));
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const Window = opaque {};
|
||||||
|
|
||||||
|
pub const PropertiesID = u32;
|
||||||
|
|
||||||
|
pub const DialogFileFilter = extern struct {
|
||||||
|
name: [*c]const u8,
|
||||||
|
pattern: [*c]const u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const DialogFileCallback = c.SDL_DialogFileCallback;
|
||||||
|
|
||||||
|
pub inline fn showOpenFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: *const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8, allow_many: bool) void {
|
||||||
|
return c.SDL_ShowOpenFileDialog(callback, userdata, window, @ptrCast(filters), nfilters, default_location, allow_many);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn showSaveFileDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, filters: *const DialogFileFilter, nfilters: c_int, default_location: [*c]const u8) void {
|
||||||
|
return c.SDL_ShowSaveFileDialog(callback, userdata, window, @ptrCast(filters), nfilters, default_location);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn showOpenFolderDialog(callback: DialogFileCallback, userdata: ?*anyopaque, window: ?*Window, default_location: [*c]const u8, allow_many: bool) void {
|
||||||
|
return c.SDL_ShowOpenFolderDialog(callback, userdata, window, default_location, allow_many);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const FileDialogType = enum(c_int) {
|
||||||
|
filedialogOpenfile,
|
||||||
|
filedialogSavefile,
|
||||||
|
filedialogOpenfolder,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn showFileDialogWithProperties(_type: FileDialogType, callback: DialogFileCallback, userdata: ?*anyopaque, props: PropertiesID) void {
|
||||||
|
return c.SDL_ShowFileDialogWithProperties(@intFromEnum(_type), callback, userdata, props);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub inline fn outOfMemory() bool {
|
||||||
|
return c.SDL_OutOfMemory();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getError() [*c]const u8 {
|
||||||
|
return c.SDL_GetError();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn clearError() bool {
|
||||||
|
return c.SDL_ClearError();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,768 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const PenID = u32;
|
||||||
|
|
||||||
|
pub const WindowID = u32;
|
||||||
|
|
||||||
|
pub const AudioDeviceID = u32;
|
||||||
|
|
||||||
|
pub const DisplayID = u32;
|
||||||
|
|
||||||
|
pub const CameraID = u32;
|
||||||
|
|
||||||
|
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
|
||||||
|
penInputEraserTip: bool = false, // eraser tip is used
|
||||||
|
pad0: u24 = 0,
|
||||||
|
rsvd: bool = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MouseButtonFlags = packed struct(u32) {
|
||||||
|
buttonLeft: bool = false,
|
||||||
|
buttonMiddle: bool = false,
|
||||||
|
buttonX1: bool = false,
|
||||||
|
pad0: u28 = 0,
|
||||||
|
rsvd: bool = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Scancode = enum(c_int) {
|
||||||
|
scancodeBackslash,
|
||||||
|
scancodeNonushash,
|
||||||
|
scancodeGrave,
|
||||||
|
scancodeInsert,
|
||||||
|
scancodeNumlockclear,
|
||||||
|
scancodeNonusbackslash,
|
||||||
|
scancodeApplication, //windows contextual menu, compose
|
||||||
|
scancodePower,
|
||||||
|
scancodeHelp, //AL Integrated Help Center
|
||||||
|
scancodeMenu, //Menu (show menu)
|
||||||
|
scancodeStop, //AC Stop
|
||||||
|
scancodeAgain, //AC Redo/Repeat
|
||||||
|
scancodeUndo, //AC Undo
|
||||||
|
scancodeCut, //AC Cut
|
||||||
|
scancodeCopy, //AC Copy
|
||||||
|
scancodePaste, //AC Paste
|
||||||
|
scancodeFind, //AC Find
|
||||||
|
scancodeInternational1,
|
||||||
|
scancodeInternational3, //Yen
|
||||||
|
scancodeLang1, //Hangul/English toggle
|
||||||
|
scancodeLang2, //Hanja conversion
|
||||||
|
scancodeLang3, //Katakana
|
||||||
|
scancodeLang4, //Hiragana
|
||||||
|
scancodeLang5, //Zenkaku/Hankaku
|
||||||
|
scancodeLang6, //reserved
|
||||||
|
scancodeLang7, //reserved
|
||||||
|
scancodeLang8, //reserved
|
||||||
|
scancodeLang9, //reserved
|
||||||
|
scancodeAlterase, //Erase-Eaze
|
||||||
|
scancodeCancel, //AC Cancel
|
||||||
|
scancodeLalt, //alt, option
|
||||||
|
scancodeLgui, //windows, command (apple), meta
|
||||||
|
scancodeRalt, //alt gr, option
|
||||||
|
scancodeRgui, //windows, command (apple), meta
|
||||||
|
scancodeMode,
|
||||||
|
scancodeSleep, //Sleep
|
||||||
|
scancodeWake, //Wake
|
||||||
|
scancodeChannelIncrement, //Channel Increment
|
||||||
|
scancodeChannelDecrement, //Channel Decrement
|
||||||
|
scancodeMediaPlay, //Play
|
||||||
|
scancodeMediaPause, //Pause
|
||||||
|
scancodeMediaRecord, //Record
|
||||||
|
scancodeMediaFastForward, //Fast Forward
|
||||||
|
scancodeMediaRewind, //Rewind
|
||||||
|
scancodeMediaNextTrack, //Next Track
|
||||||
|
scancodeMediaPreviousTrack, //Previous Track
|
||||||
|
scancodeMediaStop, //Stop
|
||||||
|
scancodeMediaEject, //Eject
|
||||||
|
scancodeMediaPlayPause, //Play / Pause
|
||||||
|
scancodeMediaSelect,
|
||||||
|
scancodeAcNew, //AC New
|
||||||
|
scancodeAcOpen, //AC Open
|
||||||
|
scancodeAcClose, //AC Close
|
||||||
|
scancodeAcExit, //AC Exit
|
||||||
|
scancodeAcSave, //AC Save
|
||||||
|
scancodeAcPrint, //AC Print
|
||||||
|
scancodeAcProperties, //AC Properties
|
||||||
|
scancodeAcSearch, //AC Search
|
||||||
|
scancodeAcHome, //AC Home
|
||||||
|
scancodeAcBack, //AC Back
|
||||||
|
scancodeAcForward, //AC Forward
|
||||||
|
scancodeAcStop, //AC Stop
|
||||||
|
scancodeAcRefresh, //AC Refresh
|
||||||
|
scancodeAcBookmarks, //AC Bookmarks
|
||||||
|
scancodeSoftleft,
|
||||||
|
scancodeSoftright,
|
||||||
|
scancodeCall, //Used for accepting phone calls.
|
||||||
|
scancodeEndcall, //Used for rejecting phone calls.
|
||||||
|
scancodeReserved, //400-500 reserved for dynamic keycodes
|
||||||
|
scancodeCount,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const TouchID = u64;
|
||||||
|
|
||||||
|
pub const KeyboardID = u32;
|
||||||
|
|
||||||
|
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!
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MouseID = u32;
|
||||||
|
|
||||||
|
pub const MouseWheelDirection = enum(c_int) {
|
||||||
|
mousewheelNormal, //The scroll direction is normal
|
||||||
|
mousewheelFlipped, //The scroll direction is flipped / natural
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PowerState = enum(c_int) {
|
||||||
|
powerstateError, //error determining power status
|
||||||
|
powerstateUnknown, //cannot determine power status
|
||||||
|
powerstateOnBattery, //Not plugged in, running on the battery
|
||||||
|
powerstateNoBattery, //Plugged in, no battery available
|
||||||
|
powerstateCharging, //Plugged in, charging battery
|
||||||
|
powerstateCharged,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Window = opaque {};
|
||||||
|
|
||||||
|
pub const FingerID = u64;
|
||||||
|
|
||||||
|
pub const Keycode = u32;
|
||||||
|
|
||||||
|
pub const SensorID = u32;
|
||||||
|
|
||||||
|
pub const JoystickID = u32;
|
||||||
|
|
||||||
|
pub const Keymod = u16;
|
||||||
|
|
||||||
|
pub const EventType = enum(c_int) {
|
||||||
|
eventFirst, //Unused (do not remove)
|
||||||
|
eventQuit, //User-requested quit
|
||||||
|
eventTerminating,
|
||||||
|
eventLowMemory,
|
||||||
|
eventWillEnterBackground,
|
||||||
|
eventDidEnterBackground,
|
||||||
|
eventWillEnterForeground,
|
||||||
|
eventDidEnterForeground,
|
||||||
|
eventLocaleChanged, //The user's locale preferences have changed.
|
||||||
|
eventSystemThemeChanged, //The system theme changed
|
||||||
|
eventDisplayOrientation, //Display orientation has changed to data1
|
||||||
|
eventDisplayAdded, //Display has been added to the system
|
||||||
|
eventDisplayRemoved, //Display has been removed from the system
|
||||||
|
eventDisplayMoved, //Display has changed position
|
||||||
|
eventDisplayDesktopModeChanged, //Display has changed desktop mode
|
||||||
|
eventDisplayCurrentModeChanged, //Display has changed current mode
|
||||||
|
eventDisplayContentScaleChanged, //Display has changed content scale
|
||||||
|
eventWindowShown, //Window has been shown
|
||||||
|
eventWindowHidden, //Window has been hidden
|
||||||
|
eventWindowExposed, //Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event
|
||||||
|
eventWindowMoved, //Window has been moved to data1, data2
|
||||||
|
eventWindowResized, //Window has been resized to data1xdata2
|
||||||
|
eventWindowPixelSizeChanged, //The pixel size of the window has changed to data1xdata2
|
||||||
|
eventWindowMetalViewResized, //The pixel size of a Metal view associated with the window has changed
|
||||||
|
eventWindowMinimized, //Window has been minimized
|
||||||
|
eventWindowMaximized, //Window has been maximized
|
||||||
|
eventWindowRestored, //Window has been restored to normal size and position
|
||||||
|
eventWindowMouseEnter, //Window has gained mouse focus
|
||||||
|
eventWindowMouseLeave, //Window has lost mouse focus
|
||||||
|
eventWindowFocusGained, //Window has gained keyboard focus
|
||||||
|
eventWindowFocusLost, //Window has lost keyboard focus
|
||||||
|
eventWindowCloseRequested, //The window manager requests that the window be closed
|
||||||
|
eventWindowHitTest, //Window had a hit test that wasn't SDL_HITTEST_NORMAL
|
||||||
|
eventWindowIccprofChanged, //The ICC profile of the window's display has changed
|
||||||
|
eventWindowDisplayChanged, //Window has been moved to display data1
|
||||||
|
eventWindowDisplayScaleChanged, //Window display scale has been changed
|
||||||
|
eventWindowSafeAreaChanged, //The window safe area has been changed
|
||||||
|
eventWindowOccluded, //The window has been occluded
|
||||||
|
eventWindowEnterFullscreen, //The window has entered fullscreen mode
|
||||||
|
eventWindowLeaveFullscreen, //The window has left fullscreen mode
|
||||||
|
eventWindowDestroyed,
|
||||||
|
eventWindowHdrStateChanged, //Window HDR properties have changed
|
||||||
|
eventKeyDown, //Key pressed
|
||||||
|
eventKeyUp, //Key released
|
||||||
|
eventTextEditing, //Keyboard text editing (composition)
|
||||||
|
eventTextInput, //Keyboard text input
|
||||||
|
eventKeymapChanged,
|
||||||
|
eventKeyboardAdded, //A new keyboard has been inserted into the system
|
||||||
|
eventKeyboardRemoved, //A keyboard has been removed
|
||||||
|
eventTextEditingCandidates, //Keyboard text editing candidates
|
||||||
|
eventMouseMotion, //Mouse moved
|
||||||
|
eventMouseButtonDown, //Mouse button pressed
|
||||||
|
eventMouseButtonUp, //Mouse button released
|
||||||
|
eventMouseWheel, //Mouse wheel motion
|
||||||
|
eventMouseAdded, //A new mouse has been inserted into the system
|
||||||
|
eventMouseRemoved, //A mouse has been removed
|
||||||
|
eventJoystickAxisMotion, //Joystick axis motion
|
||||||
|
eventJoystickBallMotion, //Joystick trackball motion
|
||||||
|
eventJoystickHatMotion, //Joystick hat position change
|
||||||
|
eventJoystickButtonDown, //Joystick button pressed
|
||||||
|
eventJoystickButtonUp, //Joystick button released
|
||||||
|
eventJoystickAdded, //A new joystick has been inserted into the system
|
||||||
|
eventJoystickRemoved, //An opened joystick has been removed
|
||||||
|
eventJoystickBatteryUpdated, //Joystick battery level change
|
||||||
|
eventJoystickUpdateComplete, //Joystick update is complete
|
||||||
|
eventGamepadAxisMotion, //Gamepad axis motion
|
||||||
|
eventGamepadButtonDown, //Gamepad button pressed
|
||||||
|
eventGamepadButtonUp, //Gamepad button released
|
||||||
|
eventGamepadAdded, //A new gamepad has been inserted into the system
|
||||||
|
eventGamepadRemoved, //A gamepad has been removed
|
||||||
|
eventGamepadRemapped, //The gamepad mapping was updated
|
||||||
|
eventGamepadTouchpadDown, //Gamepad touchpad was touched
|
||||||
|
eventGamepadTouchpadMotion, //Gamepad touchpad finger was moved
|
||||||
|
eventGamepadTouchpadUp, //Gamepad touchpad finger was lifted
|
||||||
|
eventGamepadSensorUpdate, //Gamepad sensor was updated
|
||||||
|
eventGamepadUpdateComplete, //Gamepad update is complete
|
||||||
|
eventGamepadSteamHandleUpdated, //Gamepad Steam handle has changed
|
||||||
|
eventFingerUp,
|
||||||
|
eventFingerMotion,
|
||||||
|
eventFingerCanceled,
|
||||||
|
eventClipboardUpdate, //The clipboard or primary selection changed
|
||||||
|
eventDropFile, //The system requests a file open
|
||||||
|
eventDropText, //text/plain drag-and-drop event
|
||||||
|
eventDropBegin, //A new set of drops is beginning (NULL filename)
|
||||||
|
eventDropComplete, //Current set of drops is now complete (NULL filename)
|
||||||
|
eventDropPosition, //Position while moving over the window
|
||||||
|
eventAudioDeviceAdded, //A new audio device is available
|
||||||
|
eventAudioDeviceRemoved, //An audio device has been removed.
|
||||||
|
eventAudioDeviceFormatChanged, //An audio device's format has been changed by the system.
|
||||||
|
eventSensorUpdate, //A sensor was updated
|
||||||
|
eventPenProximityIn, //Pressure-sensitive pen has become available
|
||||||
|
eventPenProximityOut, //Pressure-sensitive pen has become unavailable
|
||||||
|
eventPenDown, //Pressure-sensitive pen touched drawing surface
|
||||||
|
eventPenUp, //Pressure-sensitive pen stopped touching drawing surface
|
||||||
|
eventPenButtonDown, //Pressure-sensitive pen button pressed
|
||||||
|
eventPenButtonUp, //Pressure-sensitive pen button released
|
||||||
|
eventPenMotion, //Pressure-sensitive pen is moving on the tablet
|
||||||
|
eventPenAxis, //Pressure-sensitive pen angle/pressure/etc changed
|
||||||
|
eventCameraDeviceAdded, //A new camera device is available
|
||||||
|
eventCameraDeviceRemoved, //A camera device has been removed.
|
||||||
|
eventCameraDeviceApproved, //A camera device has been approved for use by the user.
|
||||||
|
eventCameraDeviceDenied, //A camera device has been denied for use by the user.
|
||||||
|
eventRenderTargetsReset, //The render targets have been reset and their contents need to be updated
|
||||||
|
eventRenderDeviceReset, //The device has been reset and all textures need to be recreated
|
||||||
|
eventRenderDeviceLost, //The device has been lost and can't be recovered.
|
||||||
|
eventPrivate1,
|
||||||
|
eventPrivate2,
|
||||||
|
eventPrivate3,
|
||||||
|
eventPollSentinel, //Signals the end of an event poll cycle
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const CommonEvent = extern struct {
|
||||||
|
_type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const DisplayEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_DISPLAYEVENT_*
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
displayID: DisplayID, // The associated display
|
||||||
|
data1: i32, // event dependent data
|
||||||
|
data2: i32, // event dependent data
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const WindowEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_WINDOW_*
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The associated window
|
||||||
|
data1: i32, // event dependent data
|
||||||
|
data2: i32, // event dependent data
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const KeyboardDeviceEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: KeyboardID, // The keyboard instance id
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const KeyboardEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with keyboard focus, if any
|
||||||
|
which: KeyboardID, // The keyboard instance id, or 0 if unknown or virtual
|
||||||
|
scancode: Scancode, // SDL physical key code
|
||||||
|
key: Keycode, // SDL virtual key code
|
||||||
|
mod: Keymod, // current key modifiers
|
||||||
|
raw: u16, // The platform dependent scancode for this event
|
||||||
|
down: bool, // true if the key is pressed
|
||||||
|
repeat: bool, // true if this is a key repeat
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const TextEditingEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_TEXT_EDITING
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with keyboard focus, if any
|
||||||
|
text: [*c]const u8, // The editing text
|
||||||
|
start: i32, // The start cursor of selected editing text, or -1 if not set
|
||||||
|
length: i32, // The length of selected editing text, or -1 if not set
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const TextEditingCandidatesEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_TEXT_EDITING_CANDIDATES
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with keyboard focus, if any
|
||||||
|
candidates: [*c]const [*c]const u8, // The list of candidates, or NULL if there are no candidates available
|
||||||
|
num_candidates: i32, // The number of strings in `candidates`
|
||||||
|
selected_candidate: i32, // The index of the selected candidate, or -1 if no candidate is selected
|
||||||
|
horizontal: bool, // true if the list is horizontal, false if it's vertical
|
||||||
|
padding1: u8,
|
||||||
|
padding2: u8,
|
||||||
|
padding3: u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const TextInputEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_TEXT_INPUT
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with keyboard focus, if any
|
||||||
|
text: [*c]const u8, // The input text, UTF-8 encoded
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MouseDeviceEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: MouseID, // The mouse instance id
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MouseMotionEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_MOUSE_MOTION
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with mouse focus, if any
|
||||||
|
which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0
|
||||||
|
state: MouseButtonFlags, // The current button state
|
||||||
|
x: f32, // X coordinate, relative to window
|
||||||
|
y: f32, // Y coordinate, relative to window
|
||||||
|
xrel: f32, // The relative motion in the X direction
|
||||||
|
yrel: f32, // The relative motion in the Y direction
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MouseButtonEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with mouse focus, if any
|
||||||
|
which: MouseID, // The mouse instance id in relative mode, SDL_TOUCH_MOUSEID for touch events, or 0
|
||||||
|
button: u8, // The mouse button index
|
||||||
|
down: bool, // true if the button is pressed
|
||||||
|
clicks: u8, // 1 for single-click, 2 for double-click, etc.
|
||||||
|
padding: u8,
|
||||||
|
x: f32, // X coordinate, relative to window
|
||||||
|
y: f32, // Y coordinate, relative to window
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MouseWheelEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_MOUSE_WHEEL
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with mouse focus, if any
|
||||||
|
which: MouseID, // The mouse instance id in relative mode or 0
|
||||||
|
x: f32, // The amount scrolled horizontally, positive to the right and negative to the left
|
||||||
|
y: f32, // The amount scrolled vertically, positive away from the user and negative toward the user
|
||||||
|
direction: MouseWheelDirection, // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back
|
||||||
|
mouse_x: f32, // X coordinate, relative to window
|
||||||
|
mouse_y: f32, // Y coordinate, relative to window
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const JoyAxisEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_JOYSTICK_AXIS_MOTION
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
axis: u8, // The joystick axis index
|
||||||
|
padding1: u8,
|
||||||
|
padding2: u8,
|
||||||
|
padding3: u8,
|
||||||
|
value: i16, // The axis value (range: -32768 to 32767)
|
||||||
|
padding4: u16,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const JoyBallEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_JOYSTICK_BALL_MOTION
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
ball: u8, // The joystick trackball index
|
||||||
|
padding1: u8,
|
||||||
|
padding2: u8,
|
||||||
|
padding3: u8,
|
||||||
|
xrel: i16, // The relative motion in the X direction
|
||||||
|
yrel: i16, // The relative motion in the Y direction
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const JoyHatEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_JOYSTICK_HAT_MOTION
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
hat: u8, // The joystick hat index
|
||||||
|
padding1: u8,
|
||||||
|
padding2: u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const JoyButtonEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
button: u8, // The joystick button index
|
||||||
|
down: bool, // true if the button is pressed
|
||||||
|
padding1: u8,
|
||||||
|
padding2: u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const JoyDeviceEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const JoyBatteryEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_JOYSTICK_BATTERY_UPDATED
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
state: PowerState, // The joystick battery state
|
||||||
|
percent: c_int, // The joystick battery percent charge remaining
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadAxisEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_GAMEPAD_AXIS_MOTION
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
axis: u8, // The gamepad axis (SDL_GamepadAxis)
|
||||||
|
padding1: u8,
|
||||||
|
padding2: u8,
|
||||||
|
padding3: u8,
|
||||||
|
value: i16, // The axis value (range: -32768 to 32767)
|
||||||
|
padding4: u16,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadButtonEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
button: u8, // The gamepad button (SDL_GamepadButton)
|
||||||
|
down: bool, // true if the button is pressed
|
||||||
|
padding1: u8,
|
||||||
|
padding2: u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadDeviceEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadTouchpadEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
touchpad: i32, // The index of the touchpad
|
||||||
|
finger: i32, // The index of the finger on the touchpad
|
||||||
|
x: f32, // Normalized in the range 0...1 with 0 being on the left
|
||||||
|
y: f32, // Normalized in the range 0...1 with 0 being at the top
|
||||||
|
pressure: f32, // Normalized in the range 0...1
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadSensorEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_GAMEPAD_SENSOR_UPDATE
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: JoystickID, // The joystick instance id
|
||||||
|
sensor: i32, // The type of the sensor, one of the values of SDL_SensorType
|
||||||
|
data: [3]f32, // Up to 3 values from the sensor, as defined in SDL_sensor.h
|
||||||
|
sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const AudioDeviceEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: AudioDeviceID, // SDL_AudioDeviceID for the device being added or removed or changing
|
||||||
|
recording: bool, // false if a playback device, true if a recording device.
|
||||||
|
padding1: u8,
|
||||||
|
padding2: u8,
|
||||||
|
padding3: u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const CameraDeviceEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: CameraID, // SDL_CameraID for the device being added or removed or changing
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const RenderEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_RENDER_TARGETS_RESET, SDL_EVENT_RENDER_DEVICE_RESET, SDL_EVENT_RENDER_DEVICE_LOST
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window containing the renderer in question.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const TouchFingerEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_FINGER_DOWN, SDL_EVENT_FINGER_UP, SDL_EVENT_FINGER_MOTION, or SDL_EVENT_FINGER_CANCELED
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
touchID: TouchID, // The touch device id
|
||||||
|
fingerID: FingerID,
|
||||||
|
x: f32, // Normalized in the range 0...1
|
||||||
|
y: f32, // Normalized in the range 0...1
|
||||||
|
dx: f32, // Normalized in the range -1...1
|
||||||
|
dy: f32, // Normalized in the range -1...1
|
||||||
|
pressure: f32, // Normalized in the range 0...1
|
||||||
|
windowID: WindowID, // The window underneath the finger, if any
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PenProximityEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with pen focus, if any
|
||||||
|
which: PenID, // The pen instance id
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PenMotionEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_PEN_MOTION
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with pen focus, if any
|
||||||
|
which: PenID, // The pen instance id
|
||||||
|
pen_state: PenInputFlags, // Complete pen input state at time of event
|
||||||
|
x: f32, // X coordinate, relative to window
|
||||||
|
y: f32, // Y coordinate, relative to window
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PenTouchEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with pen focus, if any
|
||||||
|
which: PenID, // The pen instance id
|
||||||
|
pen_state: PenInputFlags, // Complete pen input state at time of event
|
||||||
|
x: f32, // X coordinate, relative to window
|
||||||
|
y: f32, // Y coordinate, relative to window
|
||||||
|
eraser: bool, // true if eraser end is used (not all pens support this).
|
||||||
|
down: bool, // true if the pen is touching or false if the pen is lifted off
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PenButtonEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with mouse focus, if any
|
||||||
|
which: PenID, // The pen instance id
|
||||||
|
pen_state: PenInputFlags, // Complete pen input state at time of event
|
||||||
|
x: f32, // X coordinate, relative to window
|
||||||
|
y: f32, // Y coordinate, relative to window
|
||||||
|
button: u8, // The pen button index (first button is 1).
|
||||||
|
down: bool, // true if the button is pressed
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PenAxisEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_PEN_AXIS
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window with pen focus, if any
|
||||||
|
which: PenID, // The pen instance id
|
||||||
|
pen_state: PenInputFlags, // Complete pen input state at time of event
|
||||||
|
x: f32, // X coordinate, relative to window
|
||||||
|
y: f32, // Y coordinate, relative to window
|
||||||
|
axis: PenAxis, // Axis that has changed
|
||||||
|
value: f32, // New value of axis
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const DropEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The window that was dropped on, if any
|
||||||
|
x: f32, // X coordinate, relative to window (not on begin)
|
||||||
|
y: f32, // Y coordinate, relative to window (not on begin)
|
||||||
|
source: [*c]const u8, // The source app that sent this drop event, or NULL if that isn't available
|
||||||
|
data: [*c]const u8, // The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const ClipboardEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_CLIPBOARD_UPDATE
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
owner: bool, // are we owning the clipboard (internal update)
|
||||||
|
num_mime_types: i32, // number of mime types
|
||||||
|
mime_types: [*c][*c]const u8, // current mime types
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const SensorEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_SENSOR_UPDATE
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
which: SensorID, // The instance ID of the sensor
|
||||||
|
data: [6]f32, // Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData()
|
||||||
|
sensor_timestamp: u64, // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const QuitEvent = extern struct {
|
||||||
|
_type: EventType, // SDL_EVENT_QUIT
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const UserEvent = extern struct {
|
||||||
|
_type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration
|
||||||
|
reserved: u32,
|
||||||
|
timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS()
|
||||||
|
windowID: WindowID, // The associated window if any
|
||||||
|
code: i32, // User defined event code
|
||||||
|
data1: ?*anyopaque, // User defined data pointer
|
||||||
|
data2: ?*anyopaque, // User defined data pointer
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Event = extern union {
|
||||||
|
_type: u32, // Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration
|
||||||
|
common: CommonEvent, // Common event data
|
||||||
|
display: DisplayEvent, // Display event data
|
||||||
|
window: WindowEvent, // Window event data
|
||||||
|
kdevice: KeyboardDeviceEvent, // Keyboard device change event data
|
||||||
|
key: KeyboardEvent, // Keyboard event data
|
||||||
|
edit: TextEditingEvent, // Text editing event data
|
||||||
|
edit_candidates: TextEditingCandidatesEvent, // Text editing candidates event data
|
||||||
|
text: TextInputEvent, // Text input event data
|
||||||
|
mdevice: MouseDeviceEvent, // Mouse device change event data
|
||||||
|
motion: MouseMotionEvent, // Mouse motion event data
|
||||||
|
button: MouseButtonEvent, // Mouse button event data
|
||||||
|
wheel: MouseWheelEvent, // Mouse wheel event data
|
||||||
|
jdevice: JoyDeviceEvent, // Joystick device change event data
|
||||||
|
jaxis: JoyAxisEvent, // Joystick axis event data
|
||||||
|
jball: JoyBallEvent, // Joystick ball event data
|
||||||
|
jhat: JoyHatEvent, // Joystick hat event data
|
||||||
|
jbutton: JoyButtonEvent, // Joystick button event data
|
||||||
|
jbattery: JoyBatteryEvent, // Joystick battery event data
|
||||||
|
gdevice: GamepadDeviceEvent, // Gamepad device event data
|
||||||
|
gaxis: GamepadAxisEvent, // Gamepad axis event data
|
||||||
|
gbutton: GamepadButtonEvent, // Gamepad button event data
|
||||||
|
gtouchpad: GamepadTouchpadEvent, // Gamepad touchpad event data
|
||||||
|
gsensor: GamepadSensorEvent, // Gamepad sensor event data
|
||||||
|
adevice: AudioDeviceEvent, // Audio device event data
|
||||||
|
cdevice: CameraDeviceEvent, // Camera device event data
|
||||||
|
sensor: SensorEvent, // Sensor event data
|
||||||
|
quit: QuitEvent, // Quit request event data
|
||||||
|
user: UserEvent, // Custom event data
|
||||||
|
tfinger: TouchFingerEvent, // Touch finger event data
|
||||||
|
pproximity: PenProximityEvent, // Pen proximity event data
|
||||||
|
ptouch: PenTouchEvent, // Pen tip touching event data
|
||||||
|
pmotion: PenMotionEvent, // Pen motion event data
|
||||||
|
pbutton: PenButtonEvent, // Pen button event data
|
||||||
|
paxis: PenAxisEvent, // Pen axis event data
|
||||||
|
render: RenderEvent, // Render event data
|
||||||
|
drop: DropEvent, // Drag and drop event data
|
||||||
|
clipboard: ClipboardEvent, // Clipboard event data
|
||||||
|
padding: [128]u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn pumpEvents() void {
|
||||||
|
return c.SDL_PumpEvents();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const EventAction = enum(c_int) {
|
||||||
|
addevent, //Add events to the back of the queue.
|
||||||
|
peekevent, //Check but don't remove events from the queue front.
|
||||||
|
getevent, //Retrieve/remove events from the front of the queue.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn peepEvents(events: ?*Event, numevents: c_int, action: EventAction, minType: u32, maxType: u32) c_int {
|
||||||
|
return c.SDL_PeepEvents(events, numevents, action, minType, maxType);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hasEvent(_type: u32) bool {
|
||||||
|
return c.SDL_HasEvent(_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hasEvents(minType: u32, maxType: u32) bool {
|
||||||
|
return c.SDL_HasEvents(minType, maxType);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn flushEvent(_type: u32) void {
|
||||||
|
return c.SDL_FlushEvent(_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn flushEvents(minType: u32, maxType: u32) void {
|
||||||
|
return c.SDL_FlushEvents(minType, maxType);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn pollEvent(event: ?*Event) bool {
|
||||||
|
return c.SDL_PollEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn waitEvent(event: ?*Event) bool {
|
||||||
|
return c.SDL_WaitEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn waitEventTimeout(event: ?*Event, timeoutMS: i32) bool {
|
||||||
|
return c.SDL_WaitEventTimeout(event, timeoutMS);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn pushEvent(event: ?*Event) bool {
|
||||||
|
return c.SDL_PushEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const EventFilter = c.SDL_EventFilter;
|
||||||
|
|
||||||
|
pub inline fn setEventFilter(filter: EventFilter, userdata: ?*anyopaque) void {
|
||||||
|
return c.SDL_SetEventFilter(filter, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getEventFilter(filter: ?*EventFilter, userdata: [*c]?*anyopaque) bool {
|
||||||
|
return c.SDL_GetEventFilter(filter, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn addEventWatch(filter: EventFilter, userdata: ?*anyopaque) bool {
|
||||||
|
return c.SDL_AddEventWatch(filter, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn removeEventWatch(filter: EventFilter, userdata: ?*anyopaque) void {
|
||||||
|
return c.SDL_RemoveEventWatch(filter, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn filterEvents(filter: EventFilter, userdata: ?*anyopaque) void {
|
||||||
|
return c.SDL_FilterEvents(filter, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setEventEnabled(_type: u32, enabled: bool) void {
|
||||||
|
return c.SDL_SetEventEnabled(_type, enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn eventEnabled(_type: u32) bool {
|
||||||
|
return c.SDL_EventEnabled(_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn registerEvents(numevents: c_int) u32 {
|
||||||
|
return c.SDL_RegisterEvents(numevents);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowFromEvent(event: *const Event) ?*Window {
|
||||||
|
return c.SDL_GetWindowFromEvent(@ptrCast(event));
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,92 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const Time = i64;
|
||||||
|
|
||||||
|
pub inline fn getBasePath() [*c]const u8 {
|
||||||
|
return c.SDL_GetBasePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getPrefPath(org: [*c]const u8, app: [*c]const u8) [*c]u8 {
|
||||||
|
return c.SDL_GetPrefPath(org, app);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const Folder = enum(c_int) {
|
||||||
|
folderHome, //The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents.
|
||||||
|
folderDesktop, //The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons.
|
||||||
|
folderDocuments, //User document files, possibly application-specific. This is a good place to save a user's projects.
|
||||||
|
folderDownloads, //Standard folder for user files downloaded from the internet.
|
||||||
|
folderMusic, //Music files that can be played using a standard music player (mp3, ogg...).
|
||||||
|
folderPictures, //Image files that can be displayed using a standard viewer (png, jpg...).
|
||||||
|
folderPublicshare, //Files that are meant to be shared with other users on the same computer.
|
||||||
|
folderSavedgames, //Save files for games.
|
||||||
|
folderScreenshots, //Application screenshots.
|
||||||
|
folderTemplates, //Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file.
|
||||||
|
folderVideos, //Video files that can be played using a standard video player (mp4, webm...).
|
||||||
|
folderCount,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn getUserFolder(folder: Folder) [*c]const u8 {
|
||||||
|
return c.SDL_GetUserFolder(folder);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const PathType = enum(c_int) {
|
||||||
|
pathtypeNone, //path does not exist
|
||||||
|
pathtypeFile, //a normal file
|
||||||
|
pathtypeDirectory, //a directory
|
||||||
|
pathtypeOther,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PathInfo = extern struct {
|
||||||
|
_type: PathType, // the path type
|
||||||
|
size: u64, // the file size in bytes
|
||||||
|
create_time: Time, // the time when the path was created
|
||||||
|
modify_time: Time, // the last time the path was modified
|
||||||
|
access_time: Time, // the last time the path was read
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GlobFlags = packed struct(u32) {
|
||||||
|
globCaseinsensitive: bool = false,
|
||||||
|
pad0: u30 = 0,
|
||||||
|
rsvd: bool = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn createDirectory(path: [*c]const u8) bool {
|
||||||
|
return c.SDL_CreateDirectory(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const EnumerationResult = enum(c_int) {
|
||||||
|
enumContinue, //Value that requests that enumeration continue.
|
||||||
|
enumSuccess, //Value that requests that enumeration stop, successfully.
|
||||||
|
enumFailure,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback;
|
||||||
|
|
||||||
|
pub inline fn enumerateDirectory(path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool {
|
||||||
|
return c.SDL_EnumerateDirectory(path, callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn removePath(path: [*c]const u8) bool {
|
||||||
|
return c.SDL_RemovePath(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn renamePath(oldpath: [*c]const u8, newpath: [*c]const u8) bool {
|
||||||
|
return c.SDL_RenamePath(oldpath, newpath);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn copyFile(oldpath: [*c]const u8, newpath: [*c]const u8) bool {
|
||||||
|
return c.SDL_CopyFile(oldpath, newpath);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getPathInfo(path: [*c]const u8, info: ?*PathInfo) bool {
|
||||||
|
return c.SDL_GetPathInfo(path, info);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn globDirectory(path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 {
|
||||||
|
return c.SDL_GlobDirectory(path, pattern, @bitCast(flags), @ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCurrentDirectory() [*c]u8 {
|
||||||
|
return c.SDL_GetCurrentDirectory();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,408 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const JoystickConnectionState = enum(c_int) {
|
||||||
|
joystickConnectionUnknown,
|
||||||
|
joystickConnectionWired,
|
||||||
|
joystickConnectionWireless,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GUID = extern struct {
|
||||||
|
data: [16]u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PropertiesID = u32;
|
||||||
|
|
||||||
|
pub const IOStream = opaque {
|
||||||
|
pub inline fn addGamepadMappingsFromIO(iostream: *IOStream, closeio: bool) c_int {
|
||||||
|
return c.SDL_AddGamepadMappingsFromIO(iostream, closeio);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const JoystickID = u32;
|
||||||
|
|
||||||
|
pub const SensorType = enum(c_int) {
|
||||||
|
sensorInvalid, //Returned for an invalid sensor
|
||||||
|
sensorUnknown, //Unknown sensor type
|
||||||
|
sensorAccel, //Accelerometer
|
||||||
|
sensorGyro, //Gyroscope
|
||||||
|
sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk
|
||||||
|
sensorGyroL, //Gyroscope for left Joy-Con controller
|
||||||
|
sensorAccelR, //Accelerometer for right Joy-Con controller
|
||||||
|
sensorGyroR, //Gyroscope for right Joy-Con controller
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PowerState = enum(c_int) {
|
||||||
|
powerstateError, //error determining power status
|
||||||
|
powerstateUnknown, //cannot determine power status
|
||||||
|
powerstateOnBattery, //Not plugged in, running on the battery
|
||||||
|
powerstateNoBattery, //Plugged in, no battery available
|
||||||
|
powerstateCharging, //Plugged in, charging battery
|
||||||
|
powerstateCharged,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Joystick = opaque {};
|
||||||
|
|
||||||
|
pub const Gamepad = opaque {
|
||||||
|
pub inline fn getGamepadMapping(gamepad: *Gamepad) [*c]u8 {
|
||||||
|
return c.SDL_GetGamepadMapping(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadProperties(gamepad: *Gamepad) PropertiesID {
|
||||||
|
return c.SDL_GetGamepadProperties(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadID(gamepad: *Gamepad) JoystickID {
|
||||||
|
return c.SDL_GetGamepadID(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadName(gamepad: *Gamepad) [*c]const u8 {
|
||||||
|
return c.SDL_GetGamepadName(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadPath(gamepad: *Gamepad) [*c]const u8 {
|
||||||
|
return c.SDL_GetGamepadPath(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadType(gamepad: *Gamepad) GamepadType {
|
||||||
|
return @intFromEnum(c.SDL_GetGamepadType(gamepad));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRealGamepadType(gamepad: *Gamepad) GamepadType {
|
||||||
|
return @intFromEnum(c.SDL_GetRealGamepadType(gamepad));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadPlayerIndex(gamepad: *Gamepad) c_int {
|
||||||
|
return c.SDL_GetGamepadPlayerIndex(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setGamepadPlayerIndex(gamepad: *Gamepad, player_index: c_int) bool {
|
||||||
|
return c.SDL_SetGamepadPlayerIndex(gamepad, player_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadVendor(gamepad: *Gamepad) u16 {
|
||||||
|
return c.SDL_GetGamepadVendor(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadProduct(gamepad: *Gamepad) u16 {
|
||||||
|
return c.SDL_GetGamepadProduct(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadProductVersion(gamepad: *Gamepad) u16 {
|
||||||
|
return c.SDL_GetGamepadProductVersion(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadFirmwareVersion(gamepad: *Gamepad) u16 {
|
||||||
|
return c.SDL_GetGamepadFirmwareVersion(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadSerial(gamepad: *Gamepad) [*c]const u8 {
|
||||||
|
return c.SDL_GetGamepadSerial(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadSteamHandle(gamepad: *Gamepad) u64 {
|
||||||
|
return c.SDL_GetGamepadSteamHandle(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadConnectionState(gamepad: *Gamepad) JoystickConnectionState {
|
||||||
|
return c.SDL_GetGamepadConnectionState(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadPowerInfo(gamepad: *Gamepad, percent: *c_int) PowerState {
|
||||||
|
return c.SDL_GetGamepadPowerInfo(gamepad, @ptrCast(percent));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gamepadConnected(gamepad: *Gamepad) bool {
|
||||||
|
return c.SDL_GamepadConnected(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadJoystick(gamepad: *Gamepad) ?*Joystick {
|
||||||
|
return c.SDL_GetGamepadJoystick(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadBindings(gamepad: *Gamepad, count: *c_int) [*c][*c]GamepadBinding {
|
||||||
|
return c.SDL_GetGamepadBindings(gamepad, @ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gamepadHasAxis(gamepad: *Gamepad, axis: GamepadAxis) bool {
|
||||||
|
return c.SDL_GamepadHasAxis(gamepad, axis);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadAxis(gamepad: *Gamepad, axis: GamepadAxis) i16 {
|
||||||
|
return c.SDL_GetGamepadAxis(gamepad, axis);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gamepadHasButton(gamepad: *Gamepad, button: GamepadButton) bool {
|
||||||
|
return c.SDL_GamepadHasButton(gamepad, button);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadButton(gamepad: *Gamepad, button: GamepadButton) bool {
|
||||||
|
return c.SDL_GetGamepadButton(gamepad, button);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadButtonLabel(gamepad: *Gamepad, button: GamepadButton) GamepadButtonLabel {
|
||||||
|
return c.SDL_GetGamepadButtonLabel(gamepad, button);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getNumGamepadTouchpads(gamepad: *Gamepad) c_int {
|
||||||
|
return c.SDL_GetNumGamepadTouchpads(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getNumGamepadTouchpadFingers(gamepad: *Gamepad, touchpad: c_int) c_int {
|
||||||
|
return c.SDL_GetNumGamepadTouchpadFingers(gamepad, touchpad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadTouchpadFinger(gamepad: *Gamepad, touchpad: c_int, finger: c_int, down: *bool, x: *f32, y: *f32, pressure: *f32) bool {
|
||||||
|
return c.SDL_GetGamepadTouchpadFinger(gamepad, touchpad, finger, @ptrCast(down), @ptrCast(x), @ptrCast(y), @ptrCast(pressure));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gamepadHasSensor(gamepad: *Gamepad, _type: SensorType) bool {
|
||||||
|
return c.SDL_GamepadHasSensor(gamepad, @intFromEnum(_type));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setGamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType, enabled: bool) bool {
|
||||||
|
return c.SDL_SetGamepadSensorEnabled(gamepad, @intFromEnum(_type), enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gamepadSensorEnabled(gamepad: *Gamepad, _type: SensorType) bool {
|
||||||
|
return c.SDL_GamepadSensorEnabled(gamepad, @intFromEnum(_type));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadSensorDataRate(gamepad: *Gamepad, _type: SensorType) f32 {
|
||||||
|
return c.SDL_GetGamepadSensorDataRate(gamepad, @intFromEnum(_type));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadSensorData(gamepad: *Gamepad, _type: SensorType, data: *f32, num_values: c_int) bool {
|
||||||
|
return c.SDL_GetGamepadSensorData(gamepad, @intFromEnum(_type), @ptrCast(data), num_values);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn rumbleGamepad(gamepad: *Gamepad, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool {
|
||||||
|
return c.SDL_RumbleGamepad(gamepad, low_frequency_rumble, high_frequency_rumble, duration_ms);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn rumbleGamepadTriggers(gamepad: *Gamepad, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool {
|
||||||
|
return c.SDL_RumbleGamepadTriggers(gamepad, left_rumble, right_rumble, duration_ms);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setGamepadLED(gamepad: *Gamepad, red: u8, green: u8, blue: u8) bool {
|
||||||
|
return c.SDL_SetGamepadLED(gamepad, red, green, blue);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn sendGamepadEffect(gamepad: *Gamepad, data: ?*const anyopaque, size: c_int) bool {
|
||||||
|
return c.SDL_SendGamepadEffect(gamepad, data, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn closeGamepad(gamepad: *Gamepad) void {
|
||||||
|
return c.SDL_CloseGamepad(gamepad);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadAppleSFSymbolsNameForButton(gamepad: *Gamepad, button: GamepadButton) [*c]const u8 {
|
||||||
|
return c.SDL_GetGamepadAppleSFSymbolsNameForButton(gamepad, button);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadAppleSFSymbolsNameForAxis(gamepad: *Gamepad, axis: GamepadAxis) [*c]const u8 {
|
||||||
|
return c.SDL_GetGamepadAppleSFSymbolsNameForAxis(gamepad, axis);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadType = enum(c_int) {
|
||||||
|
gamepadTypeStandard,
|
||||||
|
gamepadTypeXbox360,
|
||||||
|
gamepadTypeXboxone,
|
||||||
|
gamepadTypePs3,
|
||||||
|
gamepadTypePs4,
|
||||||
|
gamepadTypePs5,
|
||||||
|
gamepadTypeNintendoSwitchPro,
|
||||||
|
gamepadTypeNintendoSwitchJoyconLeft,
|
||||||
|
gamepadTypeNintendoSwitchJoyconRight,
|
||||||
|
gamepadTypeNintendoSwitchJoyconPair,
|
||||||
|
gamepadTypeCount,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadButton = enum(c_int) {
|
||||||
|
gamepadButtonSouth, //Bottom face button (e.g. Xbox A button)
|
||||||
|
gamepadButtonEast, //Right face button (e.g. Xbox B button)
|
||||||
|
gamepadButtonWest, //Left face button (e.g. Xbox X button)
|
||||||
|
gamepadButtonNorth, //Top face button (e.g. Xbox Y button)
|
||||||
|
gamepadButtonBack,
|
||||||
|
gamepadButtonGuide,
|
||||||
|
gamepadButtonStart,
|
||||||
|
gamepadButtonLeftStick,
|
||||||
|
gamepadButtonRightStick,
|
||||||
|
gamepadButtonLeftShoulder,
|
||||||
|
gamepadButtonRightShoulder,
|
||||||
|
gamepadButtonDpadUp,
|
||||||
|
gamepadButtonDpadDown,
|
||||||
|
gamepadButtonDpadLeft,
|
||||||
|
gamepadButtonDpadRight,
|
||||||
|
gamepadButtonMisc1, //Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button)
|
||||||
|
gamepadButtonRightPaddle1, //Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1)
|
||||||
|
gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3)
|
||||||
|
gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2)
|
||||||
|
gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4)
|
||||||
|
gamepadButtonTouchpad, //PS4/PS5 touchpad button
|
||||||
|
gamepadButtonMisc2, //Additional button
|
||||||
|
gamepadButtonMisc3, //Additional button
|
||||||
|
gamepadButtonMisc4, //Additional button
|
||||||
|
gamepadButtonMisc5, //Additional button
|
||||||
|
gamepadButtonMisc6, //Additional button
|
||||||
|
gamepadButtonCount,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadButtonLabel = enum(c_int) {
|
||||||
|
gamepadButtonLabelUnknown,
|
||||||
|
gamepadButtonLabelA,
|
||||||
|
gamepadButtonLabelB,
|
||||||
|
gamepadButtonLabelX,
|
||||||
|
gamepadButtonLabelY,
|
||||||
|
gamepadButtonLabelCross,
|
||||||
|
gamepadButtonLabelCircle,
|
||||||
|
gamepadButtonLabelSquare,
|
||||||
|
gamepadButtonLabelTriangle,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadAxis = enum(c_int) {
|
||||||
|
gamepadAxisLeftx,
|
||||||
|
gamepadAxisLefty,
|
||||||
|
gamepadAxisRightx,
|
||||||
|
gamepadAxisRighty,
|
||||||
|
gamepadAxisLeftTrigger,
|
||||||
|
gamepadAxisRightTrigger,
|
||||||
|
gamepadAxisCount,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadBindingType = enum(c_int) {
|
||||||
|
gamepadBindtypeButton,
|
||||||
|
gamepadBindtypeAxis,
|
||||||
|
gamepadBindtypeHat,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GamepadBinding = opaque {};
|
||||||
|
|
||||||
|
pub inline fn addGamepadMapping(mapping: [*c]const u8) c_int {
|
||||||
|
return c.SDL_AddGamepadMapping(mapping);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn addGamepadMappingsFromFile(file: [*c]const u8) c_int {
|
||||||
|
return c.SDL_AddGamepadMappingsFromFile(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn reloadGamepadMappings() bool {
|
||||||
|
return c.SDL_ReloadGamepadMappings();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadMappings(count: *c_int) [*c][*c]u8 {
|
||||||
|
return c.SDL_GetGamepadMappings(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadMappingForGUID(guid: GUID) [*c]u8 {
|
||||||
|
return c.SDL_GetGamepadMappingForGUID(guid);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setGamepadMapping(instance_id: JoystickID, mapping: [*c]const u8) bool {
|
||||||
|
return c.SDL_SetGamepadMapping(instance_id, mapping);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hasGamepad() bool {
|
||||||
|
return c.SDL_HasGamepad();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepads(count: *c_int) ?*JoystickID {
|
||||||
|
return c.SDL_GetGamepads(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn isGamepad(instance_id: JoystickID) bool {
|
||||||
|
return c.SDL_IsGamepad(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadNameForID(instance_id: JoystickID) [*c]const u8 {
|
||||||
|
return c.SDL_GetGamepadNameForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadPathForID(instance_id: JoystickID) [*c]const u8 {
|
||||||
|
return c.SDL_GetGamepadPathForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadPlayerIndexForID(instance_id: JoystickID) c_int {
|
||||||
|
return c.SDL_GetGamepadPlayerIndexForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadGUIDForID(instance_id: JoystickID) GUID {
|
||||||
|
return c.SDL_GetGamepadGUIDForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadVendorForID(instance_id: JoystickID) u16 {
|
||||||
|
return c.SDL_GetGamepadVendorForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadProductForID(instance_id: JoystickID) u16 {
|
||||||
|
return c.SDL_GetGamepadProductForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadProductVersionForID(instance_id: JoystickID) u16 {
|
||||||
|
return c.SDL_GetGamepadProductVersionForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadTypeForID(instance_id: JoystickID) GamepadType {
|
||||||
|
return @intFromEnum(c.SDL_GetGamepadTypeForID(instance_id));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRealGamepadTypeForID(instance_id: JoystickID) GamepadType {
|
||||||
|
return @intFromEnum(c.SDL_GetRealGamepadTypeForID(instance_id));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadMappingForID(instance_id: JoystickID) [*c]u8 {
|
||||||
|
return c.SDL_GetGamepadMappingForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openGamepad(instance_id: JoystickID) ?*Gamepad {
|
||||||
|
return c.SDL_OpenGamepad(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadFromID(instance_id: JoystickID) ?*Gamepad {
|
||||||
|
return c.SDL_GetGamepadFromID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadFromPlayerIndex(player_index: c_int) ?*Gamepad {
|
||||||
|
return c.SDL_GetGamepadFromPlayerIndex(player_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setGamepadEventsEnabled(enabled: bool) void {
|
||||||
|
return c.SDL_SetGamepadEventsEnabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn gamepadEventsEnabled() bool {
|
||||||
|
return c.SDL_GamepadEventsEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn updateGamepads() void {
|
||||||
|
return c.SDL_UpdateGamepads();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadTypeFromString(str: [*c]const u8) GamepadType {
|
||||||
|
return @intFromEnum(c.SDL_GetGamepadTypeFromString(str));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadStringForType(_type: GamepadType) [*c]const u8 {
|
||||||
|
return c.SDL_GetGamepadStringForType(@intFromEnum(_type));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadAxisFromString(str: [*c]const u8) GamepadAxis {
|
||||||
|
return c.SDL_GetGamepadAxisFromString(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadStringForAxis(axis: GamepadAxis) [*c]const u8 {
|
||||||
|
return c.SDL_GetGamepadStringForAxis(axis);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadButtonFromString(str: [*c]const u8) GamepadButton {
|
||||||
|
return c.SDL_GetGamepadButtonFromString(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadStringForButton(button: GamepadButton) [*c]const u8 {
|
||||||
|
return c.SDL_GetGamepadStringForButton(button);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGamepadButtonLabelForType(_type: GamepadType, button: GamepadButton) GamepadButtonLabel {
|
||||||
|
return c.SDL_GetGamepadButtonLabelForType(@intFromEnum(_type), button);
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,230 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const Joystick = opaque {
|
||||||
|
pub inline fn isJoystickHaptic(joystick: *Joystick) bool {
|
||||||
|
return c.SDL_IsJoystickHaptic(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openHapticFromJoystick(joystick: *Joystick) ?*Haptic {
|
||||||
|
return c.SDL_OpenHapticFromJoystick(joystick);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Haptic = opaque {
|
||||||
|
pub inline fn getHapticID(haptic: *Haptic) HapticID {
|
||||||
|
return c.SDL_GetHapticID(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getHapticName(haptic: *Haptic) [*c]const u8 {
|
||||||
|
return c.SDL_GetHapticName(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn closeHaptic(haptic: *Haptic) void {
|
||||||
|
return c.SDL_CloseHaptic(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getMaxHapticEffects(haptic: *Haptic) c_int {
|
||||||
|
return c.SDL_GetMaxHapticEffects(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getMaxHapticEffectsPlaying(haptic: *Haptic) c_int {
|
||||||
|
return c.SDL_GetMaxHapticEffectsPlaying(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getHapticFeatures(haptic: *Haptic) u32 {
|
||||||
|
return c.SDL_GetHapticFeatures(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getNumHapticAxes(haptic: *Haptic) c_int {
|
||||||
|
return c.SDL_GetNumHapticAxes(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hapticEffectSupported(haptic: *Haptic, effect: *const HapticEffect) bool {
|
||||||
|
return c.SDL_HapticEffectSupported(haptic, @ptrCast(effect));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn createHapticEffect(haptic: *Haptic, effect: *const HapticEffect) c_int {
|
||||||
|
return c.SDL_CreateHapticEffect(haptic, @ptrCast(effect));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: *const HapticEffect) bool {
|
||||||
|
return c.SDL_UpdateHapticEffect(haptic, effect, @ptrCast(data));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool {
|
||||||
|
return c.SDL_RunHapticEffect(haptic, effect, iterations);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool {
|
||||||
|
return c.SDL_StopHapticEffect(haptic, effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void {
|
||||||
|
return c.SDL_DestroyHapticEffect(haptic, effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool {
|
||||||
|
return c.SDL_GetHapticEffectStatus(haptic, effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setHapticGain(haptic: *Haptic, gain: c_int) bool {
|
||||||
|
return c.SDL_SetHapticGain(haptic, gain);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setHapticAutocenter(haptic: *Haptic, autocenter: c_int) bool {
|
||||||
|
return c.SDL_SetHapticAutocenter(haptic, autocenter);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn pauseHaptic(haptic: *Haptic) bool {
|
||||||
|
return c.SDL_PauseHaptic(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn resumeHaptic(haptic: *Haptic) bool {
|
||||||
|
return c.SDL_ResumeHaptic(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn stopHapticEffects(haptic: *Haptic) bool {
|
||||||
|
return c.SDL_StopHapticEffects(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hapticRumbleSupported(haptic: *Haptic) bool {
|
||||||
|
return c.SDL_HapticRumbleSupported(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn initHapticRumble(haptic: *Haptic) bool {
|
||||||
|
return c.SDL_InitHapticRumble(haptic);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn playHapticRumble(haptic: *Haptic, strength: f32, length: u32) bool {
|
||||||
|
return c.SDL_PlayHapticRumble(haptic, strength, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn stopHapticRumble(haptic: *Haptic) bool {
|
||||||
|
return c.SDL_StopHapticRumble(haptic);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const HapticDirection = extern struct {
|
||||||
|
_type: u8, // The type of encoding.
|
||||||
|
dir: [3]i32, // The encoded direction.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const HapticConstant = extern struct {
|
||||||
|
_type: u16, // SDL_HAPTIC_CONSTANT
|
||||||
|
direction: HapticDirection, // Direction of the effect.
|
||||||
|
length: u32, // Duration of the effect.
|
||||||
|
delay: u16, // Delay before starting the effect.
|
||||||
|
button: u16, // Button that triggers the effect.
|
||||||
|
interval: u16, // How soon it can be triggered again after button.
|
||||||
|
level: i16, // Strength of the constant effect.
|
||||||
|
attack_length: u16, // Duration of the attack.
|
||||||
|
attack_level: u16, // Level at the start of the attack.
|
||||||
|
fade_length: u16, // Duration of the fade.
|
||||||
|
fade_level: u16, // Level at the end of the fade.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const HapticPeriodic = extern struct {
|
||||||
|
direction: HapticDirection, // Direction of the effect.
|
||||||
|
length: u32, // Duration of the effect.
|
||||||
|
delay: u16, // Delay before starting the effect.
|
||||||
|
button: u16, // Button that triggers the effect.
|
||||||
|
interval: u16, // How soon it can be triggered again after button.
|
||||||
|
period: u16, // Period of the wave.
|
||||||
|
magnitude: i16, // Peak value; if negative, equivalent to 180 degrees extra phase shift.
|
||||||
|
offset: i16, // Mean value of the wave.
|
||||||
|
phase: u16, // Positive phase shift given by hundredth of a degree.
|
||||||
|
attack_length: u16, // Duration of the attack.
|
||||||
|
attack_level: u16, // Level at the start of the attack.
|
||||||
|
fade_length: u16, // Duration of the fade.
|
||||||
|
fade_level: u16, // Level at the end of the fade.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const HapticCondition = extern struct {
|
||||||
|
direction: HapticDirection, // Direction of the effect - Not used ATM.
|
||||||
|
length: u32, // Duration of the effect.
|
||||||
|
delay: u16, // Delay before starting the effect.
|
||||||
|
button: u16, // Button that triggers the effect.
|
||||||
|
interval: u16, // How soon it can be triggered again after button.
|
||||||
|
right_sat: [3]u16, // Level when joystick is to the positive side; max 0xFFFF.
|
||||||
|
left_sat: [3]u16, // Level when joystick is to the negative side; max 0xFFFF.
|
||||||
|
right_coeff: [3]i16, // How fast to increase the force towards the positive side.
|
||||||
|
left_coeff: [3]i16, // How fast to increase the force towards the negative side.
|
||||||
|
deadband: [3]u16, // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered.
|
||||||
|
center: [3]i16, // Position of the dead zone.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const HapticRamp = extern struct {
|
||||||
|
_type: u16, // SDL_HAPTIC_RAMP
|
||||||
|
direction: HapticDirection, // Direction of the effect.
|
||||||
|
length: u32, // Duration of the effect.
|
||||||
|
delay: u16, // Delay before starting the effect.
|
||||||
|
button: u16, // Button that triggers the effect.
|
||||||
|
interval: u16, // How soon it can be triggered again after button.
|
||||||
|
start: i16, // Beginning strength level.
|
||||||
|
end: i16, // Ending strength level.
|
||||||
|
attack_length: u16, // Duration of the attack.
|
||||||
|
attack_level: u16, // Level at the start of the attack.
|
||||||
|
fade_length: u16, // Duration of the fade.
|
||||||
|
fade_level: u16, // Level at the end of the fade.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const HapticLeftRight = extern struct {
|
||||||
|
_type: u16, // SDL_HAPTIC_LEFTRIGHT
|
||||||
|
length: u32, // Duration of the effect in milliseconds.
|
||||||
|
large_magnitude: u16, // Control of the large controller motor.
|
||||||
|
small_magnitude: u16, // Control of the small controller motor.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const HapticCustom = extern struct {
|
||||||
|
_type: u16, // SDL_HAPTIC_CUSTOM
|
||||||
|
direction: HapticDirection, // Direction of the effect.
|
||||||
|
length: u32, // Duration of the effect.
|
||||||
|
delay: u16, // Delay before starting the effect.
|
||||||
|
button: u16, // Button that triggers the effect.
|
||||||
|
interval: u16, // How soon it can be triggered again after button.
|
||||||
|
channels: u8, // Axes to use, minimum of one.
|
||||||
|
period: u16, // Sample periods.
|
||||||
|
samples: u16, // Amount of samples.
|
||||||
|
data: *u16, // Should contain channels*samples items.
|
||||||
|
attack_length: u16, // Duration of the attack.
|
||||||
|
attack_level: u16, // Level at the start of the attack.
|
||||||
|
fade_length: u16, // Duration of the fade.
|
||||||
|
fade_level: u16, // Level at the end of the fade.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const HapticEffect = extern union {
|
||||||
|
_type: u16, // Effect type.
|
||||||
|
constant: HapticConstant, // Constant effect.
|
||||||
|
periodic: HapticPeriodic, // Periodic effect.
|
||||||
|
condition: HapticCondition, // Condition effect.
|
||||||
|
ramp: HapticRamp, // Ramp effect.
|
||||||
|
leftright: HapticLeftRight, // Left/Right effect.
|
||||||
|
custom: HapticCustom, // Custom effect.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const HapticID = u32;
|
||||||
|
|
||||||
|
pub inline fn getHaptics(count: *c_int) ?*HapticID {
|
||||||
|
return c.SDL_GetHaptics(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getHapticNameForID(instance_id: HapticID) [*c]const u8 {
|
||||||
|
return c.SDL_GetHapticNameForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openHaptic(instance_id: HapticID) ?*Haptic {
|
||||||
|
return c.SDL_OpenHaptic(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getHapticFromID(instance_id: HapticID) ?*Haptic {
|
||||||
|
return c.SDL_GetHapticFromID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn isMouseHaptic() bool {
|
||||||
|
return c.SDL_IsMouseHaptic();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openHapticFromMouse() ?*Haptic {
|
||||||
|
return c.SDL_OpenHapticFromMouse();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const HintPriority = enum(c_int) {
|
||||||
|
hintDefault,
|
||||||
|
hintNormal,
|
||||||
|
hintOverride,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn setHintWithPriority(name: [*c]const u8, value: [*c]const u8, priority: HintPriority) bool {
|
||||||
|
return c.SDL_SetHintWithPriority(name, value, priority);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setHint(name: [*c]const u8, value: [*c]const u8) bool {
|
||||||
|
return c.SDL_SetHint(name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn resetHint(name: [*c]const u8) bool {
|
||||||
|
return c.SDL_ResetHint(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn resetHints() void {
|
||||||
|
return c.SDL_ResetHints();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getHint(name: [*c]const u8) [*c]const u8 {
|
||||||
|
return c.SDL_GetHint(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getHintBoolean(name: [*c]const u8, default_value: bool) bool {
|
||||||
|
return c.SDL_GetHintBoolean(name, default_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const HintCallback = c.SDL_HintCallback;
|
||||||
|
|
||||||
|
pub inline fn addHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) bool {
|
||||||
|
return c.SDL_AddHintCallback(name, callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn removeHintCallback(name: [*c]const u8, callback: HintCallback, userdata: ?*anyopaque) void {
|
||||||
|
return c.SDL_RemoveHintCallback(name, callback, userdata);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,71 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const InitFlags = packed struct(u32) {
|
||||||
|
initAudio: bool = false, // `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`
|
||||||
|
initVideo: bool = false, // `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread
|
||||||
|
initJoystick: bool = false, // `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD
|
||||||
|
initHaptic: bool = false,
|
||||||
|
initGamepad: bool = false, // `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`
|
||||||
|
initEvents: bool = false,
|
||||||
|
initSensor: bool = false, // `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`
|
||||||
|
initCamera: bool = false, // `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`
|
||||||
|
pad0: u23 = 0,
|
||||||
|
rsvd: bool = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const AppResult = enum(c_int) {
|
||||||
|
appContinue, //Value that requests that the app continue from the main callbacks.
|
||||||
|
appSuccess, //Value that requests termination with success from the main callbacks.
|
||||||
|
appFailure, //Value that requests termination with error from the main callbacks.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const AppInit_func = c.SDL_AppInit_func;
|
||||||
|
|
||||||
|
pub const AppIterate_func = c.SDL_AppIterate_func;
|
||||||
|
|
||||||
|
pub const AppEvent_func = c.SDL_AppEvent_func;
|
||||||
|
|
||||||
|
pub const AppQuit_func = c.SDL_AppQuit_func;
|
||||||
|
|
||||||
|
pub inline fn init(flags: InitFlags) bool {
|
||||||
|
return c.SDL_Init(@bitCast(flags));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn initSubSystem(flags: InitFlags) bool {
|
||||||
|
return c.SDL_InitSubSystem(@bitCast(flags));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn quitSubSystem(flags: InitFlags) void {
|
||||||
|
return c.SDL_QuitSubSystem(@bitCast(flags));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn wasInit(flags: InitFlags) InitFlags {
|
||||||
|
return @bitCast(c.SDL_WasInit(@bitCast(flags)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn quit() void {
|
||||||
|
return c.SDL_Quit();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn isMainThread() bool {
|
||||||
|
return c.SDL_IsMainThread();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const MainThreadCallback = c.SDL_MainThreadCallback;
|
||||||
|
|
||||||
|
pub inline fn runOnMainThread(callback: MainThreadCallback, userdata: ?*anyopaque, wait_complete: bool) bool {
|
||||||
|
return c.SDL_RunOnMainThread(callback, userdata, wait_complete);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setAppMetadata(appname: [*c]const u8, appversion: [*c]const u8, appidentifier: [*c]const u8) bool {
|
||||||
|
return c.SDL_SetAppMetadata(appname, appversion, appidentifier);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setAppMetadataProperty(name: [*c]const u8, value: [*c]const u8) bool {
|
||||||
|
return c.SDL_SetAppMetadataProperty(name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAppMetadataProperty(name: [*c]const u8) [*c]const u8 {
|
||||||
|
return c.SDL_GetAppMetadataProperty(name);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,321 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const PropertiesID = u32;
|
||||||
|
|
||||||
|
pub const SensorType = enum(c_int) {
|
||||||
|
sensorInvalid, //Returned for an invalid sensor
|
||||||
|
sensorUnknown, //Unknown sensor type
|
||||||
|
sensorAccel, //Accelerometer
|
||||||
|
sensorGyro, //Gyroscope
|
||||||
|
sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk
|
||||||
|
sensorGyroL, //Gyroscope for left Joy-Con controller
|
||||||
|
sensorAccelR, //Accelerometer for right Joy-Con controller
|
||||||
|
sensorGyroR, //Gyroscope for right Joy-Con controller
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const GUID = extern struct {
|
||||||
|
data: [16]u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PowerState = enum(c_int) {
|
||||||
|
powerstateError, //error determining power status
|
||||||
|
powerstateUnknown, //cannot determine power status
|
||||||
|
powerstateOnBattery, //Not plugged in, running on the battery
|
||||||
|
powerstateNoBattery, //Plugged in, no battery available
|
||||||
|
powerstateCharging, //Plugged in, charging battery
|
||||||
|
powerstateCharged,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Joystick = opaque {
|
||||||
|
pub inline fn setJoystickVirtualAxis(joystick: *Joystick, axis: c_int, value: i16) bool {
|
||||||
|
return c.SDL_SetJoystickVirtualAxis(joystick, axis, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setJoystickVirtualBall(joystick: *Joystick, ball: c_int, xrel: i16, yrel: i16) bool {
|
||||||
|
return c.SDL_SetJoystickVirtualBall(joystick, ball, xrel, yrel);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setJoystickVirtualButton(joystick: *Joystick, button: c_int, down: bool) bool {
|
||||||
|
return c.SDL_SetJoystickVirtualButton(joystick, button, down);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setJoystickVirtualHat(joystick: *Joystick, hat: c_int, value: u8) bool {
|
||||||
|
return c.SDL_SetJoystickVirtualHat(joystick, hat, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setJoystickVirtualTouchpad(joystick: *Joystick, touchpad: c_int, finger: c_int, down: bool, x: f32, y: f32, pressure: f32) bool {
|
||||||
|
return c.SDL_SetJoystickVirtualTouchpad(joystick, touchpad, finger, down, x, y, pressure);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn sendJoystickVirtualSensorData(joystick: *Joystick, _type: SensorType, sensor_timestamp: u64, data: *const f32, num_values: c_int) bool {
|
||||||
|
return c.SDL_SendJoystickVirtualSensorData(joystick, @intFromEnum(_type), sensor_timestamp, @ptrCast(data), num_values);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickProperties(joystick: *Joystick) PropertiesID {
|
||||||
|
return c.SDL_GetJoystickProperties(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickName(joystick: *Joystick) [*c]const u8 {
|
||||||
|
return c.SDL_GetJoystickName(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickPath(joystick: *Joystick) [*c]const u8 {
|
||||||
|
return c.SDL_GetJoystickPath(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickPlayerIndex(joystick: *Joystick) c_int {
|
||||||
|
return c.SDL_GetJoystickPlayerIndex(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setJoystickPlayerIndex(joystick: *Joystick, player_index: c_int) bool {
|
||||||
|
return c.SDL_SetJoystickPlayerIndex(joystick, player_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickGUID(joystick: *Joystick) GUID {
|
||||||
|
return c.SDL_GetJoystickGUID(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickVendor(joystick: *Joystick) u16 {
|
||||||
|
return c.SDL_GetJoystickVendor(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickProduct(joystick: *Joystick) u16 {
|
||||||
|
return c.SDL_GetJoystickProduct(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickProductVersion(joystick: *Joystick) u16 {
|
||||||
|
return c.SDL_GetJoystickProductVersion(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickFirmwareVersion(joystick: *Joystick) u16 {
|
||||||
|
return c.SDL_GetJoystickFirmwareVersion(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickSerial(joystick: *Joystick) [*c]const u8 {
|
||||||
|
return c.SDL_GetJoystickSerial(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickType(joystick: *Joystick) JoystickType {
|
||||||
|
return @intFromEnum(c.SDL_GetJoystickType(joystick));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn joystickConnected(joystick: *Joystick) bool {
|
||||||
|
return c.SDL_JoystickConnected(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickID(joystick: *Joystick) JoystickID {
|
||||||
|
return c.SDL_GetJoystickID(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getNumJoystickAxes(joystick: *Joystick) c_int {
|
||||||
|
return c.SDL_GetNumJoystickAxes(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getNumJoystickBalls(joystick: *Joystick) c_int {
|
||||||
|
return c.SDL_GetNumJoystickBalls(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getNumJoystickHats(joystick: *Joystick) c_int {
|
||||||
|
return c.SDL_GetNumJoystickHats(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getNumJoystickButtons(joystick: *Joystick) c_int {
|
||||||
|
return c.SDL_GetNumJoystickButtons(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickAxis(joystick: *Joystick, axis: c_int) i16 {
|
||||||
|
return c.SDL_GetJoystickAxis(joystick, axis);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickAxisInitialState(joystick: *Joystick, axis: c_int, state: *i16) bool {
|
||||||
|
return c.SDL_GetJoystickAxisInitialState(joystick, axis, @ptrCast(state));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickBall(joystick: *Joystick, ball: c_int, dx: *c_int, dy: *c_int) bool {
|
||||||
|
return c.SDL_GetJoystickBall(joystick, ball, @ptrCast(dx), @ptrCast(dy));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickHat(joystick: *Joystick, hat: c_int) u8 {
|
||||||
|
return c.SDL_GetJoystickHat(joystick, hat);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickButton(joystick: *Joystick, button: c_int) bool {
|
||||||
|
return c.SDL_GetJoystickButton(joystick, button);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn rumbleJoystick(joystick: *Joystick, low_frequency_rumble: u16, high_frequency_rumble: u16, duration_ms: u32) bool {
|
||||||
|
return c.SDL_RumbleJoystick(joystick, low_frequency_rumble, high_frequency_rumble, duration_ms);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn rumbleJoystickTriggers(joystick: *Joystick, left_rumble: u16, right_rumble: u16, duration_ms: u32) bool {
|
||||||
|
return c.SDL_RumbleJoystickTriggers(joystick, left_rumble, right_rumble, duration_ms);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setJoystickLED(joystick: *Joystick, red: u8, green: u8, blue: u8) bool {
|
||||||
|
return c.SDL_SetJoystickLED(joystick, red, green, blue);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn sendJoystickEffect(joystick: *Joystick, data: ?*const anyopaque, size: c_int) bool {
|
||||||
|
return c.SDL_SendJoystickEffect(joystick, data, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn closeJoystick(joystick: *Joystick) void {
|
||||||
|
return c.SDL_CloseJoystick(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickConnectionState(joystick: *Joystick) JoystickConnectionState {
|
||||||
|
return c.SDL_GetJoystickConnectionState(joystick);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickPowerInfo(joystick: *Joystick, percent: *c_int) PowerState {
|
||||||
|
return c.SDL_GetJoystickPowerInfo(joystick, @ptrCast(percent));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const JoystickID = u32;
|
||||||
|
|
||||||
|
pub const JoystickType = enum(c_int) {
|
||||||
|
joystickTypeUnknown,
|
||||||
|
joystickTypeGamepad,
|
||||||
|
joystickTypeWheel,
|
||||||
|
joystickTypeArcadeStick,
|
||||||
|
joystickTypeFlightStick,
|
||||||
|
joystickTypeDancePad,
|
||||||
|
joystickTypeGuitar,
|
||||||
|
joystickTypeDrumKit,
|
||||||
|
joystickTypeArcadePad,
|
||||||
|
joystickTypeThrottle,
|
||||||
|
joystickTypeCount,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const JoystickConnectionState = enum(c_int) {
|
||||||
|
joystickConnectionUnknown,
|
||||||
|
joystickConnectionWired,
|
||||||
|
joystickConnectionWireless,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn lockJoysticks() void {
|
||||||
|
return c.SDL_LockJoysticks();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn unlockJoysticks() void {
|
||||||
|
return c.SDL_UnlockJoysticks();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hasJoystick() bool {
|
||||||
|
return c.SDL_HasJoystick();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoysticks(count: *c_int) ?*JoystickID {
|
||||||
|
return c.SDL_GetJoysticks(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickNameForID(instance_id: JoystickID) [*c]const u8 {
|
||||||
|
return c.SDL_GetJoystickNameForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickPathForID(instance_id: JoystickID) [*c]const u8 {
|
||||||
|
return c.SDL_GetJoystickPathForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickPlayerIndexForID(instance_id: JoystickID) c_int {
|
||||||
|
return c.SDL_GetJoystickPlayerIndexForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickGUIDForID(instance_id: JoystickID) GUID {
|
||||||
|
return c.SDL_GetJoystickGUIDForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickVendorForID(instance_id: JoystickID) u16 {
|
||||||
|
return c.SDL_GetJoystickVendorForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickProductForID(instance_id: JoystickID) u16 {
|
||||||
|
return c.SDL_GetJoystickProductForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickProductVersionForID(instance_id: JoystickID) u16 {
|
||||||
|
return c.SDL_GetJoystickProductVersionForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickTypeForID(instance_id: JoystickID) JoystickType {
|
||||||
|
return @intFromEnum(c.SDL_GetJoystickTypeForID(instance_id));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openJoystick(instance_id: JoystickID) ?*Joystick {
|
||||||
|
return c.SDL_OpenJoystick(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickFromID(instance_id: JoystickID) ?*Joystick {
|
||||||
|
return c.SDL_GetJoystickFromID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickFromPlayerIndex(player_index: c_int) ?*Joystick {
|
||||||
|
return c.SDL_GetJoystickFromPlayerIndex(player_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const VirtualJoystickTouchpadDesc = extern struct {
|
||||||
|
nfingers: u16, // the number of simultaneous fingers on this touchpad
|
||||||
|
padding: [3]u16,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const VirtualJoystickSensorDesc = extern struct {
|
||||||
|
_type: SensorType, // the type of this sensor
|
||||||
|
rate: f32, // the update frequency of this sensor, may be 0.0f
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const VirtualJoystickDesc = extern struct {
|
||||||
|
version: u32, // the version of this interface
|
||||||
|
_type: u16, // `SDL_JoystickType`
|
||||||
|
padding: u16, // unused
|
||||||
|
vendor_id: u16, // the USB vendor ID of this joystick
|
||||||
|
product_id: u16, // the USB product ID of this joystick
|
||||||
|
naxes: u16, // the number of axes on this joystick
|
||||||
|
nbuttons: u16, // the number of buttons on this joystick
|
||||||
|
nballs: u16, // the number of balls on this joystick
|
||||||
|
nhats: u16, // the number of hats on this joystick
|
||||||
|
ntouchpads: u16, // the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions
|
||||||
|
nsensors: u16, // the number of sensors on this joystick, requires `sensors` to point at valid descriptions
|
||||||
|
padding2: [2]u16, // unused
|
||||||
|
name: [*c]const u8, // the name of the joystick
|
||||||
|
touchpads: *const VirtualJoystickTouchpadDesc, // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0
|
||||||
|
sensors: *const VirtualJoystickSensorDesc, // A pointer to an array of sensor descriptions, required if `nsensors` is > 0
|
||||||
|
userdata: ?*anyopaque, // User data pointer passed to callbacks
|
||||||
|
Update: ?*const anyopaque, // Called when the joystick state should be updated
|
||||||
|
SetPlayerIndex: ?*const anyopaque, // Called when the player index is set
|
||||||
|
Rumble: ?*const anyopaque, // Implements SDL_RumbleJoystick()
|
||||||
|
RumbleTriggers: ?*const anyopaque, // Implements SDL_RumbleJoystickTriggers()
|
||||||
|
SetLED: ?*const anyopaque, // Implements SDL_SetJoystickLED()
|
||||||
|
SendEffect: ?*const anyopaque, // Implements SDL_SendJoystickEffect()
|
||||||
|
SetSensorsEnabled: ?*const anyopaque, // Implements SDL_SetGamepadSensorEnabled()
|
||||||
|
Cleanup: ?*const anyopaque, // Cleans up the userdata when the joystick is detached
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn attachVirtualJoystick(desc: *const VirtualJoystickDesc) JoystickID {
|
||||||
|
return c.SDL_AttachVirtualJoystick(@ptrCast(desc));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn detachVirtualJoystick(instance_id: JoystickID) bool {
|
||||||
|
return c.SDL_DetachVirtualJoystick(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn isJoystickVirtual(instance_id: JoystickID) bool {
|
||||||
|
return c.SDL_IsJoystickVirtual(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getJoystickGUIDInfo(guid: GUID, vendor: *u16, product: *u16, version: *u16, crc16: *u16) void {
|
||||||
|
return c.SDL_GetJoystickGUIDInfo(guid, @ptrCast(vendor), @ptrCast(product), @ptrCast(version), @ptrCast(crc16));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setJoystickEventsEnabled(enabled: bool) void {
|
||||||
|
return c.SDL_SetJoystickEventsEnabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn joystickEventsEnabled() bool {
|
||||||
|
return c.SDL_JoystickEventsEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn updateJoysticks() void {
|
||||||
|
return c.SDL_UpdateJoysticks();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const Keycode = u32;
|
||||||
|
|
||||||
|
pub const Keymod = u16;
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const FunctionPointer = c.SDL_FunctionPointer;
|
||||||
|
|
||||||
|
pub const SharedObject = opaque {
|
||||||
|
pub inline fn loadFunction(sharedobject: *SharedObject, name: [*c]const u8) FunctionPointer {
|
||||||
|
return c.SDL_LoadFunction(sharedobject, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn unloadObject(sharedobject: *SharedObject) void {
|
||||||
|
return c.SDL_UnloadObject(sharedobject);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn loadObject(sofile: [*c]const u8) ?*SharedObject {
|
||||||
|
return c.SDL_LoadObject(sofile);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const Window = opaque {};
|
||||||
|
|
||||||
|
pub const MessageBoxFlags = packed struct(u32) {
|
||||||
|
messageboxError: bool = false, // error dialog
|
||||||
|
messageboxWarning: bool = false, // warning dialog
|
||||||
|
messageboxInformation: bool = false, // informational dialog
|
||||||
|
messageboxButtonsLeftToRight: bool = false, // buttons placed left to right
|
||||||
|
messageboxButtonsRightToLeft: bool = false, // buttons placed right to left
|
||||||
|
pad0: u26 = 0,
|
||||||
|
rsvd: bool = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MessageBoxButtonFlags = packed struct(u32) {
|
||||||
|
messageboxButtonReturnkeyDefault: bool = false, // Marks the default button when return is hit
|
||||||
|
messageboxButtonEscapekeyDefault: bool = false, // Marks the default button when escape is hit
|
||||||
|
pad0: u29 = 0,
|
||||||
|
rsvd: bool = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MessageBoxButtonData = extern struct {
|
||||||
|
flags: MessageBoxButtonFlags,
|
||||||
|
buttonID: c_int, // User defined button id (value returned via SDL_ShowMessageBox)
|
||||||
|
text: [*c]const u8, // The UTF-8 button text
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MessageBoxColor = extern struct {
|
||||||
|
r: u8,
|
||||||
|
g: u8,
|
||||||
|
b: u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MessageBoxColorType = enum(c_int) {
|
||||||
|
messageboxColorBackground,
|
||||||
|
messageboxColorText,
|
||||||
|
messageboxColorButtonBorder,
|
||||||
|
messageboxColorButtonBackground,
|
||||||
|
messageboxColorButtonSelected,
|
||||||
|
messageboxColorCount, //Size of the colors array of SDL_MessageBoxColorScheme.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MessageBoxColorScheme = extern struct {
|
||||||
|
colors: [c.SDL_MESSAGEBOX_COLOR_COUNT]MessageBoxColor,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MessageBoxData = extern struct {
|
||||||
|
flags: MessageBoxFlags,
|
||||||
|
window: ?*Window, // Parent window, can be NULL
|
||||||
|
title: [*c]const u8, // UTF-8 title
|
||||||
|
message: [*c]const u8, // UTF-8 message text
|
||||||
|
numbuttons: c_int,
|
||||||
|
buttons: *const MessageBoxButtonData,
|
||||||
|
colorScheme: *const MessageBoxColorScheme, // SDL_MessageBoxColorScheme, can be NULL to use system settings
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn showMessageBox(messageboxdata: *const MessageBoxData, buttonid: *c_int) bool {
|
||||||
|
return c.SDL_ShowMessageBox(@ptrCast(messageboxdata), @ptrCast(buttonid));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn showSimpleMessageBox(flags: MessageBoxFlags, title: [*c]const u8, message: [*c]const u8, window: ?*Window) bool {
|
||||||
|
return c.SDL_ShowSimpleMessageBox(@bitCast(flags), title, message, window);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub inline fn openURL(url: [*c]const u8) bool {
|
||||||
|
return c.SDL_OpenURL(url);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,135 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const Window = opaque {
|
||||||
|
pub inline fn warpMouseInWindow(window: *Window, x: f32, y: f32) void {
|
||||||
|
return c.SDL_WarpMouseInWindow(window, x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setWindowRelativeMouseMode(window: *Window, enabled: bool) bool {
|
||||||
|
return c.SDL_SetWindowRelativeMouseMode(window, enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getWindowRelativeMouseMode(window: *Window) bool {
|
||||||
|
return c.SDL_GetWindowRelativeMouseMode(window);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Surface = opaque {
|
||||||
|
pub inline fn createColorCursor(surface: *Surface, hot_x: c_int, hot_y: c_int) ?*Cursor {
|
||||||
|
return c.SDL_CreateColorCursor(surface, hot_x, hot_y);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MouseID = u32;
|
||||||
|
|
||||||
|
pub const Cursor = opaque {
|
||||||
|
pub inline fn setCursor(cursor: *Cursor) bool {
|
||||||
|
return c.SDL_SetCursor(cursor);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn destroyCursor(cursor: *Cursor) void {
|
||||||
|
return c.SDL_DestroyCursor(cursor);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const SystemCursor = enum(c_int) {
|
||||||
|
systemCursorDefault, //Default cursor. Usually an arrow.
|
||||||
|
systemCursorText, //Text selection. Usually an I-beam.
|
||||||
|
systemCursorWait, //Wait. Usually an hourglass or watch or spinning ball.
|
||||||
|
systemCursorCrosshair, //Crosshair.
|
||||||
|
systemCursorProgress, //Program is busy but still interactive. Usually it's WAIT with an arrow.
|
||||||
|
systemCursorNwseResize, //Double arrow pointing northwest and southeast.
|
||||||
|
systemCursorNeswResize, //Double arrow pointing northeast and southwest.
|
||||||
|
systemCursorEwResize, //Double arrow pointing west and east.
|
||||||
|
systemCursorNsResize, //Double arrow pointing north and south.
|
||||||
|
systemCursorMove, //Four pointed arrow pointing north, south, east, and west.
|
||||||
|
systemCursorNotAllowed, //Not permitted. Usually a slashed circle or crossbones.
|
||||||
|
systemCursorPointer, //Pointer that indicates a link. Usually a pointing hand.
|
||||||
|
systemCursorNwResize, //Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE.
|
||||||
|
systemCursorNResize, //Window resize top. May be NS_RESIZE.
|
||||||
|
systemCursorNeResize, //Window resize top-right. May be NESW_RESIZE.
|
||||||
|
systemCursorEResize, //Window resize right. May be EW_RESIZE.
|
||||||
|
systemCursorSeResize, //Window resize bottom-right. May be NWSE_RESIZE.
|
||||||
|
systemCursorSResize, //Window resize bottom. May be NS_RESIZE.
|
||||||
|
systemCursorSwResize, //Window resize bottom-left. May be NESW_RESIZE.
|
||||||
|
systemCursorWResize, //Window resize left. May be EW_RESIZE.
|
||||||
|
systemCursorCount,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MouseWheelDirection = enum(c_int) {
|
||||||
|
mousewheelNormal, //The scroll direction is normal
|
||||||
|
mousewheelFlipped, //The scroll direction is flipped / natural
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MouseButtonFlags = packed struct(u32) {
|
||||||
|
buttonLeft: bool = false,
|
||||||
|
buttonMiddle: bool = false,
|
||||||
|
buttonX1: bool = false,
|
||||||
|
pad0: u28 = 0,
|
||||||
|
rsvd: bool = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn hasMouse() bool {
|
||||||
|
return c.SDL_HasMouse();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getMice(count: *c_int) ?*MouseID {
|
||||||
|
return c.SDL_GetMice(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getMouseNameForID(instance_id: MouseID) [*c]const u8 {
|
||||||
|
return c.SDL_GetMouseNameForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getMouseFocus() ?*Window {
|
||||||
|
return c.SDL_GetMouseFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getMouseState(x: *f32, y: *f32) MouseButtonFlags {
|
||||||
|
return @bitCast(c.SDL_GetMouseState(@ptrCast(x), @ptrCast(y)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGlobalMouseState(x: *f32, y: *f32) MouseButtonFlags {
|
||||||
|
return @bitCast(c.SDL_GetGlobalMouseState(@ptrCast(x), @ptrCast(y)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRelativeMouseState(x: *f32, y: *f32) MouseButtonFlags {
|
||||||
|
return @bitCast(c.SDL_GetRelativeMouseState(@ptrCast(x), @ptrCast(y)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn warpMouseGlobal(x: f32, y: f32) bool {
|
||||||
|
return c.SDL_WarpMouseGlobal(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn captureMouse(enabled: bool) bool {
|
||||||
|
return c.SDL_CaptureMouse(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor {
|
||||||
|
return c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor {
|
||||||
|
return c.SDL_CreateSystemCursor(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCursor() ?*Cursor {
|
||||||
|
return c.SDL_GetCursor();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getDefaultCursor() ?*Cursor {
|
||||||
|
return c.SDL_GetDefaultCursor();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn showCursor() bool {
|
||||||
|
return c.SDL_ShowCursor();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hideCursor() bool {
|
||||||
|
return c.SDL_HideCursor();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn cursorVisible() bool {
|
||||||
|
return c.SDL_CursorVisible();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,237 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const PixelType = enum(c_int) {
|
||||||
|
pixeltypeUnknown,
|
||||||
|
pixeltypeIndex1,
|
||||||
|
pixeltypeIndex4,
|
||||||
|
pixeltypeIndex8,
|
||||||
|
pixeltypePacked8,
|
||||||
|
pixeltypePacked16,
|
||||||
|
pixeltypePacked32,
|
||||||
|
pixeltypeArrayu8,
|
||||||
|
pixeltypeArrayu16,
|
||||||
|
pixeltypeArrayu32,
|
||||||
|
pixeltypeArrayf16,
|
||||||
|
pixeltypeArrayf32,
|
||||||
|
pixeltypeIndex2,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const BitmapOrder = enum(c_int) {
|
||||||
|
bitmaporderNone,
|
||||||
|
bitmaporder4321,
|
||||||
|
bitmaporder1234,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PackedOrder = enum(c_int) {
|
||||||
|
packedorderNone,
|
||||||
|
packedorderXrgb,
|
||||||
|
packedorderRgbx,
|
||||||
|
packedorderArgb,
|
||||||
|
packedorderRgba,
|
||||||
|
packedorderXbgr,
|
||||||
|
packedorderBgrx,
|
||||||
|
packedorderAbgr,
|
||||||
|
packedorderBgra,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const ArrayOrder = enum(c_int) {
|
||||||
|
arrayorderNone,
|
||||||
|
arrayorderRgb,
|
||||||
|
arrayorderRgba,
|
||||||
|
arrayorderArgb,
|
||||||
|
arrayorderBgr,
|
||||||
|
arrayorderBgra,
|
||||||
|
arrayorderAbgr,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PackedLayout = enum(c_int) {
|
||||||
|
packedlayoutNone,
|
||||||
|
packedlayout332,
|
||||||
|
packedlayout4444,
|
||||||
|
packedlayout1555,
|
||||||
|
packedlayout5551,
|
||||||
|
packedlayout565,
|
||||||
|
packedlayout8888,
|
||||||
|
packedlayout2101010,
|
||||||
|
packedlayout1010102,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PixelFormat = enum(c_int) {
|
||||||
|
pixelformatYv12, //Planar mode: Y + V + U (3 planes)
|
||||||
|
pixelformatIyuv, //Planar mode: Y + U + V (3 planes)
|
||||||
|
pixelformatYuy2, //Packed mode: Y0+U0+Y1+V0 (1 plane)
|
||||||
|
pixelformatUyvy, //Packed mode: U0+Y0+V0+Y1 (1 plane)
|
||||||
|
pixelformatYvyu, //Packed mode: Y0+V0+Y1+U0 (1 plane)
|
||||||
|
pixelformatNv12, //Planar mode: Y + U/V interleaved (2 planes)
|
||||||
|
pixelformatNv21, //Planar mode: Y + V/U interleaved (2 planes)
|
||||||
|
pixelformatP010, //Planar mode: Y + U/V interleaved (2 planes)
|
||||||
|
pixelformatExternalOes, //Android video texture format
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const ColorRange = enum(c_int) {
|
||||||
|
colorRangeLimited, //Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma
|
||||||
|
colorRangeFull,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const ColorPrimaries = enum(c_int) {
|
||||||
|
colorPrimariesBt709, //ITU-R BT.709-6
|
||||||
|
colorPrimariesBt470m, //ITU-R BT.470-6 System M
|
||||||
|
colorPrimariesBt470bg, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625
|
||||||
|
colorPrimariesBt601, //ITU-R BT.601-7 525, SMPTE 170M
|
||||||
|
colorPrimariesSmpte240, //SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601
|
||||||
|
colorPrimariesGenericFilm, //Generic film (color filters using Illuminant C)
|
||||||
|
colorPrimariesBt2020, //ITU-R BT.2020-2 / ITU-R BT.2100-0
|
||||||
|
colorPrimariesXyz, //SMPTE ST 428-1
|
||||||
|
colorPrimariesSmpte431, //SMPTE RP 431-2
|
||||||
|
colorPrimariesSmpte432, //SMPTE EG 432-1 / DCI P3
|
||||||
|
colorPrimariesEbu3213, //EBU Tech. 3213-E
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const TransferCharacteristics = enum(c_int) {
|
||||||
|
transferCharacteristicsBt709, //Rec. ITU-R BT.709-6 / ITU-R BT1361
|
||||||
|
transferCharacteristicsGamma22, //ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM
|
||||||
|
transferCharacteristicsGamma28, //ITU-R BT.470-6 System B, G
|
||||||
|
transferCharacteristicsBt601, //SMPTE ST 170M / ITU-R BT.601-7 525 or 625
|
||||||
|
transferCharacteristicsSmpte240, //SMPTE ST 240M
|
||||||
|
transferCharacteristicsIec61966, //IEC 61966-2-4
|
||||||
|
transferCharacteristicsBt1361, //ITU-R BT1361 Extended Colour Gamut
|
||||||
|
transferCharacteristicsSrgb, //IEC 61966-2-1 (sRGB or sYCC)
|
||||||
|
transferCharacteristicsBt202010bit, //ITU-R BT2020 for 10-bit system
|
||||||
|
transferCharacteristicsBt202012bit, //ITU-R BT2020 for 12-bit system
|
||||||
|
transferCharacteristicsPq, //SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems
|
||||||
|
transferCharacteristicsSmpte428, //SMPTE ST 428-1
|
||||||
|
transferCharacteristicsHlg, //ARIB STD-B67, known as "hybrid log-gamma" (HLG)
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MatrixCoefficients = enum(c_int) {
|
||||||
|
matrixCoefficientsBt709, //ITU-R BT.709-6
|
||||||
|
matrixCoefficientsFcc, //US FCC Title 47
|
||||||
|
matrixCoefficientsBt470bg, //ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601
|
||||||
|
matrixCoefficientsBt601, //ITU-R BT.601-7 525
|
||||||
|
matrixCoefficientsSmpte240, //SMPTE 240M
|
||||||
|
matrixCoefficientsBt2020Ncl, //ITU-R BT.2020-2 non-constant luminance
|
||||||
|
matrixCoefficientsBt2020Cl, //ITU-R BT.2020-2 constant luminance
|
||||||
|
matrixCoefficientsSmpte2085, //SMPTE ST 2085
|
||||||
|
matrixCoefficientsIctcp, //ITU-R BT.2100-0 ICTCP
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const ChromaLocation = enum(c_int) {
|
||||||
|
chromaLocationNone, //RGB, no chroma sampling
|
||||||
|
chromaLocationLeft, //In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically.
|
||||||
|
chromaLocationCenter, //In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel.
|
||||||
|
chromaLocationTopleft,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Colorspace = enum(c_int) {
|
||||||
|
colorspaceSrgb, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
|
||||||
|
colorRangeFull,
|
||||||
|
colorPrimariesBt709,
|
||||||
|
transferCharacteristicsSrgb,
|
||||||
|
matrixCoefficientsIdentity,
|
||||||
|
colorspaceSrgbLinear, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709
|
||||||
|
transferCharacteristicsLinear,
|
||||||
|
colorspaceHdr10, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020
|
||||||
|
colorPrimariesBt2020,
|
||||||
|
transferCharacteristicsPq,
|
||||||
|
colorspaceJpeg, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601
|
||||||
|
transferCharacteristicsBt601,
|
||||||
|
matrixCoefficientsBt601,
|
||||||
|
colorspaceBt601Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601
|
||||||
|
colorRangeLimited,
|
||||||
|
colorPrimariesBt601,
|
||||||
|
colorspaceBt601Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601
|
||||||
|
colorspaceBt709Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709
|
||||||
|
transferCharacteristicsBt709,
|
||||||
|
matrixCoefficientsBt709,
|
||||||
|
colorspaceBt709Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709
|
||||||
|
colorspaceBt2020Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020
|
||||||
|
matrixCoefficientsBt2020Ncl,
|
||||||
|
colorspaceBt2020Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020
|
||||||
|
colorspaceRgbDefault, //The default colorspace for RGB surfaces if no colorspace is specified
|
||||||
|
colorspaceYuvDefault, //The default colorspace for YUV surfaces if no colorspace is specified
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Color = extern struct {
|
||||||
|
r: u8,
|
||||||
|
g: u8,
|
||||||
|
b: u8,
|
||||||
|
a: u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const FColor = extern struct {
|
||||||
|
r: f32,
|
||||||
|
g: f32,
|
||||||
|
b: f32,
|
||||||
|
a: f32,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Palette = extern struct {
|
||||||
|
ncolors: c_int, // number of elements in `colors`.
|
||||||
|
colors: ?*Color, // an array of colors, `ncolors` long.
|
||||||
|
version: u32, // internal use only, do not touch.
|
||||||
|
refcount: c_int, // internal use only, do not touch.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PixelFormatDetails = extern struct {
|
||||||
|
format: PixelFormat,
|
||||||
|
bits_per_pixel: u8,
|
||||||
|
bytes_per_pixel: u8,
|
||||||
|
padding: [2]u8,
|
||||||
|
Rmask: u32,
|
||||||
|
Gmask: u32,
|
||||||
|
Bmask: u32,
|
||||||
|
Amask: u32,
|
||||||
|
Rbits: u8,
|
||||||
|
Gbits: u8,
|
||||||
|
Bbits: u8,
|
||||||
|
Abits: u8,
|
||||||
|
Rshift: u8,
|
||||||
|
Gshift: u8,
|
||||||
|
Bshift: u8,
|
||||||
|
Ashift: u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn getPixelFormatName(format: PixelFormat) [*c]const u8 {
|
||||||
|
return c.SDL_GetPixelFormatName(@bitCast(format));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getMasksForPixelFormat(format: PixelFormat, bpp: *c_int, Rmask: *u32, Gmask: *u32, Bmask: *u32, Amask: *u32) bool {
|
||||||
|
return c.SDL_GetMasksForPixelFormat(@bitCast(format), @ptrCast(bpp), @ptrCast(Rmask), @ptrCast(Gmask), @ptrCast(Bmask), @ptrCast(Amask));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getPixelFormatForMasks(bpp: c_int, Rmask: u32, Gmask: u32, Bmask: u32, Amask: u32) PixelFormat {
|
||||||
|
return @bitCast(c.SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getPixelFormatDetails(format: PixelFormat) *const PixelFormatDetails {
|
||||||
|
return @ptrCast(c.SDL_GetPixelFormatDetails(@bitCast(format)));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn createPalette(ncolors: c_int) ?*Palette {
|
||||||
|
return c.SDL_CreatePalette(ncolors);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setPaletteColors(palette: ?*Palette, colors: *const Color, firstcolor: c_int, ncolors: c_int) bool {
|
||||||
|
return c.SDL_SetPaletteColors(palette, @ptrCast(colors), firstcolor, ncolors);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn destroyPalette(palette: ?*Palette) void {
|
||||||
|
return c.SDL_DestroyPalette(palette);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn mapRGB(format: *const PixelFormatDetails, palette: *const Palette, r: u8, g: u8, b: u8) u32 {
|
||||||
|
return c.SDL_MapRGB(@ptrCast(format), @ptrCast(palette), r, g, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn mapRGBA(format: *const PixelFormatDetails, palette: *const Palette, r: u8, g: u8, b: u8, a: u8) u32 {
|
||||||
|
return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRGB(pixel: u32, format: *const PixelFormatDetails, palette: *const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void {
|
||||||
|
return c.SDL_GetRGB(pixel, @ptrCast(format), @ptrCast(palette), r, g, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRGBA(pixel: u32, format: *const PixelFormatDetails, palette: *const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void {
|
||||||
|
return c.SDL_GetRGBA(pixel, @ptrCast(format), @ptrCast(palette), r, g, b, a);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,101 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const PropertiesID = u32;
|
||||||
|
|
||||||
|
pub const PropertyType = enum(c_int) {
|
||||||
|
propertyTypeInvalid,
|
||||||
|
propertyTypePointer,
|
||||||
|
propertyTypeString,
|
||||||
|
propertyTypeNumber,
|
||||||
|
propertyTypeFloat,
|
||||||
|
propertyTypeBoolean,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn getGlobalProperties() PropertiesID {
|
||||||
|
return c.SDL_GetGlobalProperties();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn createProperties() PropertiesID {
|
||||||
|
return c.SDL_CreateProperties();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn copyProperties(src: PropertiesID, dst: PropertiesID) bool {
|
||||||
|
return c.SDL_CopyProperties(src, dst);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn lockProperties(props: PropertiesID) bool {
|
||||||
|
return c.SDL_LockProperties(props);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn unlockProperties(props: PropertiesID) void {
|
||||||
|
return c.SDL_UnlockProperties(props);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const CleanupPropertyCallback = c.SDL_CleanupPropertyCallback;
|
||||||
|
|
||||||
|
pub inline fn setPointerPropertyWithCleanup(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque, cleanup: CleanupPropertyCallback, userdata: ?*anyopaque) bool {
|
||||||
|
return c.SDL_SetPointerPropertyWithCleanup(props, name, value, cleanup, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setPointerProperty(props: PropertiesID, name: [*c]const u8, value: ?*anyopaque) bool {
|
||||||
|
return c.SDL_SetPointerProperty(props, name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setStringProperty(props: PropertiesID, name: [*c]const u8, value: [*c]const u8) bool {
|
||||||
|
return c.SDL_SetStringProperty(props, name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setNumberProperty(props: PropertiesID, name: [*c]const u8, value: i64) bool {
|
||||||
|
return c.SDL_SetNumberProperty(props, name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setFloatProperty(props: PropertiesID, name: [*c]const u8, value: f32) bool {
|
||||||
|
return c.SDL_SetFloatProperty(props, name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setBooleanProperty(props: PropertiesID, name: [*c]const u8, value: bool) bool {
|
||||||
|
return c.SDL_SetBooleanProperty(props, name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hasProperty(props: PropertiesID, name: [*c]const u8) bool {
|
||||||
|
return c.SDL_HasProperty(props, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getPropertyType(props: PropertiesID, name: [*c]const u8) PropertyType {
|
||||||
|
return @intFromEnum(c.SDL_GetPropertyType(props, name));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getPointerProperty(props: PropertiesID, name: [*c]const u8, default_value: ?*anyopaque) ?*anyopaque {
|
||||||
|
return c.SDL_GetPointerProperty(props, name, default_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getStringProperty(props: PropertiesID, name: [*c]const u8, default_value: [*c]const u8) [*c]const u8 {
|
||||||
|
return c.SDL_GetStringProperty(props, name, default_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getNumberProperty(props: PropertiesID, name: [*c]const u8, default_value: i64) i64 {
|
||||||
|
return c.SDL_GetNumberProperty(props, name, default_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getFloatProperty(props: PropertiesID, name: [*c]const u8, default_value: f32) f32 {
|
||||||
|
return c.SDL_GetFloatProperty(props, name, default_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getBooleanProperty(props: PropertiesID, name: [*c]const u8, default_value: bool) bool {
|
||||||
|
return c.SDL_GetBooleanProperty(props, name, default_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn clearProperty(props: PropertiesID, name: [*c]const u8) bool {
|
||||||
|
return c.SDL_ClearProperty(props, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const EnumeratePropertiesCallback = c.SDL_EnumeratePropertiesCallback;
|
||||||
|
|
||||||
|
pub inline fn enumerateProperties(props: PropertiesID, callback: EnumeratePropertiesCallback, userdata: ?*anyopaque) bool {
|
||||||
|
return c.SDL_EnumerateProperties(props, callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn destroyProperties(props: PropertiesID) void {
|
||||||
|
return c.SDL_DestroyProperties(props);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,66 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const Point = extern struct {
|
||||||
|
x: c_int,
|
||||||
|
y: c_int,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const FPoint = extern struct {
|
||||||
|
x: f32,
|
||||||
|
y: f32,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Rect = extern struct {
|
||||||
|
x: c_int,
|
||||||
|
y: c_int,
|
||||||
|
w: c_int,
|
||||||
|
h: c_int,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const FRect = extern struct {
|
||||||
|
x: f32,
|
||||||
|
y: f32,
|
||||||
|
w: f32,
|
||||||
|
h: f32,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn hasRectIntersection(A: *const Rect, B: *const Rect) bool {
|
||||||
|
return c.SDL_HasRectIntersection(@ptrCast(A), @ptrCast(B));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRectIntersection(A: *const Rect, B: *const Rect, result: ?*Rect) bool {
|
||||||
|
return c.SDL_GetRectIntersection(@ptrCast(A), @ptrCast(B), result);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRectUnion(A: *const Rect, B: *const Rect, result: ?*Rect) bool {
|
||||||
|
return c.SDL_GetRectUnion(@ptrCast(A), @ptrCast(B), result);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRectEnclosingPoints(points: *const Point, count: c_int, clip: *const Rect, result: ?*Rect) bool {
|
||||||
|
return c.SDL_GetRectEnclosingPoints(@ptrCast(points), count, @ptrCast(clip), result);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRectAndLineIntersection(rect: *const Rect, X1: *c_int, Y1: *c_int, X2: *c_int, Y2: *c_int) bool {
|
||||||
|
return c.SDL_GetRectAndLineIntersection(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn hasRectIntersectionFloat(A: *const FRect, B: *const FRect) bool {
|
||||||
|
return c.SDL_HasRectIntersectionFloat(@ptrCast(A), @ptrCast(B));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRectIntersectionFloat(A: *const FRect, B: *const FRect, result: ?*FRect) bool {
|
||||||
|
return c.SDL_GetRectIntersectionFloat(@ptrCast(A), @ptrCast(B), result);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRectUnionFloat(A: *const FRect, B: *const FRect, result: ?*FRect) bool {
|
||||||
|
return c.SDL_GetRectUnionFloat(@ptrCast(A), @ptrCast(B), result);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRectEnclosingPointsFloat(points: *const FPoint, count: c_int, clip: *const FRect, result: ?*FRect) bool {
|
||||||
|
return c.SDL_GetRectEnclosingPointsFloat(@ptrCast(points), count, @ptrCast(clip), result);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getRectAndLineIntersectionFloat(rect: *const FRect, X1: *f32, Y1: *f32, X2: *f32, Y2: *f32) bool {
|
||||||
|
return c.SDL_GetRectAndLineIntersectionFloat(@ptrCast(rect), @ptrCast(X1), @ptrCast(Y1), @ptrCast(X2), @ptrCast(Y2));
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,75 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const PropertiesID = u32;
|
||||||
|
|
||||||
|
pub const Sensor = opaque {
|
||||||
|
pub inline fn getSensorProperties(sensor: *Sensor) PropertiesID {
|
||||||
|
return c.SDL_GetSensorProperties(sensor);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSensorName(sensor: *Sensor) [*c]const u8 {
|
||||||
|
return c.SDL_GetSensorName(sensor);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSensorType(sensor: *Sensor) SensorType {
|
||||||
|
return @intFromEnum(c.SDL_GetSensorType(sensor));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSensorNonPortableType(sensor: *Sensor) c_int {
|
||||||
|
return c.SDL_GetSensorNonPortableType(sensor);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSensorID(sensor: *Sensor) SensorID {
|
||||||
|
return c.SDL_GetSensorID(sensor);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSensorData(sensor: *Sensor, data: *f32, num_values: c_int) bool {
|
||||||
|
return c.SDL_GetSensorData(sensor, @ptrCast(data), num_values);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn closeSensor(sensor: *Sensor) void {
|
||||||
|
return c.SDL_CloseSensor(sensor);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const SensorID = u32;
|
||||||
|
|
||||||
|
pub const SensorType = enum(c_int) {
|
||||||
|
sensorInvalid, //Returned for an invalid sensor
|
||||||
|
sensorUnknown, //Unknown sensor type
|
||||||
|
sensorAccel, //Accelerometer
|
||||||
|
sensorGyro, //Gyroscope
|
||||||
|
sensorAccelL, //Accelerometer for left Joy-Con controller and Wii nunchuk
|
||||||
|
sensorGyroL, //Gyroscope for left Joy-Con controller
|
||||||
|
sensorAccelR, //Accelerometer for right Joy-Con controller
|
||||||
|
sensorGyroR, //Gyroscope for right Joy-Con controller
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn getSensors(count: *c_int) ?*SensorID {
|
||||||
|
return c.SDL_GetSensors(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSensorNameForID(instance_id: SensorID) [*c]const u8 {
|
||||||
|
return c.SDL_GetSensorNameForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSensorTypeForID(instance_id: SensorID) SensorType {
|
||||||
|
return @intFromEnum(c.SDL_GetSensorTypeForID(instance_id));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSensorNonPortableTypeForID(instance_id: SensorID) c_int {
|
||||||
|
return c.SDL_GetSensorNonPortableTypeForID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openSensor(instance_id: SensorID) ?*Sensor {
|
||||||
|
return c.SDL_OpenSensor(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSensorFromID(instance_id: SensorID) ?*Sensor {
|
||||||
|
return c.SDL_GetSensorFromID(instance_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn updateSensors() void {
|
||||||
|
return c.SDL_UpdateSensors();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,114 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const PathInfo = extern struct {
|
||||||
|
_type: PathType, // the path type
|
||||||
|
size: u64, // the file size in bytes
|
||||||
|
create_time: Time, // the time when the path was created
|
||||||
|
modify_time: Time, // the last time the path was modified
|
||||||
|
access_time: Time, // the last time the path was read
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PathType = enum(c_int) {
|
||||||
|
pathtypeNone, //path does not exist
|
||||||
|
pathtypeFile, //a normal file
|
||||||
|
pathtypeDirectory, //a directory
|
||||||
|
pathtypeOther,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Time = i64;
|
||||||
|
|
||||||
|
pub const GlobFlags = packed struct(u32) {
|
||||||
|
globCaseinsensitive: bool = false,
|
||||||
|
pad0: u30 = 0,
|
||||||
|
rsvd: bool = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const EnumerateDirectoryCallback = c.SDL_EnumerateDirectoryCallback;
|
||||||
|
|
||||||
|
pub const PropertiesID = u32;
|
||||||
|
|
||||||
|
pub const StorageInterface = extern struct {
|
||||||
|
version: u32,
|
||||||
|
close: ?*const anyopaque,
|
||||||
|
ready: ?*const anyopaque,
|
||||||
|
enumerate: ?*const anyopaque,
|
||||||
|
info: ?*const anyopaque,
|
||||||
|
read_file: ?*const anyopaque,
|
||||||
|
write_file: ?*const anyopaque,
|
||||||
|
mkdir: ?*const anyopaque,
|
||||||
|
remove: ?*const anyopaque,
|
||||||
|
rename: ?*const anyopaque,
|
||||||
|
copy: ?*const anyopaque,
|
||||||
|
space_remaining: ?*const anyopaque,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Storage = opaque {
|
||||||
|
pub inline fn closeStorage(storage: *Storage) bool {
|
||||||
|
return c.SDL_CloseStorage(storage);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn storageReady(storage: *Storage) bool {
|
||||||
|
return c.SDL_StorageReady(storage);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getStorageFileSize(storage: *Storage, path: [*c]const u8, length: *u64) bool {
|
||||||
|
return c.SDL_GetStorageFileSize(storage, path, @ptrCast(length));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn readStorageFile(storage: *Storage, path: [*c]const u8, destination: ?*anyopaque, length: u64) bool {
|
||||||
|
return c.SDL_ReadStorageFile(storage, path, destination, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn writeStorageFile(storage: *Storage, path: [*c]const u8, source: ?*const anyopaque, length: u64) bool {
|
||||||
|
return c.SDL_WriteStorageFile(storage, path, source, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn createStorageDirectory(storage: *Storage, path: [*c]const u8) bool {
|
||||||
|
return c.SDL_CreateStorageDirectory(storage, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn enumerateStorageDirectory(storage: *Storage, path: [*c]const u8, callback: EnumerateDirectoryCallback, userdata: ?*anyopaque) bool {
|
||||||
|
return c.SDL_EnumerateStorageDirectory(storage, path, callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn removeStoragePath(storage: *Storage, path: [*c]const u8) bool {
|
||||||
|
return c.SDL_RemoveStoragePath(storage, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn renameStoragePath(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool {
|
||||||
|
return c.SDL_RenameStoragePath(storage, oldpath, newpath);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn copyStorageFile(storage: *Storage, oldpath: [*c]const u8, newpath: [*c]const u8) bool {
|
||||||
|
return c.SDL_CopyStorageFile(storage, oldpath, newpath);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getStoragePathInfo(storage: *Storage, path: [*c]const u8, info: ?*PathInfo) bool {
|
||||||
|
return c.SDL_GetStoragePathInfo(storage, path, info);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getStorageSpaceRemaining(storage: *Storage) u64 {
|
||||||
|
return c.SDL_GetStorageSpaceRemaining(storage);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn globStorageDirectory(storage: *Storage, path: [*c]const u8, pattern: [*c]const u8, flags: GlobFlags, count: *c_int) [*c][*c]u8 {
|
||||||
|
return c.SDL_GlobStorageDirectory(storage, path, pattern, @bitCast(flags), @ptrCast(count));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn openTitleStorage(override: [*c]const u8, props: PropertiesID) ?*Storage {
|
||||||
|
return c.SDL_OpenTitleStorage(override, props);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openUserStorage(org: [*c]const u8, app: [*c]const u8, props: PropertiesID) ?*Storage {
|
||||||
|
return c.SDL_OpenUserStorage(org, app, props);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openFileStorage(path: [*c]const u8) ?*Storage {
|
||||||
|
return c.SDL_OpenFileStorage(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn openStorage(iface: *const StorageInterface, userdata: ?*anyopaque) ?*Storage {
|
||||||
|
return c.SDL_OpenStorage(@ptrCast(iface), userdata);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,320 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const PixelFormat = enum(c_int) {
|
||||||
|
pixelformatYv12, //Planar mode: Y + V + U (3 planes)
|
||||||
|
pixelformatIyuv, //Planar mode: Y + U + V (3 planes)
|
||||||
|
pixelformatYuy2, //Packed mode: Y0+U0+Y1+V0 (1 plane)
|
||||||
|
pixelformatUyvy, //Packed mode: U0+Y0+V0+Y1 (1 plane)
|
||||||
|
pixelformatYvyu, //Packed mode: Y0+V0+Y1+U0 (1 plane)
|
||||||
|
pixelformatNv12, //Planar mode: Y + U/V interleaved (2 planes)
|
||||||
|
pixelformatNv21, //Planar mode: Y + V/U interleaved (2 planes)
|
||||||
|
pixelformatP010, //Planar mode: Y + U/V interleaved (2 planes)
|
||||||
|
pixelformatExternalOes, //Android video texture format
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const BlendMode = u32;
|
||||||
|
|
||||||
|
pub const IOStream = opaque {
|
||||||
|
pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface {
|
||||||
|
return c.SDL_LoadBMP_IO(iostream, closeio);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Rect = extern struct {
|
||||||
|
x: c_int,
|
||||||
|
y: c_int,
|
||||||
|
w: c_int,
|
||||||
|
h: c_int,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Palette = extern struct {
|
||||||
|
ncolors: c_int, // number of elements in `colors`.
|
||||||
|
colors: ?*Color, // an array of colors, `ncolors` long.
|
||||||
|
version: u32, // internal use only, do not touch.
|
||||||
|
refcount: c_int, // internal use only, do not touch.
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Color = extern struct {
|
||||||
|
r: u8,
|
||||||
|
g: u8,
|
||||||
|
b: u8,
|
||||||
|
a: u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Colorspace = enum(c_int) {
|
||||||
|
colorspaceSrgb, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
|
||||||
|
colorRangeFull,
|
||||||
|
colorPrimariesBt709,
|
||||||
|
transferCharacteristicsSrgb,
|
||||||
|
matrixCoefficientsIdentity,
|
||||||
|
colorspaceSrgbLinear, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709
|
||||||
|
transferCharacteristicsLinear,
|
||||||
|
colorspaceHdr10, //Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020
|
||||||
|
colorPrimariesBt2020,
|
||||||
|
transferCharacteristicsPq,
|
||||||
|
colorspaceJpeg, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601
|
||||||
|
transferCharacteristicsBt601,
|
||||||
|
matrixCoefficientsBt601,
|
||||||
|
colorspaceBt601Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601
|
||||||
|
colorRangeLimited,
|
||||||
|
colorPrimariesBt601,
|
||||||
|
colorspaceBt601Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601
|
||||||
|
colorspaceBt709Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709
|
||||||
|
transferCharacteristicsBt709,
|
||||||
|
matrixCoefficientsBt709,
|
||||||
|
colorspaceBt709Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709
|
||||||
|
colorspaceBt2020Limited, //Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020
|
||||||
|
matrixCoefficientsBt2020Ncl,
|
||||||
|
colorspaceBt2020Full, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020
|
||||||
|
colorspaceRgbDefault, //The default colorspace for RGB surfaces if no colorspace is specified
|
||||||
|
colorspaceYuvDefault, //The default colorspace for YUV surfaces if no colorspace is specified
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const PropertiesID = u32;
|
||||||
|
|
||||||
|
pub const SurfaceFlags = packed struct(u32) {
|
||||||
|
surfacePreallocated: bool = false, // Surface uses preallocated pixel memory
|
||||||
|
surfaceLockNeeded: bool = false, // Surface needs to be locked to access pixels
|
||||||
|
surfaceLocked: bool = false, // Surface is currently locked
|
||||||
|
surfaceSimdAligned: bool = false, // Surface uses pixel memory allocated with SDL_aligned_alloc()
|
||||||
|
pad0: u27 = 0,
|
||||||
|
rsvd: bool = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const ScaleMode = enum(c_int) {
|
||||||
|
scalemodeNearest, //nearest pixel sampling
|
||||||
|
scalemodeLinear, //linear filtering
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const FlipMode = enum(c_int) {
|
||||||
|
flipNone, //Do not flip
|
||||||
|
flipHorizontal, //flip horizontally
|
||||||
|
flipVertical, //flip vertically
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Surface = opaque {
|
||||||
|
pub inline fn destroySurface(surface: *Surface) void {
|
||||||
|
return c.SDL_DestroySurface(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSurfaceProperties(surface: *Surface) PropertiesID {
|
||||||
|
return c.SDL_GetSurfaceProperties(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setSurfaceColorspace(surface: *Surface, colorspace: Colorspace) bool {
|
||||||
|
return c.SDL_SetSurfaceColorspace(surface, colorspace);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSurfaceColorspace(surface: *Surface) Colorspace {
|
||||||
|
return c.SDL_GetSurfaceColorspace(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn createSurfacePalette(surface: *Surface) ?*Palette {
|
||||||
|
return c.SDL_CreateSurfacePalette(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setSurfacePalette(surface: *Surface, palette: ?*Palette) bool {
|
||||||
|
return c.SDL_SetSurfacePalette(surface, palette);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSurfacePalette(surface: *Surface) ?*Palette {
|
||||||
|
return c.SDL_GetSurfacePalette(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn addSurfaceAlternateImage(surface: *Surface, image: ?*Surface) bool {
|
||||||
|
return c.SDL_AddSurfaceAlternateImage(surface, image);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn surfaceHasAlternateImages(surface: *Surface) bool {
|
||||||
|
return c.SDL_SurfaceHasAlternateImages(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSurfaceImages(surface: *Surface, count: *c_int) [*c][*c]Surface {
|
||||||
|
return c.SDL_GetSurfaceImages(surface, @ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn removeSurfaceAlternateImages(surface: *Surface) void {
|
||||||
|
return c.SDL_RemoveSurfaceAlternateImages(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn lockSurface(surface: *Surface) bool {
|
||||||
|
return c.SDL_LockSurface(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn unlockSurface(surface: *Surface) void {
|
||||||
|
return c.SDL_UnlockSurface(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn saveBMP_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool {
|
||||||
|
return c.SDL_SaveBMP_IO(surface, dst, closeio);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn saveBMP(surface: *Surface, file: [*c]const u8) bool {
|
||||||
|
return c.SDL_SaveBMP(surface, file);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool {
|
||||||
|
return c.SDL_SetSurfaceRLE(surface, enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn surfaceHasRLE(surface: *Surface) bool {
|
||||||
|
return c.SDL_SurfaceHasRLE(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setSurfaceColorKey(surface: *Surface, enabled: bool, key: u32) bool {
|
||||||
|
return c.SDL_SetSurfaceColorKey(surface, enabled, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn surfaceHasColorKey(surface: *Surface) bool {
|
||||||
|
return c.SDL_SurfaceHasColorKey(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSurfaceColorKey(surface: *Surface, key: *u32) bool {
|
||||||
|
return c.SDL_GetSurfaceColorKey(surface, @ptrCast(key));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setSurfaceColorMod(surface: *Surface, r: u8, g: u8, b: u8) bool {
|
||||||
|
return c.SDL_SetSurfaceColorMod(surface, r, g, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSurfaceColorMod(surface: *Surface, r: [*c]u8, g: [*c]u8, b: [*c]u8) bool {
|
||||||
|
return c.SDL_GetSurfaceColorMod(surface, r, g, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setSurfaceAlphaMod(surface: *Surface, alpha: u8) bool {
|
||||||
|
return c.SDL_SetSurfaceAlphaMod(surface, alpha);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSurfaceAlphaMod(surface: *Surface, alpha: [*c]u8) bool {
|
||||||
|
return c.SDL_GetSurfaceAlphaMod(surface, alpha);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setSurfaceBlendMode(surface: *Surface, blendMode: BlendMode) bool {
|
||||||
|
return c.SDL_SetSurfaceBlendMode(surface, @intFromEnum(blendMode));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSurfaceBlendMode(surface: *Surface, blendMode: ?*BlendMode) bool {
|
||||||
|
return c.SDL_GetSurfaceBlendMode(surface, @intFromEnum(blendMode));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setSurfaceClipRect(surface: *Surface, rect: *const Rect) bool {
|
||||||
|
return c.SDL_SetSurfaceClipRect(surface, @ptrCast(rect));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getSurfaceClipRect(surface: *Surface, rect: ?*Rect) bool {
|
||||||
|
return c.SDL_GetSurfaceClipRect(surface, rect);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn flipSurface(surface: *Surface, flip: FlipMode) bool {
|
||||||
|
return c.SDL_FlipSurface(surface, @intFromEnum(flip));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn duplicateSurface(surface: *Surface) ?*Surface {
|
||||||
|
return c.SDL_DuplicateSurface(surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn scaleSurface(surface: *Surface, width: c_int, height: c_int, scaleMode: ScaleMode) ?*Surface {
|
||||||
|
return c.SDL_ScaleSurface(surface, width, height, @intFromEnum(scaleMode));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn convertSurface(surface: *Surface, format: PixelFormat) ?*Surface {
|
||||||
|
return c.SDL_ConvertSurface(surface, @bitCast(format));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn convertSurfaceAndColorspace(surface: *Surface, format: PixelFormat, palette: ?*Palette, colorspace: Colorspace, props: PropertiesID) ?*Surface {
|
||||||
|
return c.SDL_ConvertSurfaceAndColorspace(surface, @bitCast(format), palette, colorspace, props);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn premultiplySurfaceAlpha(surface: *Surface, linear: bool) bool {
|
||||||
|
return c.SDL_PremultiplySurfaceAlpha(surface, linear);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn clearSurface(surface: *Surface, r: f32, g: f32, b: f32, a: f32) bool {
|
||||||
|
return c.SDL_ClearSurface(surface, r, g, b, a);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn fillSurfaceRect(surface: *Surface, rect: *const Rect, color: u32) bool {
|
||||||
|
return c.SDL_FillSurfaceRect(surface, @ptrCast(rect), color);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn fillSurfaceRects(surface: *Surface, rects: *const Rect, count: c_int, color: u32) bool {
|
||||||
|
return c.SDL_FillSurfaceRects(surface, @ptrCast(rects), count, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn blitSurface(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect) bool {
|
||||||
|
return c.SDL_BlitSurface(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn blitSurfaceUnchecked(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect) bool {
|
||||||
|
return c.SDL_BlitSurfaceUnchecked(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn blitSurfaceScaled(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect, scaleMode: ScaleMode) bool {
|
||||||
|
return c.SDL_BlitSurfaceScaled(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect), @intFromEnum(scaleMode));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn blitSurfaceUncheckedScaled(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect, scaleMode: ScaleMode) bool {
|
||||||
|
return c.SDL_BlitSurfaceUncheckedScaled(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect), @intFromEnum(scaleMode));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: *const Rect, dst: ?*Surface, dstrect: *const Rect) bool {
|
||||||
|
return c.SDL_BlitSurfaceTiled(surface, @ptrCast(srcrect), dst, @ptrCast(dstrect));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn blitSurfaceTiledWithScale(surface: *Surface, srcrect: *const Rect, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: *const Rect) bool {
|
||||||
|
return c.SDL_BlitSurfaceTiledWithScale(surface, @ptrCast(srcrect), scale, @intFromEnum(scaleMode), dst, @ptrCast(dstrect));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn blitSurface9Grid(surface: *Surface, srcrect: *const Rect, left_width: c_int, right_width: c_int, top_height: c_int, bottom_height: c_int, scale: f32, scaleMode: ScaleMode, dst: ?*Surface, dstrect: *const Rect) bool {
|
||||||
|
return c.SDL_BlitSurface9Grid(surface, @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @intFromEnum(scaleMode), dst, @ptrCast(dstrect));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn mapSurfaceRGB(surface: *Surface, r: u8, g: u8, b: u8) u32 {
|
||||||
|
return c.SDL_MapSurfaceRGB(surface, r, g, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn mapSurfaceRGBA(surface: *Surface, r: u8, g: u8, b: u8, a: u8) u32 {
|
||||||
|
return c.SDL_MapSurfaceRGBA(surface, r, g, b, a);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn readSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) bool {
|
||||||
|
return c.SDL_ReadSurfacePixel(surface, x, y, r, g, b, a);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn readSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: *f32, g: *f32, b: *f32, a: *f32) bool {
|
||||||
|
return c.SDL_ReadSurfacePixelFloat(surface, x, y, @ptrCast(r), @ptrCast(g), @ptrCast(b), @ptrCast(a));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn writeSurfacePixel(surface: *Surface, x: c_int, y: c_int, r: u8, g: u8, b: u8, a: u8) bool {
|
||||||
|
return c.SDL_WriteSurfacePixel(surface, x, y, r, g, b, a);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn writeSurfacePixelFloat(surface: *Surface, x: c_int, y: c_int, r: f32, g: f32, b: f32, a: f32) bool {
|
||||||
|
return c.SDL_WriteSurfacePixelFloat(surface, x, y, r, g, b, a);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn createSurface(width: c_int, height: c_int, format: PixelFormat) ?*Surface {
|
||||||
|
return c.SDL_CreateSurface(width, height, @bitCast(format));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat, pixels: ?*anyopaque, pitch: c_int) ?*Surface {
|
||||||
|
return c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn loadBMP(file: [*c]const u8) ?*Surface {
|
||||||
|
return c.SDL_LoadBMP(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn convertPixels(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int) bool {
|
||||||
|
return c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn convertPixelsAndColorspace(width: c_int, height: c_int, src_format: PixelFormat, src_colorspace: Colorspace, src_properties: PropertiesID, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst_colorspace: Colorspace, dst_properties: PropertiesID, dst: ?*anyopaque, dst_pitch: c_int) bool {
|
||||||
|
return c.SDL_ConvertPixelsAndColorspace(width, height, @bitCast(src_format), src_colorspace, src_properties, src, src_pitch, @bitCast(dst_format), dst_colorspace, dst_properties, dst, dst_pitch);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn premultiplyAlpha(width: c_int, height: c_int, src_format: PixelFormat, src: ?*const anyopaque, src_pitch: c_int, dst_format: PixelFormat, dst: ?*anyopaque, dst_pitch: c_int, linear: bool) bool {
|
||||||
|
return c.SDL_PremultiplyAlpha(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch, linear);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,159 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const DisplayID = u32;
|
||||||
|
|
||||||
|
pub const Window = opaque {
|
||||||
|
pub inline fn setiOSAnimationCallback(window: *Window, interval: c_int, callback: iOSAnimationCallback, callbackParam: ?*anyopaque) bool {
|
||||||
|
return c.SDL_SetiOSAnimationCallback(window, interval, callback, callbackParam);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const MSG = opaque {};
|
||||||
|
|
||||||
|
pub const WindowsMessageHook = c.SDL_WindowsMessageHook;
|
||||||
|
|
||||||
|
pub inline fn setWindowsMessageHook(callback: WindowsMessageHook, userdata: ?*anyopaque) void {
|
||||||
|
return c.SDL_SetWindowsMessageHook(callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getDirect3D9AdapterIndex(displayID: DisplayID) c_int {
|
||||||
|
return c.SDL_GetDirect3D9AdapterIndex(displayID);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getDXGIOutputInfo(displayID: DisplayID, adapterIndex: *c_int, outputIndex: *c_int) bool {
|
||||||
|
return c.SDL_GetDXGIOutputInfo(displayID, @ptrCast(adapterIndex), @ptrCast(outputIndex));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const X11EventHook = c.SDL_X11EventHook;
|
||||||
|
|
||||||
|
pub inline fn setX11EventHook(callback: X11EventHook, userdata: ?*anyopaque) void {
|
||||||
|
return c.SDL_SetX11EventHook(callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setLinuxThreadPriority(threadID: i64, priority: c_int) bool {
|
||||||
|
return c.SDL_SetLinuxThreadPriority(threadID, priority);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn setLinuxThreadPriorityAndPolicy(threadID: i64, sdlPriority: c_int, schedPolicy: c_int) bool {
|
||||||
|
return c.SDL_SetLinuxThreadPriorityAndPolicy(threadID, sdlPriority, schedPolicy);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const iOSAnimationCallback = c.SDL_iOSAnimationCallback;
|
||||||
|
|
||||||
|
pub inline fn setiOSEventPump(enabled: bool) void {
|
||||||
|
return c.SDL_SetiOSEventPump(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAndroidJNIEnv() ?*anyopaque {
|
||||||
|
return c.SDL_GetAndroidJNIEnv();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAndroidActivity() ?*anyopaque {
|
||||||
|
return c.SDL_GetAndroidActivity();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAndroidSDKVersion() c_int {
|
||||||
|
return c.SDL_GetAndroidSDKVersion();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn isChromebook() bool {
|
||||||
|
return c.SDL_IsChromebook();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn isDeXMode() bool {
|
||||||
|
return c.SDL_IsDeXMode();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn sendAndroidBackButton() void {
|
||||||
|
return c.SDL_SendAndroidBackButton();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAndroidInternalStoragePath() [*c]const u8 {
|
||||||
|
return c.SDL_GetAndroidInternalStoragePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAndroidExternalStorageState() u32 {
|
||||||
|
return c.SDL_GetAndroidExternalStorageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAndroidExternalStoragePath() [*c]const u8 {
|
||||||
|
return c.SDL_GetAndroidExternalStoragePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getAndroidCachePath() [*c]const u8 {
|
||||||
|
return c.SDL_GetAndroidCachePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const RequestAndroidPermissionCallback = c.SDL_RequestAndroidPermissionCallback;
|
||||||
|
|
||||||
|
pub inline fn requestAndroidPermission(permission: [*c]const u8, cb: RequestAndroidPermissionCallback, userdata: ?*anyopaque) bool {
|
||||||
|
return c.SDL_RequestAndroidPermission(permission, cb, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn showAndroidToast(message: [*c]const u8, duration: c_int, gravity: c_int, xoffset: c_int, yoffset: c_int) bool {
|
||||||
|
return c.SDL_ShowAndroidToast(message, duration, gravity, xoffset, yoffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn sendAndroidMessage(command: u32, param: c_int) bool {
|
||||||
|
return c.SDL_SendAndroidMessage(command, param);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn isTablet() bool {
|
||||||
|
return c.SDL_IsTablet();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn isTV() bool {
|
||||||
|
return c.SDL_IsTV();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const Sandbox = enum(c_int) {
|
||||||
|
sandboxUnknownContainer,
|
||||||
|
sandboxFlatpak,
|
||||||
|
sandboxSnap,
|
||||||
|
sandboxMacos,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn getSandbox() Sandbox {
|
||||||
|
return c.SDL_GetSandbox();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn onApplicationWillTerminate() void {
|
||||||
|
return c.SDL_OnApplicationWillTerminate();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn onApplicationDidReceiveMemoryWarning() void {
|
||||||
|
return c.SDL_OnApplicationDidReceiveMemoryWarning();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn onApplicationWillEnterBackground() void {
|
||||||
|
return c.SDL_OnApplicationWillEnterBackground();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn onApplicationDidEnterBackground() void {
|
||||||
|
return c.SDL_OnApplicationDidEnterBackground();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn onApplicationWillEnterForeground() void {
|
||||||
|
return c.SDL_OnApplicationWillEnterForeground();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn onApplicationDidEnterForeground() void {
|
||||||
|
return c.SDL_OnApplicationDidEnterForeground();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn onApplicationDidChangeStatusBarOrientation() void {
|
||||||
|
return c.SDL_OnApplicationDidChangeStatusBarOrientation();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const XTaskQueueHandle = *anyopaque;
|
||||||
|
|
||||||
|
pub const XUserHandle = *anyopaque;
|
||||||
|
|
||||||
|
pub inline fn getGDKTaskQueue(outTaskQueue: [*c]XTaskQueueHandle) bool {
|
||||||
|
return c.SDL_GetGDKTaskQueue(outTaskQueue);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getGDKDefaultUser(outUserHandle: [*c]XUserHandle) bool {
|
||||||
|
return c.SDL_GetGDKDefaultUser(outUserHandle);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,63 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const Time = i64;
|
||||||
|
|
||||||
|
pub const DateTime = extern struct {
|
||||||
|
year: c_int, // Year
|
||||||
|
month: c_int, // Month [01-12]
|
||||||
|
day: c_int, // Day of the month [01-31]
|
||||||
|
hour: c_int, // Hour [0-23]
|
||||||
|
minute: c_int, // Minute [0-59]
|
||||||
|
second: c_int, // Seconds [0-60]
|
||||||
|
nanosecond: c_int, // Nanoseconds [0-999999999]
|
||||||
|
day_of_week: c_int, // Day of the week [0-6] (0 being Sunday)
|
||||||
|
utc_offset: c_int, // Seconds east of UTC
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const DateFormat = enum(c_int) {
|
||||||
|
dateFormatYyyymmdd, //Year/Month/Day
|
||||||
|
dateFormatDdmmyyyy, //Day/Month/Year
|
||||||
|
dateFormatMmddyyyy, //Month/Day/Year
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const TimeFormat = enum(c_int) {
|
||||||
|
timeFormat24hr, //24 hour time
|
||||||
|
timeFormat12hr, //12 hour time
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn getDateTimeLocalePreferences(dateFormat: ?*DateFormat, timeFormat: ?*TimeFormat) bool {
|
||||||
|
return c.SDL_GetDateTimeLocalePreferences(@bitCast(dateFormat), @bitCast(timeFormat));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getCurrentTime(ticks: ?*Time) bool {
|
||||||
|
return c.SDL_GetCurrentTime(ticks);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn timeToDateTime(ticks: Time, dt: ?*DateTime, localTime: bool) bool {
|
||||||
|
return c.SDL_TimeToDateTime(ticks, dt, localTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn dateTimeToTime(dt: *const DateTime, ticks: ?*Time) bool {
|
||||||
|
return c.SDL_DateTimeToTime(@ptrCast(dt), ticks);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn timeToWindows(ticks: Time, dwLowDateTime: *u32, dwHighDateTime: *u32) void {
|
||||||
|
return c.SDL_TimeToWindows(ticks, @ptrCast(dwLowDateTime), @ptrCast(dwHighDateTime));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn timeFromWindows(dwLowDateTime: u32, dwHighDateTime: u32) Time {
|
||||||
|
return c.SDL_TimeFromWindows(dwLowDateTime, dwHighDateTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getDaysInMonth(year: c_int, month: c_int) c_int {
|
||||||
|
return c.SDL_GetDaysInMonth(year, month);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getDayOfYear(year: c_int, month: c_int, day: c_int) c_int {
|
||||||
|
return c.SDL_GetDayOfYear(year, month, day);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getDayOfWeek(year: c_int, month: c_int, day: c_int) c_int {
|
||||||
|
return c.SDL_GetDayOfWeek(year, month, day);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub inline fn getTicks() u64 {
|
||||||
|
return c.SDL_GetTicks();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getTicksNS() u64 {
|
||||||
|
return c.SDL_GetTicksNS();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getPerformanceCounter() u64 {
|
||||||
|
return c.SDL_GetPerformanceCounter();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getPerformanceFrequency() u64 {
|
||||||
|
return c.SDL_GetPerformanceFrequency();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn delay(ms: u32) void {
|
||||||
|
return c.SDL_Delay(ms);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn delayNS(ns: u64) void {
|
||||||
|
return c.SDL_DelayNS(ns);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn delayPrecise(ns: u64) void {
|
||||||
|
return c.SDL_DelayPrecise(ns);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const TimerID = u32;
|
||||||
|
|
||||||
|
pub const TimerCallback = c.SDL_TimerCallback;
|
||||||
|
|
||||||
|
pub inline fn addTimer(interval: u32, callback: TimerCallback, userdata: ?*anyopaque) TimerID {
|
||||||
|
return c.SDL_AddTimer(interval, callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const NSTimerCallback = c.SDL_NSTimerCallback;
|
||||||
|
|
||||||
|
pub inline fn addTimerNS(interval: u64, callback: NSTimerCallback, userdata: ?*anyopaque) TimerID {
|
||||||
|
return c.SDL_AddTimerNS(interval, callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn removeTimer(id: TimerID) bool {
|
||||||
|
return c.SDL_RemoveTimer(id);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
const std = @import("std");
|
||||||
|
pub const c = @import("c.zig").c;
|
||||||
|
|
||||||
|
pub const TouchID = u64;
|
||||||
|
|
||||||
|
pub const FingerID = u64;
|
||||||
|
|
||||||
|
pub const TouchDeviceType = enum(c_int) {
|
||||||
|
touchDeviceDirect, //touch screen with window-relative coordinates
|
||||||
|
touchDeviceIndirectAbsolute, //trackpad with absolute device coordinates
|
||||||
|
touchDeviceIndirectRelative, //trackpad with screen cursor-relative coordinates
|
||||||
|
};
|
||||||
|
|
||||||
|
pub const Finger = extern struct {
|
||||||
|
id: FingerID, // the finger ID
|
||||||
|
x: f32, // the x-axis location of the touch event, normalized (0...1)
|
||||||
|
y: f32, // the y-axis location of the touch event, normalized (0...1)
|
||||||
|
pressure: f32, // the quantity of pressure applied, normalized (0...1)
|
||||||
|
};
|
||||||
|
|
||||||
|
pub inline fn getTouchDevices(count: *c_int) ?*TouchID {
|
||||||
|
return c.SDL_GetTouchDevices(@ptrCast(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getTouchDeviceName(touchID: TouchID) [*c]const u8 {
|
||||||
|
return c.SDL_GetTouchDeviceName(touchID);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getTouchDeviceType(touchID: TouchID) TouchDeviceType {
|
||||||
|
return @intFromEnum(c.SDL_GetTouchDeviceType(touchID));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub inline fn getTouchFingers(touchID: TouchID, count: *c_int) [*c][*c]Finger {
|
||||||
|
return c.SDL_GetTouchFingers(touchID, @ptrCast(count));
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue