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

Add support for the other renderers #282

Open ElectricCoffee opened 5 years ago

ElectricCoffee commented 5 years ago

I can see that TCOD_RENDERER_SDL2 and TCOD_RENDERER_OPENGL2 are both missing from the library, despite existing in the original C++ lib.

Is this intentional?

HexDecimal commented 5 years ago

Those renderers were added in libtcod 1.8 and 1.9 respectfully. Are these versions supported by tcod-rs? If not then is there anything that can be done to libtcod to make it easier for tcod-rs to upgrade?

ElectricCoffee commented 5 years ago

I don't see it being an issue to upgrade it. The FFI is relatively straightforward (as far as I could tell through minimal digging), so it should just be a matter of updating the relevant bits of the FFI and implement it all into the larger system.

That said, I don't know how much libtcod has changed since. So it might not be as trivial as it seems.

HexDecimal commented 5 years ago

I think the worst break was in libtcod 1.6.2 which took out two functions relating to keyboard repeat which wasn't a feature anymore in SDL2. That prevented some older projects from upgrading, so I reintroduced them as stubs in a later version.

Everything important should be in libtcod's official changelog.

tomassedovic commented 5 years ago

tcod-rs (or specifically, tcod-sys which provides the bindings) is using libtcod 1.6.3.

There's no strong reason for this other than no one showed up willing to do the work of upgrading it. And people weren't asking for any of the new features either. I've not followed the libtcod development recently, so I don't know whether there are any nasty surprises in store.

One thing to note is that given the potential for breakage, I would not be comfortable merging this until I've heard confirmation from Windows and macOS folks (I can do Linux) that it all works fine. I don't own a Mac and while I could verify a Windows (7) build, it would take a long time.

So I'm all for this, but be aware that it might take a while to get it all merged. I'll be happy to guide you through the upgrade.

ElectricCoffee commented 5 years ago

I'm only asking about this because the new renderers have better support for more advanced textures. The whole thing was sparked when I had issues getting some Dwarf Fortress fonts to work properly. The default shader refuses to treat shadows correctly, and the other two just resulted in runtime errors.