Skip to content

Commit

Permalink
update SDL to 3.1.6-preview-545-gf2074d7af
Browse files Browse the repository at this point in the history
  • Loading branch information
maia-s committed Jan 1, 2025
1 parent a1b4a0a commit 44796c6
Show file tree
Hide file tree
Showing 13 changed files with 279 additions and 31 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdl3-src/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sdl3-src"
version = "3.1.6-preview-508-g2d91f096c"
version = "3.1.6-preview-545-gf2074d7af"
edition = "2021"
authors = ["SDL developers"]
license = "Zlib"
Expand Down
2 changes: 1 addition & 1 deletion sdl3-src/SDL
Submodule SDL updated 1104 files
6 changes: 3 additions & 3 deletions sdl3-src/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub const SOURCE_DIR: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/SDL");
pub const SOURCE_DIR: &str = concat!(env!("CARGO_MANIFEST_DIR"), "\\SDL");

/// Revision
pub const REVISION: &str = "SDL3-preview-3.1.6-508-g2d91f096c";
pub const REVISION: &str = "SDL3-preview-3.1.6-545-gf2074d7af";

/// Version part of the revision
pub const VERSION: &str = "3.1.6";
Expand All @@ -20,7 +20,7 @@ pub const REVISION_TAG: &str = "preview-3.1.6";
pub const REVISION_TAG_BASE: &str = "preview";

/// Offset from tag part of the revision
pub const REVISION_OFFSET: &str = "508";
pub const REVISION_OFFSET: &str = "545";

/// Hash part of the revision
pub const REVISION_HASH: &str = "g2d91f096c";
pub const REVISION_HASH: &str = "gf2074d7af";
4 changes: 2 additions & 2 deletions sdl3-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sdl3-sys"
version = "0.2.0+SDL3-preview-3.1.6-508-g2d91f096c"
version = "0.2.0+SDL3-preview-3.1.6-545-gf2074d7af"
edition = "2021"
authors = ["Maia S. R."]
license = "Zlib"
Expand Down Expand Up @@ -105,7 +105,7 @@ version = "0.1.2"
optional = true

[build-dependencies.sdl3-src]
version = "3.1.6-preview-508-g2d91f096c"
version = "3.1.6-preview-545-gf2074d7af"
path = "../sdl3-src"
optional = true

Expand Down
2 changes: 1 addition & 1 deletion sdl3-sys/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# sdl3-sys: Low level Rust bindings for SDL 3

This version of `sdl3-sys` has bindings for SDL version `3.1.6-preview-508-g2d91f096c` and earlier.
This version of `sdl3-sys` has bindings for SDL version `3.1.6-preview-545-gf2074d7af` and earlier.

SDL 3 is ABI stable as of the 3.1.3 preview release, but `sdl3-sys` is new
and may have bugs. Please submit an issue at github if you have any issues
Expand Down
12 changes: 6 additions & 6 deletions sdl3-sys/src/generated/asyncio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ pub const SDL_ASYNCIO_TASK_CLOSE: SDL_AsyncIOTaskType = SDL_AsyncIOTaskType::CLO
/// | ------------------- | --------------- | ----------- |
/// | [`COMPLETE`](SDL_AsyncIOResult::COMPLETE) | [`SDL_ASYNCIO_COMPLETE`] | request was completed without error |
/// | [`FAILURE`](SDL_AsyncIOResult::FAILURE) | [`SDL_ASYNCIO_FAILURE`] | request failed for some reason; check [`SDL_GetError()`]! |
/// | [`CANCELLED`](SDL_AsyncIOResult::CANCELLED) | [`SDL_ASYNCIO_CANCELLED`] | request was cancelled before completing. |
/// | [`CANCELED`](SDL_AsyncIOResult::CANCELED) | [`SDL_ASYNCIO_CANCELED`] | request was canceled before completing. |
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct SDL_AsyncIOResult(pub ::core::ffi::c_int);
Expand All @@ -156,7 +156,7 @@ impl ::core::fmt::Debug for SDL_AsyncIOResult {
f.write_str(match *self {
Self::COMPLETE => "SDL_ASYNCIO_COMPLETE",
Self::FAILURE => "SDL_ASYNCIO_FAILURE",
Self::CANCELLED => "SDL_ASYNCIO_CANCELLED",
Self::CANCELED => "SDL_ASYNCIO_CANCELED",

_ => return write!(f, "SDL_AsyncIOResult({})", self.0),
})
Expand All @@ -168,16 +168,16 @@ impl SDL_AsyncIOResult {
pub const COMPLETE: Self = Self(0);
/// request failed for some reason; check [`SDL_GetError()`]!
pub const FAILURE: Self = Self(1);
/// request was cancelled before completing.
pub const CANCELLED: Self = Self(2);
/// request was canceled before completing.
pub const CANCELED: Self = Self(2);
}

/// request was completed without error
pub const SDL_ASYNCIO_COMPLETE: SDL_AsyncIOResult = SDL_AsyncIOResult::COMPLETE;
/// request failed for some reason; check [`SDL_GetError()`]!
pub const SDL_ASYNCIO_FAILURE: SDL_AsyncIOResult = SDL_AsyncIOResult::FAILURE;
/// request was cancelled before completing.
pub const SDL_ASYNCIO_CANCELLED: SDL_AsyncIOResult = SDL_AsyncIOResult::CANCELLED;
/// request was canceled before completing.
pub const SDL_ASYNCIO_CANCELED: SDL_AsyncIOResult = SDL_AsyncIOResult::CANCELED;

/// Information about a completed asynchronous I/O request.
///
Expand Down
2 changes: 1 addition & 1 deletion sdl3-sys/src/generated/clipboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ extern "C" {
callback: SDL_ClipboardDataCallback,
cleanup: SDL_ClipboardCleanupCallback,
userdata: *mut ::core::ffi::c_void,
mime_types: *mut *const ::core::ffi::c_char,
mime_types: *const *const ::core::ffi::c_char,
num_mime_types: ::core::primitive::usize,
) -> ::core::primitive::bool;
}
Expand Down
8 changes: 6 additions & 2 deletions sdl3-sys/src/generated/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ use super::video::*;
/// | [`FINGER_DOWN`](SDL_EventType::FINGER_DOWN) | [`SDL_EVENT_FINGER_DOWN`] | |
/// | [`FINGER_UP`](SDL_EventType::FINGER_UP) | [`SDL_EVENT_FINGER_UP`] | |
/// | [`FINGER_MOTION`](SDL_EventType::FINGER_MOTION) | [`SDL_EVENT_FINGER_MOTION`] | |
/// | [`FINGER_CANCELED`](SDL_EventType::FINGER_CANCELED) | [`SDL_EVENT_FINGER_CANCELED`] | |
/// | [`CLIPBOARD_UPDATE`](SDL_EventType::CLIPBOARD_UPDATE) | [`SDL_EVENT_CLIPBOARD_UPDATE`] | The clipboard or primary selection changed |
/// | [`DROP_FILE`](SDL_EventType::DROP_FILE) | [`SDL_EVENT_DROP_FILE`] | The system requests a file open |
/// | [`DROP_TEXT`](SDL_EventType::DROP_TEXT) | [`SDL_EVENT_DROP_TEXT`] | text/plain drag-and-drop event |
Expand Down Expand Up @@ -279,6 +280,7 @@ impl ::core::fmt::Debug for SDL_EventType {
Self::FINGER_DOWN => "SDL_EVENT_FINGER_DOWN",
Self::FINGER_UP => "SDL_EVENT_FINGER_UP",
Self::FINGER_MOTION => "SDL_EVENT_FINGER_MOTION",
Self::FINGER_CANCELED => "SDL_EVENT_FINGER_CANCELED",
Self::CLIPBOARD_UPDATE => "SDL_EVENT_CLIPBOARD_UPDATE",
Self::DROP_FILE => "SDL_EVENT_DROP_FILE",
Self::DROP_TEXT => "SDL_EVENT_DROP_TEXT",
Expand Down Expand Up @@ -496,6 +498,7 @@ impl SDL_EventType {
pub const FINGER_DOWN: Self = Self(0x700);
pub const FINGER_UP: Self = Self(1793);
pub const FINGER_MOTION: Self = Self(1794);
pub const FINGER_CANCELED: Self = Self(1795);
/// The clipboard or primary selection changed
pub const CLIPBOARD_UPDATE: Self = Self(0x900);
/// The system requests a file open
Expand Down Expand Up @@ -748,6 +751,7 @@ pub const SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED: SDL_EventType =
pub const SDL_EVENT_FINGER_DOWN: SDL_EventType = SDL_EventType::FINGER_DOWN;
pub const SDL_EVENT_FINGER_UP: SDL_EventType = SDL_EventType::FINGER_UP;
pub const SDL_EVENT_FINGER_MOTION: SDL_EventType = SDL_EventType::FINGER_MOTION;
pub const SDL_EVENT_FINGER_CANCELED: SDL_EventType = SDL_EventType::FINGER_CANCELED;
/// The clipboard or primary selection changed
pub const SDL_EVENT_CLIPBOARD_UPDATE: SDL_EventType = SDL_EventType::CLIPBOARD_UPDATE;
/// The system requests a file open
Expand Down Expand Up @@ -1463,7 +1467,7 @@ pub struct SDL_RenderEvent {
#[derive(Clone, Copy)]
#[cfg_attr(feature = "debug-impls", derive(Debug))]
pub struct SDL_TouchFingerEvent {
/// [`SDL_EVENT_FINGER_MOTION`] or [`SDL_EVENT_FINGER_DOWN`] or [`SDL_EVENT_FINGER_UP`]
/// [`SDL_EVENT_FINGER_DOWN`], [`SDL_EVENT_FINGER_UP`], [`SDL_EVENT_FINGER_MOTION`], or [`SDL_EVENT_FINGER_CANCELED`]
pub r#type: SDL_EventType,
pub reserved: Uint32,
/// In nanoseconds, populated using [`SDL_GetTicksNS()`]
Expand Down Expand Up @@ -1684,7 +1688,7 @@ pub struct SDL_ClipboardEvent {
/// are we owning the clipboard (internal update)
pub owner: ::core::primitive::bool,
/// number of mime types
pub n_mime_types: Sint32,
pub num_mime_types: Sint32,
/// current mime types
pub mime_types: *mut *const ::core::ffi::c_char,
}
Expand Down
57 changes: 49 additions & 8 deletions sdl3-sys/src/generated/gpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,29 @@
//! [here](https://github.com/TheSpydog/SDL_gpu_examples)
//! .
//!
//! ## Performance considerations
//!
//! Here are some basic tips for maximizing your rendering performance.
//!
//! - Beginning a new render pass is relatively expensive. Use as few render
//! passes as you can.
//! - Minimize the amount of state changes. For example, binding a pipeline is
//! relatively cheap, but doing it hundreds of times when you don't need to
//! will slow the performance significantly.
//! - Perform your data uploads as early as possible in the frame.
//! - Don't churn resources. Creating and releasing resources is expensive.
//! It's better to create what you need up front and cache it.
//! - Don't use uniform buffers for large amounts of data (more than a matrix
//! or so). Use a storage buffer instead.
//! - Use cycling correctly. There is a detailed explanation of cycling further
//! below.
//! - Use culling techniques to minimize pixel writes. The less writing the GPU
//! has to do the better. Culling can be a very advanced topic but even
//! simple culling techniques can boost performance significantly.
//!
//! In general try to remember the golden rule of performance: doing things is
//! more expensive than not doing things. Don't Touch The Driver!
//!
//! ## FAQ
//!
//! **Question: When are you adding more advanced features, like ray tracing or
Expand All @@ -148,6 +171,16 @@
//! reflection to extract the required information from the shader
//! automatically instead of manually filling in the struct's values.
//!
//! **Question: My application isn't performing very well. Is this the GPU
//! API's fault?**
//!
//! Answer: No. Long answer: The GPU API is a relatively thin layer over the
//! underlying graphics API. While it's possible that we have done something
//! inefficiently, it's very unlikely especially if you are relatively
//! inexperienced with GPU rendering. Please see the performance tips above and
//! make sure you are following them. Additionally, tools like RenderDoc can be
//! very helpful for diagnosing incorrect behavior and performance issues.
//!
//! ## System Requirements
//!
//! **Vulkan:** Supported on Windows, Linux, Nintendo Switch, and certain
Expand Down Expand Up @@ -2866,8 +2899,10 @@ pub struct SDL_GPUBufferRegion {
///
/// Note that the `first_vertex` and `first_instance` parameters are NOT
/// compatible with built-in vertex/instance ID variables in shaders (for
/// example, SV_VertexID). If your shader depends on these variables, the
/// correlating draw call parameter MUST be 0.
/// example, SV_VertexID); GPU APIs and shader languages do not define these
/// built-in variables consistently, so if your shader depends on them, the
/// only way to keep behavior consistent and portable is to always pass 0 for
/// the correlating parameter in the draw calls.
///
/// ### Availability
/// This struct is available since SDL 3.1.3
Expand All @@ -2892,8 +2927,10 @@ pub struct SDL_GPUIndirectDrawCommand {
///
/// Note that the `first_vertex` and `first_instance` parameters are NOT
/// compatible with built-in vertex/instance ID variables in shaders (for
/// example, SV_VertexID). If your shader depends on these variables, the
/// correlating draw call parameter MUST be 0.
/// example, SV_VertexID); GPU APIs and shader languages do not define these
/// built-in variables consistently, so if your shader depends on them, the
/// only way to keep behavior consistent and portable is to always pass 0 for
/// the correlating parameter in the draw calls.
///
/// ### Availability
/// This struct is available since SDL 3.1.3
Expand Down Expand Up @@ -4845,8 +4882,10 @@ extern "C" {
///
/// Note that the `first_vertex` and `first_instance` parameters are NOT
/// compatible with built-in vertex/instance ID variables in shaders (for
/// example, SV_VertexID). If your shader depends on these variables, the
/// correlating draw call parameter MUST be 0.
/// example, SV_VertexID); GPU APIs and shader languages do not define these
/// built-in variables consistently, so if your shader depends on them, the
/// only way to keep behavior consistent and portable is to always pass 0 for
/// the correlating parameter in the draw calls.
///
/// ### Parameters
/// - `render_pass`: a render pass handle.
Expand Down Expand Up @@ -4876,8 +4915,10 @@ extern "C" {
///
/// Note that the `first_vertex` and `first_instance` parameters are NOT
/// compatible with built-in vertex/instance ID variables in shaders (for
/// example, SV_VertexID). If your shader depends on these variables, the
/// correlating draw call parameter MUST be 0.
/// example, SV_VertexID); GPU APIs and shader languages do not define these
/// built-in variables consistently, so if your shader depends on them, the
/// only way to keep behavior consistent and portable is to always pass 0 for
/// the correlating parameter in the draw calls.
///
/// ### Parameters
/// - `render_pass`: a render pass handle.
Expand Down
12 changes: 10 additions & 2 deletions sdl3-sys/src/generated/hints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2337,13 +2337,21 @@ pub const SDL_HINT_MAC_SCROLL_MOMENTUM: *const ::core::ffi::c_char =

/// Request [`SDL_AppIterate()`] be called at a specific rate.
///
/// This number is in Hz, so "60" means try to iterate 60 times per second.
/// If this is set to a number, it represents Hz, so "60" means try to iterate
/// 60 times per second. "0" means to iterate as fast as possible. Negative
/// values are illegal, but reserved, in case they are useful in a future
/// revision of SDL.
///
/// There are other strings that have special meaning. If set to "waitevent",
/// [`SDL_AppIterate`] will not be called until new event(s) have arrived (and been
/// processed by [`SDL_AppEvent`]). This can be useful for apps that are completely
/// idle except in response to input.
///
/// On some platforms, or if you are using [`SDL_main`] instead of [`SDL_AppIterate`],
/// this hint is ignored. When the hint can be used, it is allowed to be
/// changed at any time.
///
/// This defaults to 60, and specifying NULL for the hint's value will restore
/// This defaults to 0, and specifying NULL for the hint's value will restore
/// the default.
///
/// This hint can be set anytime.
Expand Down
2 changes: 1 addition & 1 deletion sdl3-sys/src/generated/revision.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ apply_cfg!(#[cfg(doc)] => {
});

apply_cfg!(#[cfg(not(doc))] => {
pub const SDL_REVISION: *const ::core::ffi::c_char = c"SDL3-preview-3.1.6-508-g2d91f096c".as_ptr();
pub const SDL_REVISION: *const ::core::ffi::c_char = c"SDL3-preview-3.1.6-545-gf2074d7af".as_ptr();

});

Expand Down
Loading

0 comments on commit 44796c6

Please sign in to comment.