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

Fix #215 - Remove quack library usage #216

Closed mattico closed 9 years ago

mattico commented 9 years ago

Not currently working, but progress has been made:

Most of the grunt work has been done to update hematite for rust nightly/beta, and the ever-changing gfx-rs and piston. Currently, what's left to be done is to disentangle the Renderer type from Device/Factory in shader.rs, and block_state.rs (or some other solution) to finish removing quack. In fact, if you know what you're doing, it might be easier to start with the shader.rs from master and work from there since the one in the PR was committed in the middle of me trying to understand the web of inheritance going on there.

A potential papercut to note: I didn't notice at the time but the mmap crate from crates.io might not work on Windows right now (PR Pending ?).

kvark commented 9 years ago

Thanks @mattico ! I'll be able to fix gfx tomorrow, hopefully.

mattico commented 9 years ago

Thanks @eddyb for the review! I'll apply all the suggestions straightaway.

Goes to show how chasing compiler errors is rarely as effective as thinking ;)

mattico commented 9 years ago

Windows build works now!

capture

kvark commented 9 years ago

@mattico wow, that's incredible amount of work! Perhaps, we could have it running on rust-1.0 by Friday? ;)

mattico commented 9 years ago

There's a possible problem with linux right now, but it might be bad Virtualbox drivers.

suitable
Warning: model tripwire_hook_attached_powered uses AO but has faces which are unsuitable
Warning: model tripwire_hook_attached_powered uses AO but has faces which are unsuitable
ignoring 3 extra frames in 'blocks/prismarine_rough'
ignoring 4 extra frames in 'blocks/sea_lantern'
thread '<main>' panicked at 'No framebuffer objects, can't make a new one!', /home/matt/.cargo/git/checkouts/gfx_device_gl-ceded8a9e751584e/master/src/factory.rs:216
X Error of failed request:  BadDrawable (invalid Pixmap or Window parameter)
  Major opcode of failed request:  14 (X_GetGeometry)
  Resource id in failed request:  0x4200008
  Serial number of failed request:  51
  Current serial number in output stream:  51
Process didn't exit successfully: `target/release/hematite /home/matt/host/New World/` (signal: 11)

Looking at https://github.com/gfx-rs/gfx_device_gl/blob/master/src/factory.rs#L216, it's probably a VBox issue.

If anyone has an actual linux install, can you confirm?

mattico commented 9 years ago

@kvark there's a chance :)

mattico commented 9 years ago

Oh wow, I forgot about https://github.com/PistonDevelopers/hematite/pull/210 facepalm. Thankfully, we made many of the same choices about how to bring everything back up to nightly (flate2 and byteorder) so it shouldn't be too hard to merge.

eddyb commented 9 years ago

@mattico This is actually a limitation of gfx-rs, which doesn't properly support OpenGL 2.1 with very few extensions, VirtualBox's support being quite limited. I had to switch from gfx-rs to glium for rid3 to be able to test it on windows under VirtualBox.

eddyb commented 9 years ago

@mattico I did one more pass through the whole changeset and I believe that apart from my last comment, everything looks good. Thank you so much for your work :tada:

kvark commented 9 years ago

@eddyb we should certainly add support to it. I wasn't aware it's such a blocker. Created https://github.com/gfx-rs/gfx-rs/issues/728

mattico commented 9 years ago

Thanks so much @kvark and @eddyb for the help on this.