Go to file
iceiix c099a68168
Use glutin to replace sdl2 (#35)
* Add glutin dependency

* Create a glutin window

* Use the glutin window, basics work

* Store DPI factor on game object, update on Resized

* Use physical size for rendering only. Fixes UI scaled too small

Fixes https://github.com/iceiix/steven/pull/35#issuecomment-442683373
See also https://github.com/iceiix/steven/issues/22

* Begin adding mouse input events

* Listen for DeviceEvents

* Call hover_at on mouse motion

* Listen for CursorMoved window event, hovering works

Glutin has separate WindowEvent::CursorMoved and
DeviceEvent::MouseMotion events, for absolute cursor and relative mouse
motion, respectively, instead of SDL's Event::MouseMotion for both.

* Use tuple pattern matching instead of nested if for MouseInput

* Implement left clicking

* Use grab_cursor() to capture the cursor

* Hide the cursor when grabbing

* Implement MouseWheel event

* Listen for keyboard input, escape key release

* Keyboard input: console toggling, glutin calls backquote 'grave'

* Implement fullscreen in glutin, updates https://github.com/iceiix/steven/pull/31

* Update settings for glutin VirtualKeyCode

* Keyboard controls (note: must clear conf.cfg to use correct bindings)

* Move DeviceEvent match arm up higher for clarity

* Remove SDL

* Pass physical dimensions to renderer tick so blit_framebuffer can use full size but the ui is still sized logically.

* Listen for DeviceEvent::Text

* Implement text input using ReceivedCharacter window event, works

https://github.com/iceiix/steven/pull/35#issuecomment-443247267

* Request specific version of OpenGL, version 3.2

* Request OpenGL 3.2 but fallback to OpenGL ES 2.0 if available (not tested)

* Set core profile and depth 24-bits, stencil 0-bits

* Allow changing vsync, but require restarting (until https://github.com/tomaka/glutin/issues/693)

* Clarify specific Rust version requirement

* Import glutin::* in handle_window_event() to avoid overly repetitive code

* Linux in VM fix: manually calculate delta in MouseMotion

For the third issue on https://github.com/iceiix/steven/pull/35#issuecomment-443084458
https://github.com/tomaka/glutin/issues/1084 MouseMotion event returns absolute instead of relative values, when running Linux in a VM

* Heuristic to detect absolute/relative MouseMotion from delta:(xrel, yrel); use a higher scaling factor

* Add clipboard pasting with clipboard crate instead of sdl2

https://github.com/iceiix/steven/pull/35#issuecomment-443307295
2018-11-30 11:35:35 -08:00
blocks Disable three stylistic Clippy warnings, var names/params, never loop 2018-11-04 15:01:44 -08:00
gl Remove unnecessary 'extern crate's in Rust 2018 edition, import macros 2018-11-04 12:39:23 -08:00
resources Update Cargo.tomls to Rust edition 2018, fix crate imports. Closes #13 2018-11-04 12:15:34 -08:00
shared Use field init shorthand, instead of x:x, just x, 2018-11-04 13:43:30 -08:00
src Use glutin to replace sdl2 (#35) 2018-11-30 11:35:35 -08:00
.gitignore Update to Minecraft 1.11 (Fixes #63) 2016-12-09 14:32:02 +00:00
.travis.yml Use glutin to replace sdl2 (#35) 2018-11-30 11:35:35 -08:00
Cargo.lock Use glutin to replace sdl2 (#35) 2018-11-30 11:35:35 -08:00
Cargo.toml Use glutin to replace sdl2 (#35) 2018-11-30 11:35:35 -08:00
LICENSE-APACHE Duel license under MIT and ApacheV2 2016-03-26 17:34:47 +00:00
LICENSE-MIT Duel license under MIT and ApacheV2 2016-03-26 17:34:47 +00:00
README.md Use glutin to replace sdl2 (#35) 2018-11-30 11:35:35 -08:00
appveyor.yml Use glutin to replace sdl2 (#35) 2018-11-30 11:35:35 -08:00

README.md

Steven (Rust)

Build Status

A Minecraft client coded in Rust. Ported from steven-go. Don't expect it to go anywhere, just doing this for fun.

Images

Steven on Hypixel Steven

In action: http://gfycat.com/NeedyElaborateGypsymoth

Chat

I generally am on the irc.spi.gt irc network in the #think channel. Feel free to pop in to say hi, Webchat can be found here

Downloads

Windows users can download pre-compiled builds from here: https://ci.appveyor.com/project/iceiix/steven (Select your platform, Click the artifacts tab and download Steven.zip)

The Visual Studio 2017 Redistributable is required to run these builds.

Building

Currently requires Rust version 1.31.0-beta or newer to build.

Compile and run:

cargo run --release

Just compile:

cargo build --release

Prerequisites

An easy way to manage multiple Rust toolchains is rustup. Installation instructions for rustup can be found on its website.

Once you've set up rustup, grab Rust beta by running

rustup install beta

Now we need to make sure that steven is compiled with beta. To do this without making beta the default across the entire system, run the following command in the steven directory:

rustup override set beta

Running

Standalone

Just running steven via a double click (Windows) or ./steven (everything else) will bring up a login screen followed by a server list which you can select a server from.