emoon / bgfx-sys

Rust FFI bindings for bgfx
MIT License
5 stars 5 forks source link

Update bgfx to latest and fix Emscripten compilation #7

Closed tritao closed 1 year ago

tritao commented 1 year ago

As the PR title says, updates bgfx to latest.

The Emscripten compilation was previously failing with latest Emscripten SDK, something to do with ftello64.

Now it works.

The diff on the FFI generated code is quite big because it looks like bindgenchanged the defaults when it comes to doc comment generation.

tritao commented 1 year ago

After some more testing with bgfx-rs, this update causes some new warnings:

warning: `extern` block uses type `u128`, which is not FFI-safe
   --> bgfx-sys/src/./ffi.rs:682:10
    |
682 |     ) -> u128;
    |          ^^^^ not FFI-safe
    |
    = note: 128-bit integers don't currently have a known stable ABI
    = note: `#[warn(improper_ctypes)]` on by default

warning: `extern` block uses type `u128`, which is not FFI-safe
    --> bgfx-sys/src/./ffi.rs:1281:18
     |
1281 |         __value: u128,
     |                  ^^^^ not FFI-safe
     |
     = note: 128-bit integers don't currently have a known stable ABI

warning: `extern` block uses type `u128`, which is not FFI-safe
    --> bgfx-sys/src/./ffi.rs:1289:18
     |
1289 |         __value: u128,
     |                  ^^^^ not FFI-safe
     |
     = note: 128-bit integers don't currently have a known stable ABI

warning: `extern` block uses type `u128`, which is not FFI-safe
    --> bgfx-sys/src/./ffi.rs:1297:18
     |
1297 |         __value: u128,
     |                  ^^^^ not FFI-safe
     |
     = note: 128-bit integers don't currently have a known stable ABI

warning: `extern` block uses type `u128`, which is not FFI-safe
    --> bgfx-sys/src/./ffi.rs:1324:18
     |
1324 |         __value: u128,
     |                  ^^^^ not FFI-safe
     |
     = note: 128-bit integers don't currently have a known stable ABI

warning: `extern` block uses type `u128`, which is not FFI-safe
    --> bgfx-sys/src/./ffi.rs:1334:18
     |
1334 |         __value: u128,
     |                  ^^^^ not FFI-safe
     |
     = note: 128-bit integers don't currently have a known stable ABI

Removed those to avoid the warnings.

tritao commented 1 year ago

GLX context code was also removed from upstream: https://github.com/bkaradzic/bgfx/commit/b74da5c643fed874df8adab758ca4ac90b152fb0

Replaced with EGL.

tritao commented 1 year ago

GL context for macOS/iOS was also removed from upstream: https://github.com/bkaradzic/bgfx/commit/928800feab95d7bc3f4680d91c3e4754c852d783

Removed it, hopefully this fixes macOS build.

emoon commented 1 year ago

Awesome! Thanks for the work :)

I will make sure to release a new version of the crate on Monday as I'm out traveling during the weekend.

tritao commented 1 year ago

Thanks a lot for the fast review and merges.