Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,36 @@ jobs:
cargo build --examples --features "${CI_BUILD_FEATURES} ${{matrix.feature}}" ${{matrix.build_mode}}
cargo test --features "${CI_BUILD_FEATURES} ${{matrix.feature}}" ${{matrix.build_mode}}

build-bindgen:
name: build and generate bindings
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Install dependencies
if: runner.os == 'Linux'
run: sudo apt install libx11-dev libxext-dev
- name: Build SDL2
shell: bash
env:
RUSTFLAGS: "--cfg update_pregenerated_bindings"
# CI_BUILD_FEATURES: "mixer,ttf,gfx,image,use-bindgen,bundled"
CI_BUILD_FEATURES: "use-bindgen,bundled"
RUST_TEST_THREADS: 1
run: |
set -xeuo pipefail
rustc --version
cargo --version
cargo build --features "${CI_BUILD_FEATURES}"
cargo build --examples --features "${CI_BUILD_FEATURES}"
cargo test --features "${CI_BUILD_FEATURES}"
# dump generated bindings
git add sdl2-sys/bindings/
git diff --cached

build-linux:
name: build linux pkg-config
runs-on: ubuntu-24.04
Expand Down
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ when upgrading from a version of rust-sdl2 to another.

### v0.39.0

[PR #1516](https://github.com/Rust-SDL2/rust-sdl2/pull/1516) **BREAKING CHANGE** Add pregenerated bindings for Windows and Mac OS, clean bindings (remove unused aliases to integer types), update bindings.

[PR #1507](https://github.com/Rust-SDL2/rust-sdl2/pull/1507) **BREAKING CHANGE** Add binding for `SDL_ComposeCustomBlendMode`. This should only be a breaking change for users relying on internal details of `BlendMode` and `SDL_BlendMode`.

[PR #1510](https://github.com/Rust-SDL2/rust-sdl2/pull/1510) Fix clippy warnings.
Expand Down
5 changes: 2 additions & 3 deletions sdl2-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ categories = ["rendering","external-ffi-bindings","game-engines","multimedia"]
license = "MIT AND Zlib"
links = "SDL2"
build = "build.rs"
edition = "2018"
edition = "2021"

[lib]
name = "sdl2_sys"
Expand Down Expand Up @@ -41,7 +41,6 @@ optional = true

[build-dependencies]
version-compare = "0.1"
cfg-if = "^1.0"

[features]

Expand All @@ -59,4 +58,4 @@ ttf = []
gfx = []

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(mac_framework)','cfg(ios_framework)'] }
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(mac_framework)','cfg(ios_framework)','cfg(update_pregenerated_bindings)'] }
9,319 changes: 9,319 additions & 0 deletions sdl2-sys/bindings/aarch64-apple-darwin/sdl_bindings.rs

Large diffs are not rendered by default.

9,383 changes: 9,383 additions & 0 deletions sdl2-sys/bindings/x86_64-pc-windows-msvc/sdl_bindings.rs

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/* automatically generated by rust-bindgen 0.72.1 */

#[allow(unused)]
use crate::*;

pub const FPS_UPPER_LIMIT: u32 = 200;
pub const FPS_LOWER_LIMIT: u32 = 1;
pub const FPS_DEFAULT: u32 = 30;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct FPSmanager {
pub framecount: Uint32,
pub rateticks: f32,
pub baseticks: Uint32,
pub lastticks: Uint32,
pub rate: Uint32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of FPSmanager"][::core::mem::size_of::<FPSmanager>() - 20usize];
["Alignment of FPSmanager"][::core::mem::align_of::<FPSmanager>() - 4usize];
["Offset of field: FPSmanager::framecount"]
[::core::mem::offset_of!(FPSmanager, framecount) - 0usize];
["Offset of field: FPSmanager::rateticks"]
[::core::mem::offset_of!(FPSmanager, rateticks) - 4usize];
["Offset of field: FPSmanager::baseticks"]
[::core::mem::offset_of!(FPSmanager, baseticks) - 8usize];
["Offset of field: FPSmanager::lastticks"]
[::core::mem::offset_of!(FPSmanager, lastticks) - 12usize];
["Offset of field: FPSmanager::rate"][::core::mem::offset_of!(FPSmanager, rate) - 16usize];
};
unsafe extern "C" {
pub fn SDL_initFramerate(manager: *mut FPSmanager);
}
unsafe extern "C" {
pub fn SDL_setFramerate(manager: *mut FPSmanager, rate: Uint32) -> libc::c_int;
}
unsafe extern "C" {
pub fn SDL_getFramerate(manager: *mut FPSmanager) -> libc::c_int;
}
unsafe extern "C" {
pub fn SDL_getFramecount(manager: *mut FPSmanager) -> libc::c_int;
}
unsafe extern "C" {
pub fn SDL_framerateDelay(manager: *mut FPSmanager) -> Uint32;
}
Original file line number Diff line number Diff line change
@@ -1,174 +1,177 @@
/* automatically generated by rust-bindgen */
/* automatically generated by rust-bindgen 0.72.1 */

extern "C" {
#[allow(unused)]
use crate::*;

unsafe extern "C" {
pub fn SDL_imageFilterMMXdetect() -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterMMXoff();
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterMMXon();
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterAdd(
Src1: *mut libc::c_uchar,
Src2: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterMean(
Src1: *mut libc::c_uchar,
Src2: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterSub(
Src1: *mut libc::c_uchar,
Src2: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterAbsDiff(
Src1: *mut libc::c_uchar,
Src2: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterMult(
Src1: *mut libc::c_uchar,
Src2: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterMultNor(
Src1: *mut libc::c_uchar,
Src2: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterMultDivby2(
Src1: *mut libc::c_uchar,
Src2: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterMultDivby4(
Src1: *mut libc::c_uchar,
Src2: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterBitAnd(
Src1: *mut libc::c_uchar,
Src2: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterBitOr(
Src1: *mut libc::c_uchar,
Src2: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterDiv(
Src1: *mut libc::c_uchar,
Src2: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterBitNegation(
Src1: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterAddByte(
Src1: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
C: libc::c_uchar,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterAddUint(
Src1: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
C: libc::c_uint,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterAddByteToHalf(
Src1: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
C: libc::c_uchar,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterSubByte(
Src1: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
C: libc::c_uchar,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterSubUint(
Src1: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
C: libc::c_uint,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterShiftRight(
Src1: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
N: libc::c_uchar,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterShiftRightUint(
Src1: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
N: libc::c_uchar,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterMultByByte(
Src1: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
C: libc::c_uchar,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterShiftRightAndMultByByte(
Src1: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
Expand All @@ -177,39 +180,39 @@ extern "C" {
C: libc::c_uchar,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterShiftLeftByte(
Src1: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
N: libc::c_uchar,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterShiftLeftUint(
Src1: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
N: libc::c_uchar,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterShiftLeft(
Src1: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
N: libc::c_uchar,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterBinarizeUsingThreshold(
Src1: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
length: libc::c_uint,
T: libc::c_uchar,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterClipToRange(
Src1: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
Expand All @@ -218,7 +221,7 @@ extern "C" {
Tmax: libc::c_uchar,
) -> libc::c_int;
}
extern "C" {
unsafe extern "C" {
pub fn SDL_imageFilterNormalizeLinear(
Src: *mut libc::c_uchar,
Dest: *mut libc::c_uchar,
Expand Down
Loading
Loading