tomassedovic / tcod-rs

Rust bindings for libtcod 1.6.3 (the Doryen library/roguelike toolkit)
Do What The F*ck You Want To Public License
228 stars 45 forks source link

Fix SDL2 rendering in Mojave #270

Closed rjungemann closed 5 years ago

rjungemann commented 6 years ago

Related to https://github.com/tomassedovic/tcod-rs/issues/267

Basically, SDL2 on OS X requires you to SDL_PumpEvents() before setting the window size, otherwise you get a blank screen until it receives an event, such as a keyboard event or window resize event.

See also: https://discourse.libsdl.org/t/macos-10-14-mojave-issues/25060

L3nn0x commented 6 years ago

Thanks! I'm wondering if it wouldn't be better to make the PR on libtcod directly: https://bitbucket.org/libtcod/libtcod/overview

Tell me if you want to do this and I'll update the repo with the latest libtcod.

rjungemann commented 6 years ago

Oof I've never delved into BitBucket/Mercurial but I'll give it a shot.

L3nn0x commented 6 years ago

Cool! I'll wait for your return then

rjungemann commented 6 years ago

@L3nn0x this will get fixed once SDL2 2.0.10 is out but I'll try and figure out how to make the change over at the tcod repo.

L3nn0x commented 5 years ago

Will it fix the pump event problem as well? If yes, you don't need to update tcod I'll just update the sdl version we link against.

tomassedovic commented 5 years ago

I'm happy to merge this to help unblock people experiencing these issues.

@rjungemann are you okay with that? It's been several months so I'm basically just checking in to see if you're still fine with this being the right fix until SDL2 2.0.10 is out in homebrew?

tomassedovic commented 5 years ago

As of today (9th June, 2019) the SDL 2 in Homebrew is still 2.0.9:

https://formulae.brew.sh/formula/sdl2

I'm merging this and I'll publish a new tcod-rs version with the accumulated fixes.