PistonDevelopers / hematite

A simple Minecraft written in Rust with the Piston game engine
http://hematite.piston.rs/
MIT License
1.85k stars 105 forks source link

stale directions for SDL2 dependency on Windows #265

Closed bvanevery closed 8 years ago

bvanevery commented 8 years ago

Can't just "cargo build" on Windows due to missing SDL2 dependencies.

The hematite github page says on Windows, "Copy SDL2.dll to C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib, also in Hematite's root folder.". I don't think this corresponds to any meaningful directory in Rust 1.8. Mine for instance lives in "C:\Program Files\Rust stable MSVC 1.8\bin" and I don't see any rustlib subdirectory.

Also I don't think you want the SDL binary. I think you want the SDL developer libs according to whether you are using a MinGW or MSVC version of Rust.

Also, is it actually reasonable to tell the user to copy the libs to both the Rust directory and the hematite directory? On some other project, I did a .cargo folder and a "config" file.

Please bear in mind that total Rust noobs (like me) are trying to get such things off the ground, when looking at what the Rust ecology can or can't do. Anything about where libs should canonically go on a Windows installation, is quite helpful. We don't have system libs by default like on Linux or whatnot. Trying to get going is often like, "huh?"

eddyb commented 8 years ago

I wish we could just move to glutin, but the lack of relative mouse input is keeping us using SDL. It might be worth at least investigating whether that can be done on Windows, keeping the SDL dependency to just UNIX systems. cc @retep998

retep998 commented 8 years ago

There is so totally relative mouse input on Windows. Adding it to glutin should be E-easy for anyone familiar with windows api.

retep998 commented 8 years ago

For future reference of anyone who does decide to work on this you use RegisterRawInputDevices to register a device for raw input, and then you receive WM_INPUT messages through the normal message loop.

bvssvni commented 8 years ago

Actually, fake capturing was landed in https://github.com/PistonDevelopers/glutin_window/pull/87, and since SDL2 uses same trick now, there is no reason not to use Glutin.

mattico commented 8 years ago

@bvanevery I agree that the instructions could probably be more clear, but dealing with C libraries on Windows has always been a pain.

I'll look at getting glutin support though, #264 is pretty close already.

mattico commented 8 years ago

This should no longer be an issue since we no longer use SDL!

@bvanevery I'm closing this for now, but feel free to open more issues about setup if you have any other questions.