diff --git a/api/audio.zig b/api/audio.zig index 37aaa38..3564f87 100644 --- a/api/audio.zig +++ b/api/audio.zig @@ -1,14 +1,14 @@ 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 @bitCast(c.SDL_LoadWAV_IO(@ptrCast(iostream), @bitCast(closeio), @ptrCast(spec), audio_buf, @ptrCast(audio_len))); } }; -pub const PropertiesID = u32; - pub const AudioFormat = enum(c_int) { audioUnknown = 0x0000, //Unspecified audio format audioU8 = 0x0008, //Unsigned 8-bit samples @@ -86,14 +86,6 @@ pub const AudioStream = opaque { return @bitCast(c.SDL_PutAudioStreamData(@ptrCast(audiostream), buf, len)); } - pub inline fn putAudioStreamDataNoCopy(audiostream: *AudioStream, buf: ?*const anyopaque, len: c_int, callback: AudioStreamDataCompleteCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_PutAudioStreamDataNoCopy(@ptrCast(audiostream), buf, len, callback, userdata)); - } - - pub inline fn putAudioStreamPlanarData(audiostream: *AudioStream, channel_buffers: [*c]const *anyopaque, num_channels: c_int, num_samples: c_int) bool { - return @bitCast(c.SDL_PutAudioStreamPlanarData(@ptrCast(audiostream), channel_buffers, num_channels, num_samples)); - } - pub inline fn getAudioStreamData(audiostream: *AudioStream, buf: ?*anyopaque, len: c_int) c_int { return c.SDL_GetAudioStreamData(@ptrCast(audiostream), buf, len); } @@ -191,16 +183,16 @@ pub inline fn isAudioDevicePlayback(devid: AudioDeviceID) bool { return @bitCast(c.SDL_IsAudioDevicePlayback(devid)); } -pub inline fn pauseAudioDevice(devid: AudioDeviceID) bool { - return @bitCast(c.SDL_PauseAudioDevice(devid)); +pub inline fn pauseAudioDevice(dev: AudioDeviceID) bool { + return @bitCast(c.SDL_PauseAudioDevice(dev)); } -pub inline fn resumeAudioDevice(devid: AudioDeviceID) bool { - return @bitCast(c.SDL_ResumeAudioDevice(devid)); +pub inline fn resumeAudioDevice(dev: AudioDeviceID) bool { + return @bitCast(c.SDL_ResumeAudioDevice(dev)); } -pub inline fn audioDevicePaused(devid: AudioDeviceID) bool { - return @bitCast(c.SDL_AudioDevicePaused(devid)); +pub inline fn audioDevicePaused(dev: AudioDeviceID) bool { + return @bitCast(c.SDL_AudioDevicePaused(dev)); } pub inline fn getAudioDeviceGain(devid: AudioDeviceID) f32 { @@ -231,8 +223,6 @@ pub inline fn createAudioStream(src_spec: ?*const AudioSpec, dst_spec: ?*const A return @ptrCast(c.SDL_CreateAudioStream(@ptrCast(src_spec), @ptrCast(dst_spec))); } -pub const AudioStreamDataCompleteCallback = c.SDL_AudioStreamDataCompleteCallback; - pub const AudioStreamCallback = c.SDL_AudioStreamCallback; pub inline fn openAudioDeviceStream(devid: AudioDeviceID, spec: ?*const AudioSpec, callback: AudioStreamCallback, userdata: ?*anyopaque) ?*AudioStream { diff --git a/api/camera.zig b/api/camera.zig index 4224810..bb1e756 100644 --- a/api/camera.zig +++ b/api/camera.zig @@ -11,7 +11,6 @@ pub const PixelFormat = enum(c_int) { pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG }; pub const Surface = opaque {}; @@ -43,7 +42,7 @@ pub const Colorspace = enum(c_int) { colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified }; pub const PropertiesID = u32; @@ -51,7 +50,7 @@ pub const PropertiesID = u32; pub const CameraID = u32; pub const Camera = opaque { - pub inline fn getCameraPermissionState(camera: *Camera) CameraPermissionState { + pub inline fn getCameraPermissionState(camera: *Camera) c_int { return c.SDL_GetCameraPermissionState(@ptrCast(camera)); } @@ -86,7 +85,7 @@ pub const CameraSpec = extern struct { 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 denominator ((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) { @@ -95,11 +94,6 @@ pub const CameraPosition = enum(c_int) { cameraPositionBackFacing, }; -pub const CameraPermissionState = enum(c_int) { - cameraPermissionStatePending, - cameraPermissionStateApproved, -}; - pub inline fn getNumCameraDrivers() c_int { return c.SDL_GetNumCameraDrivers(); } @@ -116,8 +110,8 @@ pub inline fn getCameras(count: *c_int) ?*CameraID { return @ptrCast(c.SDL_GetCameras(@ptrCast(count))); } -pub inline fn getCameraSupportedFormats(instance_id: CameraID, count: *c_int) [*c]?*CameraSpec { - return c.SDL_GetCameraSupportedFormats(instance_id, @ptrCast(count)); +pub inline fn getCameraSupportedFormats(devid: CameraID, count: *c_int) [*c]?*CameraSpec { + return c.SDL_GetCameraSupportedFormats(devid, @ptrCast(count)); } pub inline fn getCameraName(instance_id: CameraID) [*c]const u8 { diff --git a/api/events.zig b/api/events.zig index f7ddd83..e6ece5d 100644 --- a/api/events.zig +++ b/api/events.zig @@ -19,8 +19,7 @@ pub const PenInputFlags = packed struct(u32) { penInputButton4: bool = false, // button 4 is pressed penInputButton5: bool = false, // button 5 is pressed penInputEraserTip: bool = false, // eraser tip is used - penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) - pad0: u23 = 0, + pad0: u24 = 0, rsvd: bool = false, pub const None = PenInputFlags{}; @@ -172,10 +171,9 @@ pub const EventType = enum(c_int) { eventDisplayDesktopModeChanged, //Display has changed desktop mode eventDisplayCurrentModeChanged, //Display has changed current mode eventDisplayContentScaleChanged, //Display has changed content scale - eventDisplayUsableBoundsChanged, //Display has changed usable bounds eventWindowShown = 0x202, //Window has been shown eventWindowHidden, //Window has been hidden - eventWindowExposed, + 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 @@ -206,8 +204,6 @@ pub const EventType = enum(c_int) { eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates - eventScreenKeyboardShown, //The on-screen keyboard has been shown - eventScreenKeyboardHidden, //The on-screen keyboard has been hidden eventMouseMotion = 0x400, //Mouse moved eventMouseButtonDown, //Mouse button pressed eventMouseButtonUp, //Mouse button released @@ -238,10 +234,7 @@ pub const EventType = enum(c_int) { eventFingerUp, eventFingerMotion, eventFingerCanceled, - eventPinchBegin = 0x710, //Pinch gesture started - eventPinchUpdate, //Pinch gesture updated - eventPinchEnd, //Pinch gesture ended - eventClipboardUpdate = 0x900, //The clipboard changed + eventClipboardUpdate = 0x900, //The clipboard or primary selection changed eventDropFile = 0x1000, //The system requests a file open eventDropText, //text/plain drag-and-drop event eventDropBegin, //A new set of drops is beginning (NULL filename) @@ -279,7 +272,7 @@ pub const CommonEvent = extern struct { }; pub const DisplayEvent = extern struct { - _type: EventType, // SDL_EVENT_DISPLAY_* + _type: EventType, // SDL_DISPLAYEVENT_* reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() displayID: DisplayID, // The associated display @@ -394,8 +387,6 @@ pub const MouseWheelEvent = extern struct { 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 - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) }; pub const JoyAxisEvent = extern struct { @@ -553,14 +544,6 @@ pub const TouchFingerEvent = extern struct { windowID: WindowID, // The window underneath the finger, if any }; -pub const PinchFingerEvent = extern struct { - _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". - 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, @@ -655,7 +638,7 @@ pub const QuitEvent = extern struct { }; pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration + _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 @@ -695,7 +678,6 @@ pub const Event = extern union { quit: QuitEvent, // Quit request event data user: UserEvent, // Custom event data tfinger: TouchFingerEvent, // Touch finger event data - pinch: PinchFingerEvent, // Pinch event data pproximity: PenProximityEvent, // Pen proximity event data ptouch: PenTouchEvent, // Pen tip touching event data pmotion: PenMotionEvent, // Pen motion event data @@ -790,7 +772,3 @@ pub inline fn registerEvents(numevents: c_int) u32 { pub inline fn getWindowFromEvent(event: ?*const Event) ?*Window { return @ptrCast(c.SDL_GetWindowFromEvent(@ptrCast(event))); } - -pub inline fn getEventDescription(event: ?*const Event, buf: [*c]u8, buflen: c_int) c_int { - return c.SDL_GetEventDescription(@ptrCast(event), buf, buflen); -} diff --git a/api/gamepad.zig b/api/gamepad.zig index 0bf9c84..5aa8b49 100644 --- a/api/gamepad.zig +++ b/api/gamepad.zig @@ -30,7 +30,6 @@ pub const SensorType = enum(c_int) { sensorGyroL, //Gyroscope for left Joy-Con controller sensorAccelR, //Accelerometer for right Joy-Con controller sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, }; pub const PowerState = enum(c_int) { @@ -217,7 +216,6 @@ pub const GamepadType = enum(c_int) { gamepadTypeNintendoSwitchJoyconLeft, gamepadTypeNintendoSwitchJoyconRight, gamepadTypeNintendoSwitchJoyconPair, - gamepadTypeGamecube, gamepadTypeCount, }; @@ -238,14 +236,14 @@ pub const GamepadButton = enum(c_int) { 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, DualSense Edge RB button, Right Joy-Con SR button) - gamepadButtonLeftPaddle1, //Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button) - gamepadButtonRightPaddle2, //Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button) - gamepadButtonLeftPaddle2, //Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR 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 (e.g. Nintendo GameCube left trigger click) - gamepadButtonMisc4, //Additional button (e.g. Nintendo GameCube right trigger click) + gamepadButtonMisc3, //Additional button + gamepadButtonMisc4, //Additional button gamepadButtonMisc5, //Additional button gamepadButtonMisc6, //Additional button gamepadButtonCount, diff --git a/api/gpu.zig b/api/gpu.zig index 32eba0c..bc538dd 100644 --- a/api/gpu.zig +++ b/api/gpu.zig @@ -10,19 +10,6 @@ pub const FColor = extern struct { pub const PropertiesID = u32; -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - pub const Rect = extern struct { x: c_int, y: c_int, @@ -32,13 +19,10 @@ pub const Rect = extern struct { pub const Window = opaque {}; -pub const FlipMode = packed struct(u32) { - flipHorizontal: bool = false, // flip horizontally - flipVertical: bool = false, // flip vertically - pad0: u29 = 0, - rsvd: bool = false, - - pub const None = FlipMode{}; +pub const FlipMode = enum(c_int) { + flipNone, //Do not flip + flipHorizontal, //flip horizontally + flipVertical, //flip vertically }; pub const GPUDevice = opaque { @@ -54,10 +38,6 @@ pub const GPUDevice = opaque { return @bitCast(c.SDL_GetGPUShaderFormats(@ptrCast(gpudevice))); } - pub inline fn getGPUDeviceProperties(gpudevice: *GPUDevice) PropertiesID { - return c.SDL_GetGPUDeviceProperties(@ptrCast(gpudevice)); - } - pub inline fn createGPUComputePipeline(gpudevice: *GPUDevice, createinfo: ?*const GPUComputePipelineCreateInfo) ?*GPUComputePipeline { return @ptrCast(c.SDL_CreateGPUComputePipeline(@ptrCast(gpudevice), @ptrCast(createinfo))); } @@ -686,7 +666,7 @@ pub const GPUCompareOp = enum(c_int) { compareopLessOrEqual, //The comparison evaluates reference <= test. compareopGreater, //The comparison evaluates reference > test. compareopNotEqual, //The comparison evaluates reference != test. - compareopGreaterOrEqual, //The comparison evaluates reference >= test. + compareopGreaterOrEqual, //The comparison evalutes reference >= test. compareopAlways, //The comparison always evaluates true. }; @@ -873,9 +853,9 @@ pub const GPUSamplerCreateInfo = extern struct { pub const GPUVertexBufferDescription = extern struct { slot: u32, // The binding slot of the vertex buffer. - pitch: u32, // The size of a single element + the offset between elements. + pitch: u32, // The byte pitch between consecutive elements of the vertex buffer. input_rate: GPUVertexInputRate, // Whether attribute addressing is a function of the vertex index or instance index. - instance_step_rate: u32, // Reserved for future use. Must be set to 0. + instance_step_rate: u32, // The number of instances to draw using the same per-instance data before advancing in the instance buffer by one element. Ignored unless input_rate is SDL_GPU_VERTEXINPUTRATE_INSTANCE }; pub const GPUVertexAttribute = extern struct { @@ -965,9 +945,9 @@ pub const GPURasterizerState = extern struct { pub const GPUMultisampleState = extern struct { sample_count: GPUSampleCount, // The number of samples to be used in rasterization. - sample_mask: u32, // Reserved for future use. Must be set to 0. - enable_mask: bool, // Reserved for future use. Must be set to false. - enable_alpha_to_coverage: bool, // true enables the alpha-to-coverage feature. + sample_mask: u32, // Determines which samples get updated in the render targets. Treated as 0xFFFFFFFF if enable_mask is false. + enable_mask: bool, // Enables sample masking. + padding1: u8, padding2: u8, padding3: u8, }; @@ -1055,8 +1035,8 @@ pub const GPUDepthStencilTargetInfo = extern struct { stencil_store_op: GPUStoreOp, // What is done with the stencil results of the render pass. cycle: bool, // true cycles the texture if the texture is bound and any load ops are not LOAD clear_stencil: u8, // The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. - mip_level: u8, // The mip level to use as the depth stencil target. - layer: u8, // The layer index to use as the depth stencil target. + padding1: u8, + padding2: u8, }; pub const GPUBlitInfo = extern struct { @@ -1116,16 +1096,6 @@ pub inline fn createGPUDeviceWithProperties(props: PropertiesID) ?*GPUDevice { return @ptrCast(c.SDL_CreateGPUDeviceWithProperties(props)); } -pub const GPUVulkanOptions = extern struct { - vulkan_api_version: u32, // The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION. - feature_list: ?*anyopaque, // Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.) - vulkan_10_physical_device_features: ?*anyopaque, // Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features. - device_extension_count: u32, // Number of additional device extensions to require. - device_extension_names: [*c][*c]const u8, // Pointer to a list of additional device extensions to require. - instance_extension_count: u32, // Number of additional instance extensions to require. - instance_extension_names: [*c][*c]const u8, // Pointer to a list of additional instance extensions to require. -}; - pub inline fn getNumGPUDrivers() c_int { return c.SDL_GetNumGPUDrivers(); } @@ -1141,11 +1111,3 @@ pub inline fn gpuTextureFormatTexelBlockSize(format: GPUTextureFormat) u32 { pub inline fn calculateGPUTextureFormatSize(format: GPUTextureFormat, width: u32, height: u32, depth_or_layer_count: u32) u32 { return c.SDL_CalculateGPUTextureFormatSize(@bitCast(format), width, height, depth_or_layer_count); } - -pub inline fn getPixelFormatFromGPUTextureFormat(format: GPUTextureFormat) PixelFormat { - return @bitCast(c.SDL_GetPixelFormatFromGPUTextureFormat(@bitCast(format))); -} - -pub inline fn getGPUTextureFormatFromPixelFormat(format: PixelFormat) GPUTextureFormat { - return @bitCast(c.SDL_GetGPUTextureFormatFromPixelFormat(@bitCast(format))); -} diff --git a/api/haptic.zig b/api/haptic.zig index 143ab7c..5f82803 100644 --- a/api/haptic.zig +++ b/api/haptic.zig @@ -44,27 +44,27 @@ pub const Haptic = opaque { return @bitCast(c.SDL_HapticEffectSupported(@ptrCast(haptic), @ptrCast(effect))); } - pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) HapticEffectID { + pub inline fn createHapticEffect(haptic: *Haptic, effect: ?*const HapticEffect) c_int { return c.SDL_CreateHapticEffect(@ptrCast(haptic), @ptrCast(effect)); } - pub inline fn updateHapticEffect(haptic: *Haptic, effect: HapticEffectID, data: ?*const HapticEffect) bool { + pub inline fn updateHapticEffect(haptic: *Haptic, effect: c_int, data: ?*const HapticEffect) bool { return @bitCast(c.SDL_UpdateHapticEffect(@ptrCast(haptic), effect, @ptrCast(data))); } - pub inline fn runHapticEffect(haptic: *Haptic, effect: HapticEffectID, iterations: u32) bool { + pub inline fn runHapticEffect(haptic: *Haptic, effect: c_int, iterations: u32) bool { return @bitCast(c.SDL_RunHapticEffect(@ptrCast(haptic), effect, iterations)); } - pub inline fn stopHapticEffect(haptic: *Haptic, effect: HapticEffectID) bool { + pub inline fn stopHapticEffect(haptic: *Haptic, effect: c_int) bool { return @bitCast(c.SDL_StopHapticEffect(@ptrCast(haptic), effect)); } - pub inline fn destroyHapticEffect(haptic: *Haptic, effect: HapticEffectID) void { + pub inline fn destroyHapticEffect(haptic: *Haptic, effect: c_int) void { return c.SDL_DestroyHapticEffect(@ptrCast(haptic), effect); } - pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: HapticEffectID) bool { + pub inline fn getHapticEffectStatus(haptic: *Haptic, effect: c_int) bool { return @bitCast(c.SDL_GetHapticEffectStatus(@ptrCast(haptic), effect)); } @@ -105,19 +105,13 @@ pub const Haptic = opaque { } }; -pub const HapticEffectType = u16; - -pub const HapticDirectionType = u8; - -pub const HapticEffectID = c_int; - pub const HapticDirection = extern struct { - _type: HapticDirectionType, // The type of encoding. + _type: u8, // The type of encoding. dir: [3]i32, // The encoded direction. }; pub const HapticConstant = extern struct { - _type: HapticEffectType, // SDL_HAPTIC_CONSTANT + _type: u16, // SDL_HAPTIC_CONSTANT direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -161,7 +155,7 @@ pub const HapticCondition = extern struct { }; pub const HapticRamp = extern struct { - _type: HapticEffectType, // SDL_HAPTIC_RAMP + _type: u16, // SDL_HAPTIC_RAMP direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -176,14 +170,14 @@ pub const HapticRamp = extern struct { }; pub const HapticLeftRight = extern struct { - _type: HapticEffectType, // SDL_HAPTIC_LEFTRIGHT + _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: HapticEffectType, // SDL_HAPTIC_CUSTOM + _type: u16, // SDL_HAPTIC_CUSTOM direction: HapticDirection, // Direction of the effect. length: u32, // Duration of the effect. delay: u16, // Delay before starting the effect. @@ -200,7 +194,7 @@ pub const HapticCustom = extern struct { }; pub const HapticEffect = extern union { - _type: HapticEffectType, // Effect type. + _type: u16, // Effect type. constant: HapticConstant, // Constant effect. periodic: HapticPeriodic, // Periodic effect. condition: HapticCondition, // Condition effect. diff --git a/api/init.zig b/api/init.zig index 1c0d191..b568c23 100644 --- a/api/init.zig +++ b/api/init.zig @@ -4,7 +4,7 @@ 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` + 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, diff --git a/api/joystick.zig b/api/joystick.zig index 3f57466..4fd3cd1 100644 --- a/api/joystick.zig +++ b/api/joystick.zig @@ -12,7 +12,6 @@ pub const SensorType = enum(c_int) { sensorGyroL, //Gyroscope for left Joy-Con controller sensorAccelR, //Accelerometer for right Joy-Con controller sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, }; pub const GUID = extern struct { diff --git a/api/mouse.zig b/api/mouse.zig index 381760f..d6faf4a 100644 --- a/api/mouse.zig +++ b/api/mouse.zig @@ -62,11 +62,6 @@ pub const MouseWheelDirection = enum(c_int) { mousewheelFlipped, //The scroll direction is flipped / natural }; -pub const CursorFrameInfo = extern struct { - surface: ?*Surface, // The surface data for this frame - duration: u32, // The frame duration in milliseconds (a duration of 0 is infinite) -}; - pub const MouseButtonFlags = packed struct(u32) { buttonLeft: bool = false, buttonMiddle: bool = false, @@ -79,8 +74,6 @@ pub const MouseButtonFlags = packed struct(u32) { pub const ButtonX2: MouseButtonFlags = @bitCast(@as(u32, 5)); }; -pub const MouseMotionTransformCallback = c.SDL_MouseMotionTransformCallback; - pub inline fn hasMouse() bool { return @bitCast(c.SDL_HasMouse()); } @@ -113,10 +106,6 @@ pub inline fn warpMouseGlobal(x: f32, y: f32) bool { return @bitCast(c.SDL_WarpMouseGlobal(x, y)); } -pub inline fn setRelativeMouseTransform(callback: MouseMotionTransformCallback, userdata: ?*anyopaque) bool { - return @bitCast(c.SDL_SetRelativeMouseTransform(callback, userdata)); -} - pub inline fn captureMouse(enabled: bool) bool { return @bitCast(c.SDL_CaptureMouse(@bitCast(enabled))); } @@ -125,10 +114,6 @@ pub inline fn createCursor(data: [*c]const u8, mask: [*c]const u8, w: c_int, h: return @ptrCast(c.SDL_CreateCursor(data, mask, w, h, hot_x, hot_y)); } -pub inline fn createAnimatedCursor(frames: ?*CursorFrameInfo, frame_count: c_int, hot_x: c_int, hot_y: c_int) ?*Cursor { - return @ptrCast(c.SDL_CreateAnimatedCursor(@ptrCast(frames), frame_count, hot_x, hot_y)); -} - pub inline fn createSystemCursor(id: SystemCursor) ?*Cursor { return @ptrCast(c.SDL_CreateSystemCursor(id)); } diff --git a/api/pixels.zig b/api/pixels.zig index e67e24a..2ce745b 100644 --- a/api/pixels.zig +++ b/api/pixels.zig @@ -67,7 +67,6 @@ pub const PixelFormat = enum(c_int) { pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG }; pub const ColorRange = enum(c_int) { @@ -151,7 +150,7 @@ pub const Colorspace = enum(c_int) { colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified }; pub const Color = extern struct { @@ -230,10 +229,10 @@ pub inline fn mapRGBA(format: ?*const PixelFormatDetails, palette: ?*const Palet return c.SDL_MapRGBA(@ptrCast(format), @ptrCast(palette), r, g, b, a); } -pub inline fn getRGB(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8) void { - return c.SDL_GetRGB(pixelvalue, @ptrCast(format), @ptrCast(palette), r, g, b); +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(pixelvalue: u32, format: ?*const PixelFormatDetails, palette: ?*const Palette, r: [*c]u8, g: [*c]u8, b: [*c]u8, a: [*c]u8) void { - return c.SDL_GetRGBA(pixelvalue, @ptrCast(format), @ptrCast(palette), r, g, b, a); +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); } diff --git a/api/render.zig b/api/render.zig index b927654..aaad785 100644 --- a/api/render.zig +++ b/api/render.zig @@ -6,6 +6,18 @@ pub const FPoint = extern struct { y: f32, }; +pub const PixelFormat = enum(c_int) { + pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) + pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) + pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) + pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) + pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) + pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) + pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) + pixelformatExternalOes = 0x2053454f, //Android video texture format +}; + pub const FColor = extern struct { r: f32, g: f32, @@ -19,8 +31,15 @@ pub const Surface = opaque { } }; +pub const ScaleMode = enum(c_int) { + scalemodeNearest, //nearest pixel sampling + scalemodeLinear, //linear filtering +}; + pub const PropertiesID = u32; +pub const BlendMode = u32; + pub const Window = opaque { pub inline fn createRenderer(window: *Window, name: [*c]const u8) ?*Renderer { return @ptrCast(c.SDL_CreateRenderer(@ptrCast(window), name)); @@ -38,77 +57,6 @@ pub const FRect = extern struct { h: f32, }; -pub const GPUTextureSamplerBinding = extern struct { - texture: ?*GPUTexture, // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER. - sampler: ?*GPUSampler, // The sampler to bind. -}; - -pub const GPUSampler = opaque {}; - -pub const GPUTexture = opaque {}; - -pub const GPUShader = opaque {}; - -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 - windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 - 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: u37 = 0, - rsvd: bool = false, - - pub const None = WindowFlags{}; -}; - -pub const PixelFormat = enum(c_int) { - pixelformatYv12 = 0x32315659, //Planar mode: Y + V + U (3 planes) - pixelformatIyuv = 0x56555949, //Planar mode: Y + U + V (3 planes) - pixelformatYuy2 = 0x32595559, //Packed mode: Y0+U0+Y1+V0 (1 plane) - pixelformatUyvy = 0x59565955, //Packed mode: U0+Y0+V0+Y1 (1 plane) - pixelformatYvyu = 0x55595659, //Packed mode: Y0+V0+Y1+U0 (1 plane) - pixelformatNv12 = 0x3231564e, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) - pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) - pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG -}; - -pub const ScaleMode = enum(c_int) { - scalemodeNearest, //nearest pixel sampling - scalemodeLinear, //linear filtering - scalemodePixelart, -}; - -pub const GPUDevice = opaque { - pub inline fn createGPURenderer(gpudevice: *GPUDevice, window: ?*Window) ?*Renderer { - return @ptrCast(c.SDL_CreateGPURenderer(@ptrCast(gpudevice), @ptrCast(window))); - } -}; - -pub const BlendMode = u32; - 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 @@ -140,7 +88,6 @@ pub const Event = extern union { quit: QuitEvent, // Quit request event data user: UserEvent, // Custom event data tfinger: TouchFingerEvent, // Touch finger event data - pinch: PinchFingerEvent, // Pinch event data pproximity: PenProximityEvent, // Pen proximity event data ptouch: PenTouchEvent, // Pen tip touching event data pmotion: PenMotionEvent, // Pen motion event data @@ -166,7 +113,7 @@ pub const JoyAxisEvent = extern struct { }; pub const UserEvent = extern struct { - _type: u32, // SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration + _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 @@ -175,14 +122,6 @@ pub const UserEvent = extern struct { data2: ?*anyopaque, // User defined data pointer }; -pub const PinchFingerEvent = extern struct { - _type: EventType, // ::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END - reserved: u32, - timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() - scale: f32, // The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is "zoom out". Scale > 1 is "zoom in". - windowID: WindowID, // The window underneath the finger, if any -}; - pub const MouseMotionEvent = extern struct { _type: EventType, // SDL_EVENT_MOUSE_MOTION reserved: u32, @@ -283,7 +222,7 @@ pub const GamepadAxisEvent = extern struct { }; pub const DisplayEvent = extern struct { - _type: EventType, // SDL_EVENT_DISPLAY_* + _type: EventType, // SDL_DISPLAYEVENT_* reserved: u32, timestamp: u64, // In nanoseconds, populated using SDL_GetTicksNS() displayID: DisplayID, // The associated display @@ -459,8 +398,6 @@ pub const MouseWheelEvent = extern struct { 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 - integer_x: i32, // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12) - integer_y: i32, // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12) }; pub const PenAxisEvent = extern struct { @@ -562,10 +499,9 @@ pub const EventType = enum(c_int) { eventDisplayDesktopModeChanged, //Display has changed desktop mode eventDisplayCurrentModeChanged, //Display has changed current mode eventDisplayContentScaleChanged, //Display has changed content scale - eventDisplayUsableBoundsChanged, //Display has changed usable bounds eventWindowShown = 0x202, //Window has been shown eventWindowHidden, //Window has been hidden - eventWindowExposed, + 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 @@ -596,8 +532,6 @@ pub const EventType = enum(c_int) { eventKeyboardAdded, //A new keyboard has been inserted into the system eventKeyboardRemoved, //A keyboard has been removed eventTextEditingCandidates, //Keyboard text editing candidates - eventScreenKeyboardShown, //The on-screen keyboard has been shown - eventScreenKeyboardHidden, //The on-screen keyboard has been hidden eventMouseMotion = 0x400, //Mouse moved eventMouseButtonDown, //Mouse button pressed eventMouseButtonUp, //Mouse button released @@ -628,10 +562,7 @@ pub const EventType = enum(c_int) { eventFingerUp, eventFingerMotion, eventFingerCanceled, - eventPinchBegin = 0x710, //Pinch gesture started - eventPinchUpdate, //Pinch gesture updated - eventPinchEnd, //Pinch gesture ended - eventClipboardUpdate = 0x900, //The clipboard changed + eventClipboardUpdate = 0x900, //The clipboard or primary selection changed eventDropFile = 0x1000, //The system requests a file open eventDropText, //text/plain drag-and-drop event eventDropBegin, //A new set of drops is beginning (NULL filename) @@ -688,8 +619,7 @@ pub const PenInputFlags = packed struct(u32) { penInputButton4: bool = false, // button 4 is pressed penInputButton5: bool = false, // button 5 is pressed penInputEraserTip: bool = false, // eraser tip is used - penInputInProximity: bool = false, // pen is in proximity (since SDL 3.4.0) - pad0: u23 = 0, + pad0: u24 = 0, rsvd: bool = false, pub const None = PenInputFlags{}; @@ -813,17 +743,12 @@ pub const Keymod = u16; pub const Keycode = u32; -pub const FlipMode = packed struct(u32) { - flipHorizontal: bool = false, // flip horizontally - flipVertical: bool = false, // flip vertically - pad0: u29 = 0, - rsvd: bool = false, - - pub const None = FlipMode{}; +pub const FlipMode = enum(c_int) { + flipNone, //Do not flip + flipHorizontal, //flip horizontally + flipVertical, //flip vertically }; -pub const GPUBuffer = opaque {}; - pub const Rect = extern struct { x: c_int, y: c_int, @@ -831,18 +756,36 @@ pub const Rect = extern struct { 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 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 Color = extern struct { - r: u8, - g: u8, - b: u8, - a: u8, + pub const None = WindowFlags{}; }; pub const Vertex = extern struct { @@ -857,25 +800,15 @@ pub const TextureAccess = enum(c_int) { textureaccessTarget, //Texture can be used as a render target }; -pub const TextureAddressMode = enum(c_int) { - textureAddressAuto, //Wrapping is enabled if texture coordinates are outside [0, 1], this is the default - textureAddressClamp, //Texture coordinates are clamped to the [0, 1] range - textureAddressWrap, //The texture is repeated (tiled) -}; - pub const RendererLogicalPresentation = enum(c_int) { logicalPresentationDisabled, //There is no logical size in effect logicalPresentationStretch, //The rendered content is stretched to the output resolution - logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color + logicalPresentationLetterbox, //The rendered content is fit to the largest dimension and the other dimension is letterboxed with black bars logicalPresentationOverscan, //The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds logicalPresentationIntegerScale, //The rendered content is scaled up by integer multiples to fit the output resolution }; pub const Renderer = opaque { - pub inline fn getGPURendererDevice(renderer: *Renderer) ?*GPUDevice { - return @ptrCast(c.SDL_GetGPURendererDevice(@ptrCast(renderer))); - } - pub inline fn getRenderWindow(renderer: *Renderer) ?*Window { return @ptrCast(c.SDL_GetRenderWindow(@ptrCast(renderer))); } @@ -1064,10 +997,6 @@ pub const Renderer = opaque { return @bitCast(c.SDL_RenderTexture9Grid(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect))); } - pub inline fn renderTexture9GridTiled(renderer: *Renderer, texture: ?*Texture, srcrect: ?*const FRect, left_width: f32, right_width: f32, top_height: f32, bottom_height: f32, scale: f32, dstrect: ?*const FRect, tileScale: f32) bool { - return @bitCast(c.SDL_RenderTexture9GridTiled(@ptrCast(renderer), @ptrCast(texture), @ptrCast(srcrect), left_width, right_width, top_height, bottom_height, scale, @ptrCast(dstrect), tileScale)); - } - pub inline fn renderGeometry(renderer: *Renderer, texture: ?*Texture, vertices: ?*const Vertex, num_vertices: c_int, indices: [*c]const c_int, num_indices: c_int) bool { return @bitCast(c.SDL_RenderGeometry(@ptrCast(renderer), @ptrCast(texture), @ptrCast(vertices), num_vertices, indices, num_indices)); } @@ -1076,14 +1005,6 @@ pub const Renderer = opaque { return @bitCast(c.SDL_RenderGeometryRaw(@ptrCast(renderer), @ptrCast(texture), @ptrCast(xy), xy_stride, @ptrCast(color), color_stride, @ptrCast(uv), uv_stride, num_vertices, indices, num_indices, size_indices)); } - pub inline fn setRenderTextureAddressMode(renderer: *Renderer, u_mode: TextureAddressMode, v_mode: TextureAddressMode) bool { - return @bitCast(c.SDL_SetRenderTextureAddressMode(@ptrCast(renderer), @intFromEnum(u_mode), @intFromEnum(v_mode))); - } - - pub inline fn getRenderTextureAddressMode(renderer: *Renderer, u_mode: ?*TextureAddressMode, v_mode: ?*TextureAddressMode) bool { - return @bitCast(c.SDL_GetRenderTextureAddressMode(@ptrCast(renderer), @ptrCast(u_mode), @ptrCast(v_mode))); - } - pub inline fn renderReadPixels(renderer: *Renderer, rect: ?*const Rect) ?*Surface { return @ptrCast(c.SDL_RenderReadPixels(@ptrCast(renderer), @ptrCast(rect))); } @@ -1123,22 +1044,6 @@ pub const Renderer = opaque { pub inline fn renderDebugText(renderer: *Renderer, x: f32, y: f32, str: [*c]const u8) bool { return @bitCast(c.SDL_RenderDebugText(@ptrCast(renderer), x, y, str)); } - - pub inline fn setDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ScaleMode) bool { - return @bitCast(c.SDL_SetDefaultTextureScaleMode(@ptrCast(renderer), @intFromEnum(scale_mode))); - } - - pub inline fn getDefaultTextureScaleMode(renderer: *Renderer, scale_mode: ?*ScaleMode) bool { - return @bitCast(c.SDL_GetDefaultTextureScaleMode(@ptrCast(renderer), @ptrCast(scale_mode))); - } - - pub inline fn createGPURenderState(renderer: *Renderer, createinfo: ?*GPURenderStateCreateInfo) ?*GPURenderState { - return @ptrCast(c.SDL_CreateGPURenderState(@ptrCast(renderer), @ptrCast(createinfo))); - } - - pub inline fn setGPURenderState(renderer: *Renderer, state: ?*GPURenderState) bool { - return @bitCast(c.SDL_SetGPURenderState(@ptrCast(renderer), @ptrCast(state))); - } }; pub const Texture = opaque { @@ -1154,14 +1059,6 @@ pub const Texture = opaque { return @bitCast(c.SDL_GetTextureSize(@ptrCast(texture), @ptrCast(w), @ptrCast(h))); } - pub inline fn setTexturePalette(texture: *Texture, palette: ?*Palette) bool { - return @bitCast(c.SDL_SetTexturePalette(@ptrCast(texture), @ptrCast(palette))); - } - - pub inline fn getTexturePalette(texture: *Texture) ?*Palette { - return @ptrCast(c.SDL_GetTexturePalette(@ptrCast(texture))); - } - pub inline fn setTextureColorMod(texture: *Texture, r: u8, g: u8, b: u8) bool { return @bitCast(c.SDL_SetTextureColorMod(@ptrCast(texture), r, g, b)); } @@ -1254,24 +1151,3 @@ pub inline fn createWindowAndRenderer(title: [*c]const u8, width: c_int, height: pub inline fn createRendererWithProperties(props: PropertiesID) ?*Renderer { return @ptrCast(c.SDL_CreateRendererWithProperties(props)); } - -pub const GPURenderStateCreateInfo = extern struct { - fragment_shader: ?*GPUShader, // The fragment shader to use when this render state is active - num_sampler_bindings: i32, // The number of additional fragment samplers to bind when this render state is active - sampler_bindings: ?*const GPUTextureSamplerBinding, // Additional fragment samplers to bind when this render state is active - num_storage_textures: i32, // The number of storage textures to bind when this render state is active - storage_textures: [*c]?*const GPUTexture, // Storage textures to bind when this render state is active - num_storage_buffers: i32, // The number of storage buffers to bind when this render state is active - storage_buffers: [*c]?*const GPUBuffer, // Storage buffers to bind when this render state is active - props: PropertiesID, // A properties ID for extensions. Should be 0 if no extensions are needed. -}; - -pub const GPURenderState = opaque { - pub inline fn setGPURenderStateFragmentUniforms(gpurenderstate: *GPURenderState, slot_index: u32, data: ?*const anyopaque, length: u32) bool { - return @bitCast(c.SDL_SetGPURenderStateFragmentUniforms(@ptrCast(gpurenderstate), slot_index, data, length)); - } - - pub inline fn destroyGPURenderState(gpurenderstate: *GPURenderState) void { - return c.SDL_DestroyGPURenderState(@ptrCast(gpurenderstate)); - } -}; diff --git a/api/sensor.zig b/api/sensor.zig index cc7fe67..eeb5d7c 100644 --- a/api/sensor.zig +++ b/api/sensor.zig @@ -44,7 +44,6 @@ pub const SensorType = enum(c_int) { sensorGyroL, //Gyroscope for left Joy-Con controller sensorAccelR, //Accelerometer for right Joy-Con controller sensorGyroR, //Gyroscope for right Joy-Con controller - sensorCount, }; pub inline fn getSensors(count: *c_int) ?*SensorID { diff --git a/api/surface.zig b/api/surface.zig index 156343c..64a300e 100644 --- a/api/surface.zig +++ b/api/surface.zig @@ -11,23 +11,14 @@ pub const PixelFormat = enum(c_int) { pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG }; pub const BlendMode = u32; pub const IOStream = opaque { - pub inline fn loadSurface_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadSurface_IO(@ptrCast(iostream), @bitCast(closeio))); - } - pub inline fn loadBMP_IO(iostream: *IOStream, closeio: bool) ?*Surface { return @ptrCast(c.SDL_LoadBMP_IO(@ptrCast(iostream), @bitCast(closeio))); } - - pub inline fn loadPNG_IO(iostream: *IOStream, closeio: bool) ?*Surface { - return @ptrCast(c.SDL_LoadPNG_IO(@ptrCast(iostream), @bitCast(closeio))); - } }; pub const Rect = extern struct { @@ -78,7 +69,7 @@ pub const Colorspace = enum(c_int) { colorspaceBt2020Full = 0x22102609, //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 pub const colorspaceRgbDefault = .colorspaceSrgb; //The default colorspace for RGB surfaces if no colorspace is specified - pub const colorspaceYuvDefault = .colorspaceBt601Limited; //The default colorspace for YUV surfaces if no colorspace is specified + pub const colorspaceYuvDefault = .colorspaceJpeg; //The default colorspace for YUV surfaces if no colorspace is specified }; pub const PropertiesID = u32; @@ -97,16 +88,12 @@ pub const SurfaceFlags = packed struct(u32) { pub const ScaleMode = enum(c_int) { scalemodeNearest, //nearest pixel sampling scalemodeLinear, //linear filtering - scalemodePixelart, }; -pub const FlipMode = packed struct(u32) { - flipHorizontal: bool = false, // flip horizontally - flipVertical: bool = false, // flip vertically - pad0: u29 = 0, - rsvd: bool = false, - - pub const None = FlipMode{}; +pub const FlipMode = enum(c_int) { + flipNone, //Do not flip + flipHorizontal, //flip horizontally + flipVertical, //flip vertically }; pub const Surface = opaque { @@ -170,14 +157,6 @@ pub const Surface = opaque { return @bitCast(c.SDL_SaveBMP(@ptrCast(surface), file)); } - pub inline fn savePNG_IO(surface: *Surface, dst: ?*IOStream, closeio: bool) bool { - return @bitCast(c.SDL_SavePNG_IO(@ptrCast(surface), @ptrCast(dst), @bitCast(closeio))); - } - - pub inline fn savePNG(surface: *Surface, file: [*c]const u8) bool { - return @bitCast(c.SDL_SavePNG(@ptrCast(surface), file)); - } - pub inline fn setSurfaceRLE(surface: *Surface, enabled: bool) bool { return @bitCast(c.SDL_SetSurfaceRLE(@ptrCast(surface), @bitCast(enabled))); } @@ -234,10 +213,6 @@ pub const Surface = opaque { return @bitCast(c.SDL_FlipSurface(@ptrCast(surface), @intFromEnum(flip))); } - pub inline fn rotateSurface(surface: *Surface, angle: f32) ?*Surface { - return @ptrCast(c.SDL_RotateSurface(@ptrCast(surface), angle)); - } - pub inline fn duplicateSurface(surface: *Surface) ?*Surface { return @ptrCast(c.SDL_DuplicateSurface(@ptrCast(surface))); } @@ -286,10 +261,6 @@ pub const Surface = opaque { return @bitCast(c.SDL_BlitSurfaceUncheckedScaled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); } - pub inline fn stretchSurface(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect, scaleMode: ScaleMode) bool { - return @bitCast(c.SDL_StretchSurface(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect), @intFromEnum(scaleMode))); - } - pub inline fn blitSurfaceTiled(surface: *Surface, srcrect: ?*const Rect, dst: ?*Surface, dstrect: ?*const Rect) bool { return @bitCast(c.SDL_BlitSurfaceTiled(@ptrCast(surface), @ptrCast(srcrect), @ptrCast(dst), @ptrCast(dstrect))); } @@ -335,18 +306,10 @@ pub inline fn createSurfaceFrom(width: c_int, height: c_int, format: PixelFormat return @ptrCast(c.SDL_CreateSurfaceFrom(width, height, @bitCast(format), pixels, pitch)); } -pub inline fn loadSurface(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadSurface(file)); -} - pub inline fn loadBMP(file: [*c]const u8) ?*Surface { return @ptrCast(c.SDL_LoadBMP(file)); } -pub inline fn loadPNG(file: [*c]const u8) ?*Surface { - return @ptrCast(c.SDL_LoadPNG(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 @bitCast(c.SDL_ConvertPixels(width, height, @bitCast(src_format), src, src_pitch, @bitCast(dst_format), dst, dst_pitch)); } diff --git a/api/video.zig b/api/video.zig index 3bd27e9..9125b0e 100644 --- a/api/video.zig +++ b/api/video.zig @@ -11,7 +11,6 @@ pub const PixelFormat = enum(c_int) { pixelformatNv21 = 0x3132564e, //Planar mode: Y + V/U interleaved (2 planes) pixelformatP010 = 0x30313050, //Planar mode: Y + U/V interleaved (2 planes) pixelformatExternalOes = 0x2053454f, //Android video texture format - pixelformatMjpg = 0x47504a4d, //Motion JPEG }; pub const Point = extern struct { @@ -189,10 +188,6 @@ pub const Window = opaque { return @bitCast(c.SDL_SetWindowAlwaysOnTop(@ptrCast(window), @bitCast(on_top))); } - pub inline fn setWindowFillDocument(window: *Window, fill: bool) bool { - return @bitCast(c.SDL_SetWindowFillDocument(@ptrCast(window), @bitCast(fill))); - } - pub inline fn showWindow(window: *Window) bool { return @bitCast(c.SDL_ShowWindow(@ptrCast(window))); } @@ -313,22 +308,6 @@ pub const Window = opaque { return @bitCast(c.SDL_FlashWindow(@ptrCast(window), @intFromEnum(operation))); } - pub inline fn setWindowProgressState(window: *Window, state: ProgressState) bool { - return @bitCast(c.SDL_SetWindowProgressState(@ptrCast(window), state)); - } - - pub inline fn getWindowProgressState(window: *Window) ProgressState { - return c.SDL_GetWindowProgressState(@ptrCast(window)); - } - - pub inline fn setWindowProgressValue(window: *Window, value: f32) bool { - return @bitCast(c.SDL_SetWindowProgressValue(@ptrCast(window), value)); - } - - pub inline fn getWindowProgressValue(window: *Window) f32 { - return c.SDL_GetWindowProgressValue(@ptrCast(window)); - } - pub inline fn destroyWindow(window: *Window) void { return c.SDL_DestroyWindow(@ptrCast(window)); } @@ -372,12 +351,11 @@ pub const WindowFlags = packed struct(u64) { 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 - windowFillDocument: bool = false, // window is in fill-document mode (Emscripten only), since SDL 3.4.0 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: u37 = 0, + pad0: u38 = 0, rsvd: bool = false, pub const None = WindowFlags{}; @@ -389,15 +367,6 @@ pub const FlashOperation = enum(c_int) { flashUntilFocused, //Flash the window until it gets focus }; -pub const ProgressState = enum(c_int) { - progressStateInvalid = -1, //An invalid progress state indicating an error; check SDL_GetError() - progressStateNone, //No progress bar is shown - progressStateIndeterminate, //The progress bar is shown in a indeterminate state - progressStateNormal, //The progress bar is shown in a normal state - progressStatePaused, //The progress bar is shown in a paused state - progressStateError, //The progress bar is shown in a state indicating the application had an error -}; - pub const GLContext = *anyopaque; pub const EGLDisplay = ?*anyopaque; @@ -415,10 +384,10 @@ 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 8. - glGreenSize, //the minimum number of bits for the green channel of the color buffer; defaults to 8. - glBlueSize, //the minimum number of bits for the blue channel of the color buffer; defaults to 8. - glAlphaSize, //the minimum number of bits for the alpha channel of the color buffer; defaults to 8. + 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. @@ -437,7 +406,7 @@ pub const GLAttr = enum(c_int) { 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 if 1. Defaults to -1 ("don't care"). This is a request; GL drivers might not comply! + 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, diff --git a/json/audio.json b/json/audio.json index 8789458..2f74550 100644 --- a/json/audio.json +++ b/json/audio.json @@ -13,9 +13,6 @@ ], "function_pointers": [], "c_type_aliases": [ - { - "name": "SDL_AudioStreamDataCompleteCallback" - }, { "name": "SDL_AudioStreamCallback" }, @@ -221,7 +218,7 @@ "return_type": "bool", "parameters": [ { - "name": "devid", + "name": "dev", "type": "SDL_AudioDeviceID" } ] @@ -231,7 +228,7 @@ "return_type": "bool", "parameters": [ { - "name": "devid", + "name": "dev", "type": "SDL_AudioDeviceID" } ] @@ -241,7 +238,7 @@ "return_type": "bool", "parameters": [ { - "name": "devid", + "name": "dev", "type": "SDL_AudioDeviceID" } ] @@ -536,54 +533,6 @@ } ] }, - { - "name": "SDL_PutAudioStreamDataNoCopy", - "return_type": "bool", - "parameters": [ - { - "name": "stream", - "type": "SDL_AudioStream *" - }, - { - "name": "buf", - "type": "const void *" - }, - { - "name": "len", - "type": "int" - }, - { - "name": "callback", - "type": "SDL_AudioStreamDataCompleteCallback" - }, - { - "name": "userdata", - "type": "void *" - } - ] - }, - { - "name": "SDL_PutAudioStreamPlanarData", - "return_type": "bool", - "parameters": [ - { - "name": "stream", - "type": "SDL_AudioStream *" - }, - { - "name": "channel_buffers", - "type": "const void * const *" - }, - { - "name": "num_channels", - "type": "int" - }, - { - "name": "num_samples", - "type": "int" - } - ] - }, { "name": "SDL_GetAudioStreamData", "return_type": "int", diff --git a/json/camera.json b/json/camera.json index 14b234f..e93512e 100644 --- a/json/camera.json +++ b/json/camera.json @@ -27,17 +27,6 @@ "name": "SDL_CAMERA_POSITION_BACK_FACING" } ] - }, - { - "name": "SDL_CameraPermissionState", - "values": [ - { - "name": "SDL_CAMERA_PERMISSION_STATE_PENDING" - }, - { - "name": "SDL_CAMERA_PERMISSION_STATE_APPROVED" - } - ] } ], "structs": [ @@ -72,7 +61,7 @@ { "name": "framerate_denominator", "type": "int", - "comment": "Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds)" + "comment": "Frame rate demoninator ((num / denom) == FPS, (denom / num) == duration in seconds)" } ] } @@ -115,7 +104,7 @@ "return_type": "SDL_CameraSpec **", "parameters": [ { - "name": "instance_id", + "name": "devid", "type": "SDL_CameraID" }, { @@ -160,7 +149,7 @@ }, { "name": "SDL_GetCameraPermissionState", - "return_type": "SDL_CameraPermissionState", + "return_type": "int", "parameters": [ { "name": "camera", diff --git a/json/events.json b/json/events.json index a2aad31..acc1421 100644 --- a/json/events.json +++ b/json/events.json @@ -77,10 +77,6 @@ "name": "SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED", "comment": "Display has changed content scale" }, - { - "name": "SDL_EVENT_DISPLAY_USABLE_BOUNDS_CHANGED", - "comment": "Display has changed usable bounds" - }, { "name": "SDL_EVENT_WINDOW_SHOWN", "value": "0x202", @@ -91,7 +87,8 @@ "comment": "Window has been hidden" }, { - "name": "SDL_EVENT_WINDOW_EXPOSED" + "name": "SDL_EVENT_WINDOW_EXPOSED", + "comment": "Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event" }, { "name": "SDL_EVENT_WINDOW_MOVED", @@ -212,14 +209,6 @@ "name": "SDL_EVENT_TEXT_EDITING_CANDIDATES", "comment": "Keyboard text editing candidates" }, - { - "name": "SDL_EVENT_SCREEN_KEYBOARD_SHOWN", - "comment": "The on-screen keyboard has been shown" - }, - { - "name": "SDL_EVENT_SCREEN_KEYBOARD_HIDDEN", - "comment": "The on-screen keyboard has been hidden" - }, { "name": "SDL_EVENT_MOUSE_MOTION", "value": "0x400", @@ -340,23 +329,10 @@ { "name": "SDL_EVENT_FINGER_CANCELED" }, - { - "name": "SDL_EVENT_PINCH_BEGIN", - "value": "0x710", - "comment": "Pinch gesture started" - }, - { - "name": "SDL_EVENT_PINCH_UPDATE", - "comment": "Pinch gesture updated" - }, - { - "name": "SDL_EVENT_PINCH_END", - "comment": "Pinch gesture ended" - }, { "name": "SDL_EVENT_CLIPBOARD_UPDATE", "value": "0x900", - "comment": "The clipboard changed" + "comment": "The clipboard or primary selection changed" }, { "name": "SDL_EVENT_DROP_FILE", @@ -520,7 +496,7 @@ { "name": "_type", "type": "SDL_EventType", - "comment": "SDL_EVENT_DISPLAY_*" + "comment": "SDL_DISPLAYEVENT_*" }, { "name": "reserved", @@ -976,16 +952,6 @@ "name": "mouse_y", "type": "float", "comment": "Y coordinate, relative to window" - }, - { - "name": "integer_x", - "type": "Sint32", - "comment": "The amount scrolled horizontally, accumulated to whole scroll \"ticks\" (added in 3.2.12)" - }, - { - "name": "integer_y", - "type": "Sint32", - "comment": "The amount scrolled vertically, accumulated to whole scroll \"ticks\" (added in 3.2.12)" } ] }, @@ -1578,35 +1544,6 @@ } ] }, - { - "name": "SDL_PinchFingerEvent", - "fields": [ - { - "name": "_type", - "type": "SDL_EventType", - "comment": "::SDL_EVENT_PINCH_BEGIN or ::SDL_EVENT_PINCH_UPDATE or ::SDL_EVENT_PINCH_END" - }, - { - "name": "reserved", - "type": "Uint32" - }, - { - "name": "timestamp", - "type": "Uint64", - "comment": "In nanoseconds, populated using SDL_GetTicksNS()" - }, - { - "name": "scale", - "type": "float", - "comment": "The scale change since the last SDL_EVENT_PINCH_UPDATE. Scale < 1 is \"zoom out\". Scale > 1 is \"zoom in\"." - }, - { - "name": "windowID", - "type": "SDL_WindowID", - "comment": "The window underneath the finger, if any" - } - ] - }, { "name": "SDL_PenProximityEvent", "fields": [ @@ -1979,7 +1916,7 @@ { "name": "_type", "type": "Uint32", - "comment": "SDL_EVENT_USER through SDL_EVENT_LAST, Uint32 because these are not in the SDL_EventType enumeration" + "comment": "SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration" }, { "name": "reserved", @@ -2167,11 +2104,6 @@ "type": "SDL_TouchFingerEvent", "comment": "Touch finger event data" }, - { - "name": "pinch", - "type": "SDL_PinchFingerEvent", - "comment": "Pinch event data" - }, { "name": "pproximity", "type": "SDL_PenProximityEvent", @@ -2457,24 +2389,6 @@ "type": "const SDL_Event *" } ] - }, - { - "name": "SDL_GetEventDescription", - "return_type": "int", - "parameters": [ - { - "name": "event", - "type": "const SDL_Event *" - }, - { - "name": "buf", - "type": "char *" - }, - { - "name": "buflen", - "type": "int" - } - ] } ] } \ No newline at end of file diff --git a/json/gamepad.json b/json/gamepad.json index a3acc3a..0be43f0 100644 --- a/json/gamepad.json +++ b/json/gamepad.json @@ -42,9 +42,6 @@ { "name": "SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR" }, - { - "name": "SDL_GAMEPAD_TYPE_GAMECUBE" - }, { "name": "SDL_GAMEPAD_TYPE_COUNT" } @@ -108,19 +105,19 @@ }, { "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1", - "comment": "Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button)" + "comment": "Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1)" }, { "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE1", - "comment": "Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button)" + "comment": "Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3)" }, { "name": "SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2", - "comment": "Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button)" + "comment": "Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2)" }, { "name": "SDL_GAMEPAD_BUTTON_LEFT_PADDLE2", - "comment": "Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button)" + "comment": "Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4)" }, { "name": "SDL_GAMEPAD_BUTTON_TOUCHPAD", @@ -132,11 +129,11 @@ }, { "name": "SDL_GAMEPAD_BUTTON_MISC3", - "comment": "Additional button (e.g. Nintendo GameCube left trigger click)" + "comment": "Additional button" }, { "name": "SDL_GAMEPAD_BUTTON_MISC4", - "comment": "Additional button (e.g. Nintendo GameCube right trigger click)" + "comment": "Additional button" }, { "name": "SDL_GAMEPAD_BUTTON_MISC5", diff --git a/json/gpu.json b/json/gpu.json index e0aed6e..b1de6d6 100644 --- a/json/gpu.json +++ b/json/gpu.json @@ -718,7 +718,7 @@ }, { "name": "SDL_GPU_COMPAREOP_GREATER_OR_EQUAL", - "comment": "The comparison evaluates reference >= test." + "comment": "The comparison evalutes reference >= test." }, { "name": "SDL_GPU_COMPAREOP_ALWAYS", @@ -1332,7 +1332,7 @@ { "name": "pitch", "type": "Uint32", - "comment": "The size of a single element + the offset between elements." + "comment": "The byte pitch between consecutive elements of the vertex buffer." }, { "name": "input_rate", @@ -1342,7 +1342,7 @@ { "name": "instance_step_rate", "type": "Uint32", - "comment": "Reserved for future use. Must be set to 0." + "comment": "The number of instances to draw using the same per-instance data before advancing in the instance buffer by one element. Ignored unless input_rate is SDL_GPU_VERTEXINPUTRATE_INSTANCE" } ] }, @@ -1688,17 +1688,16 @@ { "name": "sample_mask", "type": "Uint32", - "comment": "Reserved for future use. Must be set to 0." + "comment": "Determines which samples get updated in the render targets. Treated as 0xFFFFFFFF if enable_mask is false." }, { "name": "enable_mask", "type": "bool", - "comment": "Reserved for future use. Must be set to false." + "comment": "Enables sample masking." }, { - "name": "enable_alpha_to_coverage", - "type": "bool", - "comment": "true enables the alpha-to-coverage feature." + "name": "padding1", + "type": "Uint8" }, { "name": "padding2", @@ -2056,14 +2055,12 @@ "comment": "The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used." }, { - "name": "mip_level", - "type": "Uint8", - "comment": "The mip level to use as the depth stencil target." + "name": "padding1", + "type": "Uint8" }, { - "name": "layer", - "type": "Uint8", - "comment": "The layer index to use as the depth stencil target." + "name": "padding2", + "type": "Uint8" } ] }, @@ -2212,46 +2209,6 @@ "type": "Uint8" } ] - }, - { - "name": "SDL_GPUVulkanOptions", - "fields": [ - { - "name": "vulkan_api_version", - "type": "Uint32", - "comment": "The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION." - }, - { - "name": "feature_list", - "type": "void *", - "comment": "Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)" - }, - { - "name": "vulkan_10_physical_device_features", - "type": "void *", - "comment": "Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features." - }, - { - "name": "device_extension_count", - "type": "Uint32", - "comment": "Number of additional device extensions to require." - }, - { - "name": "device_extension_names", - "type": "const char **", - "comment": "Pointer to a list of additional device extensions to require." - }, - { - "name": "instance_extension_count", - "type": "Uint32", - "comment": "Number of additional instance extensions to require." - }, - { - "name": "instance_extension_names", - "type": "const char **", - "comment": "Pointer to a list of additional instance extensions to require." - } - ] } ], "unions": [], @@ -2494,16 +2451,6 @@ } ] }, - { - "name": "SDL_GetGPUDeviceProperties", - "return_type": "SDL_PropertiesID", - "parameters": [ - { - "name": "device", - "type": "SDL_GPUDevice *" - } - ] - }, { "name": "SDL_CreateGPUComputePipeline", "return_type": "SDL_GPUComputePipeline *", @@ -3942,26 +3889,6 @@ } ] }, - { - "name": "SDL_GetPixelFormatFromGPUTextureFormat", - "return_type": "SDL_PixelFormat", - "parameters": [ - { - "name": "format", - "type": "SDL_GPUTextureFormat" - } - ] - }, - { - "name": "SDL_GetGPUTextureFormatFromPixelFormat", - "return_type": "SDL_GPUTextureFormat", - "parameters": [ - { - "name": "format", - "type": "SDL_PixelFormat" - } - ] - }, { "name": "SDL_GDKSuspendGPU", "return_type": "void", diff --git a/json/haptic.json b/json/haptic.json index 55640bf..4689b58 100644 --- a/json/haptic.json +++ b/json/haptic.json @@ -6,18 +6,6 @@ } ], "typedefs": [ - { - "name": "SDL_HapticEffectType", - "underlying_type": "Uint16" - }, - { - "name": "SDL_HapticDirectionType", - "underlying_type": "Uint8" - }, - { - "name": "SDL_HapticEffectID", - "underlying_type": "int" - }, { "name": "SDL_HapticID", "underlying_type": "Uint32" @@ -32,7 +20,7 @@ "fields": [ { "name": "_type", - "type": "SDL_HapticDirectionType", + "type": "Uint8", "comment": "The type of encoding." }, { @@ -47,7 +35,7 @@ "fields": [ { "name": "_type", - "type": "SDL_HapticEffectType", + "type": "Uint16", "comment": "SDL_HAPTIC_CONSTANT" }, { @@ -237,7 +225,7 @@ "fields": [ { "name": "_type", - "type": "SDL_HapticEffectType", + "type": "Uint16", "comment": "SDL_HAPTIC_RAMP" }, { @@ -302,7 +290,7 @@ "fields": [ { "name": "_type", - "type": "SDL_HapticEffectType", + "type": "Uint16", "comment": "SDL_HAPTIC_LEFTRIGHT" }, { @@ -327,7 +315,7 @@ "fields": [ { "name": "_type", - "type": "SDL_HapticEffectType", + "type": "Uint16", "comment": "SDL_HAPTIC_CUSTOM" }, { @@ -404,7 +392,7 @@ "fields": [ { "name": "_type", - "type": "SDL_HapticEffectType", + "type": "Uint16", "comment": "Effect type." }, { @@ -598,7 +586,7 @@ }, { "name": "SDL_CreateHapticEffect", - "return_type": "SDL_HapticEffectID", + "return_type": "int", "parameters": [ { "name": "haptic", @@ -620,7 +608,7 @@ }, { "name": "effect", - "type": "SDL_HapticEffectID" + "type": "int" }, { "name": "data", @@ -638,7 +626,7 @@ }, { "name": "effect", - "type": "SDL_HapticEffectID" + "type": "int" }, { "name": "iterations", @@ -656,7 +644,7 @@ }, { "name": "effect", - "type": "SDL_HapticEffectID" + "type": "int" } ] }, @@ -670,7 +658,7 @@ }, { "name": "effect", - "type": "SDL_HapticEffectID" + "type": "int" } ] }, @@ -684,7 +672,7 @@ }, { "name": "effect", - "type": "SDL_HapticEffectID" + "type": "int" } ] }, diff --git a/json/init.json b/json/init.json index d315e0e..195912e 100644 --- a/json/init.json +++ b/json/init.json @@ -59,7 +59,7 @@ { "name": "SDL_INIT_JOYSTICK", "value": "(1u << 9)", - "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`" + "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", diff --git a/json/mouse.json b/json/mouse.json index b8bbf8b..838f8af 100644 --- a/json/mouse.json +++ b/json/mouse.json @@ -12,11 +12,7 @@ } ], "function_pointers": [], - "c_type_aliases": [ - { - "name": "SDL_MouseMotionTransformCallback" - } - ], + "c_type_aliases": [], "enums": [ { "name": "SDL_SystemCursor", @@ -120,23 +116,7 @@ ] } ], - "structs": [ - { - "name": "SDL_CursorFrameInfo", - "fields": [ - { - "name": "surface", - "type": "SDL_Surface *", - "comment": "The surface data for this frame" - }, - { - "name": "duration", - "type": "Uint32", - "comment": "The frame duration in milliseconds (a duration of 0 is infinite)" - } - ] - } - ], + "structs": [], "unions": [], "flags": [ { @@ -263,20 +243,6 @@ } ] }, - { - "name": "SDL_SetRelativeMouseTransform", - "return_type": "bool", - "parameters": [ - { - "name": "callback", - "type": "SDL_MouseMotionTransformCallback" - }, - { - "name": "userdata", - "type": "void *" - } - ] - }, { "name": "SDL_SetWindowRelativeMouseMode", "return_type": "bool", @@ -359,28 +325,6 @@ } ] }, - { - "name": "SDL_CreateAnimatedCursor", - "return_type": "SDL_Cursor *", - "parameters": [ - { - "name": "frames", - "type": "SDL_CursorFrameInfo *" - }, - { - "name": "frame_count", - "type": "int" - }, - { - "name": "hot_x", - "type": "int" - }, - { - "name": "hot_y", - "type": "int" - } - ] - }, { "name": "SDL_CreateSystemCursor", "return_type": "SDL_Cursor *", diff --git a/json/pixels.json b/json/pixels.json index b7b9489..3767023 100644 --- a/json/pixels.json +++ b/json/pixels.json @@ -200,11 +200,6 @@ "name": "SDL_PIXELFORMAT_EXTERNAL_OES", "value": "0x2053454fu", "comment": "Android video texture format" - }, - { - "name": "SDL_PIXELFORMAT_MJPG", - "value": "0x47504a4du", - "comment": "Motion JPEG" } ] }, @@ -532,7 +527,7 @@ }, { "name": "SDL_COLORSPACE_YUV_DEFAULT", - "value": "SDL_COLORSPACE_BT601_LIMITED", + "value": "SDL_COLORSPACE_JPEG", "comment": "The default colorspace for YUV surfaces if no colorspace is specified" } ] @@ -858,7 +853,7 @@ "return_type": "void", "parameters": [ { - "name": "pixelvalue", + "name": "pixel", "type": "Uint32" }, { @@ -888,7 +883,7 @@ "return_type": "void", "parameters": [ { - "name": "pixelvalue", + "name": "pixel", "type": "Uint32" }, { diff --git a/json/render.json b/json/render.json index bccb3fb..948b905 100644 --- a/json/render.json +++ b/json/render.json @@ -6,9 +6,6 @@ }, { "name": "SDL_Texture" - }, - { - "name": "SDL_GPURenderState" } ], "typedefs": [], @@ -32,23 +29,6 @@ } ] }, - { - "name": "SDL_TextureAddressMode", - "values": [ - { - "name": "SDL_TEXTURE_ADDRESS_AUTO", - "comment": "Wrapping is enabled if texture coordinates are outside [0, 1], this is the default" - }, - { - "name": "SDL_TEXTURE_ADDRESS_CLAMP", - "comment": "Texture coordinates are clamped to the [0, 1] range" - }, - { - "name": "SDL_TEXTURE_ADDRESS_WRAP", - "comment": "The texture is repeated (tiled)" - } - ] - }, { "name": "SDL_RendererLogicalPresentation", "values": [ @@ -62,7 +42,7 @@ }, { "name": "SDL_LOGICAL_PRESENTATION_LETTERBOX", - "comment": "The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color" + "comment": "The rendered content is fit to the largest dimension and the other dimension is letterboxed with black bars" }, { "name": "SDL_LOGICAL_PRESENTATION_OVERSCAN", @@ -95,51 +75,6 @@ "comment": "Normalized texture coordinates, if needed" } ] - }, - { - "name": "SDL_GPURenderStateCreateInfo", - "fields": [ - { - "name": "fragment_shader", - "type": "SDL_GPUShader *", - "comment": "The fragment shader to use when this render state is active" - }, - { - "name": "num_sampler_bindings", - "type": "Sint32", - "comment": "The number of additional fragment samplers to bind when this render state is active" - }, - { - "name": "sampler_bindings", - "type": "const SDL_GPUTextureSamplerBinding *", - "comment": "Additional fragment samplers to bind when this render state is active" - }, - { - "name": "num_storage_textures", - "type": "Sint32", - "comment": "The number of storage textures to bind when this render state is active" - }, - { - "name": "storage_textures", - "type": "SDL_GPUTexture *const *", - "comment": "Storage textures to bind when this render state is active" - }, - { - "name": "num_storage_buffers", - "type": "Sint32", - "comment": "The number of storage buffers to bind when this render state is active" - }, - { - "name": "storage_buffers", - "type": "SDL_GPUBuffer *const *", - "comment": "Storage buffers to bind when this render state is active" - }, - { - "name": "props", - "type": "SDL_PropertiesID", - "comment": "A properties ID for extensions. Should be 0 if no extensions are needed." - } - ] } ], "unions": [], @@ -214,30 +149,6 @@ } ] }, - { - "name": "SDL_CreateGPURenderer", - "return_type": "SDL_Renderer *", - "parameters": [ - { - "name": "device", - "type": "SDL_GPUDevice *" - }, - { - "name": "window", - "type": "SDL_Window *" - } - ] - }, - { - "name": "SDL_GetGPURendererDevice", - "return_type": "SDL_GPUDevice *", - "parameters": [ - { - "name": "renderer", - "type": "SDL_Renderer *" - } - ] - }, { "name": "SDL_CreateSoftwareRenderer", "return_type": "SDL_Renderer *", @@ -416,30 +327,6 @@ } ] }, - { - "name": "SDL_SetTexturePalette", - "return_type": "bool", - "parameters": [ - { - "name": "texture", - "type": "SDL_Texture *" - }, - { - "name": "palette", - "type": "SDL_Palette *" - } - ] - }, - { - "name": "SDL_GetTexturePalette", - "return_type": "SDL_Palette *", - "parameters": [ - { - "name": "texture", - "type": "SDL_Texture *" - } - ] - }, { "name": "SDL_SetTextureColorMod", "return_type": "bool", @@ -1522,52 +1409,6 @@ } ] }, - { - "name": "SDL_RenderTexture9GridTiled", - "return_type": "bool", - "parameters": [ - { - "name": "renderer", - "type": "SDL_Renderer *" - }, - { - "name": "texture", - "type": "SDL_Texture *" - }, - { - "name": "srcrect", - "type": "const SDL_FRect *" - }, - { - "name": "left_width", - "type": "float" - }, - { - "name": "right_width", - "type": "float" - }, - { - "name": "top_height", - "type": "float" - }, - { - "name": "bottom_height", - "type": "float" - }, - { - "name": "scale", - "type": "float" - }, - { - "name": "dstrect", - "type": "const SDL_FRect *" - }, - { - "name": "tileScale", - "type": "float" - } - ] - }, { "name": "SDL_RenderGeometry", "return_type": "bool", @@ -1652,42 +1493,6 @@ } ] }, - { - "name": "SDL_SetRenderTextureAddressMode", - "return_type": "bool", - "parameters": [ - { - "name": "renderer", - "type": "SDL_Renderer *" - }, - { - "name": "u_mode", - "type": "SDL_TextureAddressMode" - }, - { - "name": "v_mode", - "type": "SDL_TextureAddressMode" - } - ] - }, - { - "name": "SDL_GetRenderTextureAddressMode", - "return_type": "bool", - "parameters": [ - { - "name": "renderer", - "type": "SDL_Renderer *" - }, - { - "name": "u_mode", - "type": "SDL_TextureAddressMode *" - }, - { - "name": "v_mode", - "type": "SDL_TextureAddressMode *" - } - ] - }, { "name": "SDL_RenderReadPixels", "return_type": "SDL_Surface *", @@ -1833,94 +1638,6 @@ "type": "const char *" } ] - }, - { - "name": "SDL_SetDefaultTextureScaleMode", - "return_type": "bool", - "parameters": [ - { - "name": "renderer", - "type": "SDL_Renderer *" - }, - { - "name": "scale_mode", - "type": "SDL_ScaleMode" - } - ] - }, - { - "name": "SDL_GetDefaultTextureScaleMode", - "return_type": "bool", - "parameters": [ - { - "name": "renderer", - "type": "SDL_Renderer *" - }, - { - "name": "scale_mode", - "type": "SDL_ScaleMode *" - } - ] - }, - { - "name": "SDL_CreateGPURenderState", - "return_type": "SDL_GPURenderState *", - "parameters": [ - { - "name": "renderer", - "type": "SDL_Renderer *" - }, - { - "name": "createinfo", - "type": "SDL_GPURenderStateCreateInfo *" - } - ] - }, - { - "name": "SDL_SetGPURenderStateFragmentUniforms", - "return_type": "bool", - "parameters": [ - { - "name": "state", - "type": "SDL_GPURenderState *" - }, - { - "name": "slot_index", - "type": "Uint32" - }, - { - "name": "data", - "type": "const void *" - }, - { - "name": "length", - "type": "Uint32" - } - ] - }, - { - "name": "SDL_SetGPURenderState", - "return_type": "bool", - "parameters": [ - { - "name": "renderer", - "type": "SDL_Renderer *" - }, - { - "name": "state", - "type": "SDL_GPURenderState *" - } - ] - }, - { - "name": "SDL_DestroyGPURenderState", - "return_type": "void", - "parameters": [ - { - "name": "state", - "type": "SDL_GPURenderState *" - } - ] } ] } \ No newline at end of file diff --git a/json/sensor.json b/json/sensor.json index 1ed79d6..32eee8e 100644 --- a/json/sensor.json +++ b/json/sensor.json @@ -49,9 +49,6 @@ { "name": "SDL_SENSOR_GYRO_R", "comment": "Gyroscope for right Joy-Con controller" - }, - { - "name": "SDL_SENSOR_COUNT" } ] } diff --git a/json/surface.json b/json/surface.json index 642658e..1098970 100644 --- a/json/surface.json +++ b/json/surface.json @@ -19,9 +19,6 @@ { "name": "SDL_SCALEMODE_LINEAR", "comment": "linear filtering" - }, - { - "name": "SDL_SCALEMODE_PIXELART" } ] }, @@ -39,11 +36,6 @@ { "name": "SDL_FLIP_VERTICAL", "comment": "flip vertically" - }, - { - "name": "SDL_FLIP_HORIZONTAL_AND_VERTICAL", - "value": "(SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL)", - "comment": "flip horizontally and vertically (not a diagonal flip)" } ] } @@ -269,30 +261,6 @@ } ] }, - { - "name": "SDL_LoadSurface_IO", - "return_type": "SDL_Surface *", - "parameters": [ - { - "name": "src", - "type": "SDL_IOStream *" - }, - { - "name": "closeio", - "type": "bool" - } - ] - }, - { - "name": "SDL_LoadSurface", - "return_type": "SDL_Surface *", - "parameters": [ - { - "name": "file", - "type": "const char *" - } - ] - }, { "name": "SDL_LoadBMP_IO", "return_type": "SDL_Surface *", @@ -349,62 +317,6 @@ } ] }, - { - "name": "SDL_LoadPNG_IO", - "return_type": "SDL_Surface *", - "parameters": [ - { - "name": "src", - "type": "SDL_IOStream *" - }, - { - "name": "closeio", - "type": "bool" - } - ] - }, - { - "name": "SDL_LoadPNG", - "return_type": "SDL_Surface *", - "parameters": [ - { - "name": "file", - "type": "const char *" - } - ] - }, - { - "name": "SDL_SavePNG_IO", - "return_type": "bool", - "parameters": [ - { - "name": "surface", - "type": "SDL_Surface *" - }, - { - "name": "dst", - "type": "SDL_IOStream *" - }, - { - "name": "closeio", - "type": "bool" - } - ] - }, - { - "name": "SDL_SavePNG", - "return_type": "bool", - "parameters": [ - { - "name": "surface", - "type": "SDL_Surface *" - }, - { - "name": "file", - "type": "const char *" - } - ] - }, { "name": "SDL_SetSurfaceRLE", "return_type": "bool", @@ -613,20 +525,6 @@ } ] }, - { - "name": "SDL_RotateSurface", - "return_type": "SDL_Surface *", - "parameters": [ - { - "name": "surface", - "type": "SDL_Surface *" - }, - { - "name": "angle", - "type": "float" - } - ] - }, { "name": "SDL_DuplicateSurface", "return_type": "SDL_Surface *", @@ -1009,32 +907,6 @@ } ] }, - { - "name": "SDL_StretchSurface", - "return_type": "bool", - "parameters": [ - { - "name": "src", - "type": "SDL_Surface *" - }, - { - "name": "srcrect", - "type": "const SDL_Rect *" - }, - { - "name": "dst", - "type": "SDL_Surface *" - }, - { - "name": "dstrect", - "type": "const SDL_Rect *" - }, - { - "name": "scaleMode", - "type": "SDL_ScaleMode" - } - ] - }, { "name": "SDL_BlitSurfaceTiled", "return_type": "bool", diff --git a/json/video.json b/json/video.json index 8f81cca..a9e23a5 100644 --- a/json/video.json +++ b/json/video.json @@ -129,54 +129,24 @@ } ] }, - { - "name": "SDL_ProgressState", - "values": [ - { - "name": "SDL_PROGRESS_STATE_INVALID", - "value": "-1", - "comment": "An invalid progress state indicating an error; check SDL_GetError()" - }, - { - "name": "SDL_PROGRESS_STATE_NONE", - "comment": "No progress bar is shown" - }, - { - "name": "SDL_PROGRESS_STATE_INDETERMINATE", - "comment": "The progress bar is shown in a indeterminate state" - }, - { - "name": "SDL_PROGRESS_STATE_NORMAL", - "comment": "The progress bar is shown in a normal state" - }, - { - "name": "SDL_PROGRESS_STATE_PAUSED", - "comment": "The progress bar is shown in a paused state" - }, - { - "name": "SDL_PROGRESS_STATE_ERROR", - "comment": "The progress bar is shown in a state indicating the application had an error" - } - ] - }, { "name": "SDL_GLAttr", "values": [ { "name": "SDL_GL_RED_SIZE", - "comment": "the minimum number of bits for the red channel of the color buffer; defaults to 8." + "comment": "the minimum number of bits for the red channel of the color buffer; defaults to 3." }, { "name": "SDL_GL_GREEN_SIZE", - "comment": "the minimum number of bits for the green channel of the color buffer; defaults to 8." + "comment": "the minimum number of bits for the green channel of the color buffer; defaults to 3." }, { "name": "SDL_GL_BLUE_SIZE", - "comment": "the minimum number of bits for the blue channel of the color buffer; defaults to 8." + "comment": "the minimum number of bits for the blue channel of the color buffer; defaults to 2." }, { "name": "SDL_GL_ALPHA_SIZE", - "comment": "the minimum number of bits for the alpha channel of the color buffer; defaults to 8." + "comment": "the minimum number of bits for the alpha channel of the color buffer; defaults to 0." }, { "name": "SDL_GL_BUFFER_SIZE", @@ -252,7 +222,7 @@ }, { "name": "SDL_GL_FRAMEBUFFER_SRGB_CAPABLE", - "comment": "requests sRGB-capable visual if 1. Defaults to -1 (\"don't care\"). This is a request; GL drivers might not comply!" + "comment": "requests sRGB capable visual; defaults to 0." }, { "name": "SDL_GL_CONTEXT_RELEASE_BEHAVIOR", @@ -482,11 +452,6 @@ "value": "(1u << 20)", "comment": "window has grabbed keyboard input" }, - { - "name": "SDL_WINDOW_FILL_DOCUMENT", - "value": "(1u << 21)", - "comment": "window is in fill-document mode (Emscripten only), since SDL 3.4.0" - }, { "name": "SDL_WINDOW_VULKAN", "value": "(1u << 28)", @@ -1231,20 +1196,6 @@ } ] }, - { - "name": "SDL_SetWindowFillDocument", - "return_type": "bool", - "parameters": [ - { - "name": "window", - "type": "SDL_Window *" - }, - { - "name": "fill", - "type": "bool" - } - ] - }, { "name": "SDL_ShowWindow", "return_type": "bool", @@ -1622,54 +1573,6 @@ } ] }, - { - "name": "SDL_SetWindowProgressState", - "return_type": "bool", - "parameters": [ - { - "name": "window", - "type": "SDL_Window *" - }, - { - "name": "state", - "type": "SDL_ProgressState" - } - ] - }, - { - "name": "SDL_GetWindowProgressState", - "return_type": "SDL_ProgressState", - "parameters": [ - { - "name": "window", - "type": "SDL_Window *" - } - ] - }, - { - "name": "SDL_SetWindowProgressValue", - "return_type": "bool", - "parameters": [ - { - "name": "window", - "type": "SDL_Window *" - }, - { - "name": "value", - "type": "float" - } - ] - }, - { - "name": "SDL_GetWindowProgressValue", - "return_type": "float", - "parameters": [ - { - "name": "window", - "type": "SDL_Window *" - } - ] - }, { "name": "SDL_DestroyWindow", "return_type": "void",