Giter VIP home page Giter VIP logo

rust-voxlap-test's Introduction

Rust Voxlap Test

Showcase and sample application for rust-voxlap, which is Voxlap binding for Rust.

Overview

Voxlap is a voxel engine by Ken Silverman: http://advsys.net/ken/voxlap.htm

This demo demonstrates how to use Voxlap engine in Rust through rust-voxlap binding.

I tried to pack a lot of showcase feature in this demo, so the scene is a little bit chaotic.

Requirements

32-bit Rust Nightly installer

Voxlap functionality is curently provided through a 32-bit dll file, so you need the 32-bit Rust Nightly installer.

This repository contains all the necessary library files for Windows (voxlap.lib, voxlap.dll), SDL2 is provided via bundled feature, and Cargo (Rust package manager) handles all the dependencies, so you don't need to care a lot about the following requirements.

SDL2

rust-voxlap is independent from any system dependencies, but the demo uses Rust-SDL2 for

  • creating window
  • copying the buffer which contains the rendered scene calculated by Voxlap to the screen (including 2D texts and images)
  • handling input
  • TODO: handling sound

Installation

Use the Rust Nightly installer and cargo to run the demo:

git clone https://github.com/bbodi/rust-voxlap-test.git
cd rust-voxlap-test
cargo run

For x86_64 platform you should run with:

rustup target add i686-pc-windows-msvc
cargo run --target=i686-pc-windows-msvc

Voxlap libraries

This repository contains all the necessary library files for Windows, but if you need to compile your own files, here is a little help:
The voxlap.lib was compiled based on this repository with Visual Studio 2010. I find this repo the easiest to compile, but you can use other sources too.
But be aware, this repo contains two commits, but you only need the first one!
(The second commit tries to raise the map size from 1024x1024 to 2048x2048, but the modifications are incomplete, and you cannot load .vxl files correctly with this second commit.)
After you checked it out and reversed to the first commit, you need to create a .lib from the voxlap project in Visual Studio.

Images

Empty room with a green voxel

rust-voxlap-test's People

Contributors

bbodi avatar ncrashed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ncrashed isgasho

rust-voxlap-test's Issues

Panic with plasma

Game crashes quite often if multiple plasma balls fired.

For more information about this error, try `rustc --explain E0170`.
    Finished release [optimized] target(s) in 1m 14s
     Running `target\i686-pc-windows-msvc\release\rust-voxlap-test.exe`
thread 'main' panicked at 'removal index (is 1) should be < len (is 1)', library\alloc\src\vec\mod.rs:1355:13
stack backtrace:
   0:   0x1c543d - core::fmt::write
                       at /rustc/42816d61ead7e46d462df997958ccfd514f8c21c\/library\core\src\fmt\mod.rs:1094
   1:   0x1b3651 - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
                       at /rustc/42816d61ead7e46d462df997958ccfd514f8c21c\/library\std\src\io\mod.rs:1580
   2:   0x1b6e57 - std::sys_common::backtrace::_print
                       at /rustc/42816d61ead7e46d462df997958ccfd514f8c21c\/library\std\src\sys_common\backtrace.rs:49
   3:   0x1b6e57 - std::sys_common::backtrace::print
                       at /rustc/42816d61ead7e46d462df997958ccfd514f8c21c\/library\std\src\sys_common\backtrace.rs:36
   4:   0x1b6e57 - std::panicking::default_hook::{{closure}}
                       at /rustc/42816d61ead7e46d462df997958ccfd514f8c21c\/library\std\src\panicking.rs:208
   5:   0x1b69c2 - std::panicking::default_hook
                       at /rustc/42816d61ead7e46d462df997958ccfd514f8c21c\/library\std\src\panicking.rs:225
   6:   0x1b740b - std::panicking::rust_panic_with_hook
                       at /rustc/42816d61ead7e46d462df997958ccfd514f8c21c\/library\std\src\panicking.rs:591
   7:   0x1b7045 - std::panicking::begin_panic_handler::{{closure}}
                       at /rustc/42816d61ead7e46d462df997958ccfd514f8c21c\/library\std\src\panicking.rs:497
   8:   0x1b55fa - std::sys_common::backtrace::__rust_end_short_backtrace<closure-0,!>
                       at /rustc/42816d61ead7e46d462df997958ccfd514f8c21c\/library\std\src\sys_common\backtrace.rs:141
   9:   0x1b6f82 - std::panicking::begin_panic_handler
                       at /rustc/42816d61ead7e46d462df997958ccfd514f8c21c\/library\std\src\panicking.rs:493
  10:   0x1caf5a - core::panicking::panic_fmt
                       at /rustc/42816d61ead7e46d462df997958ccfd514f8c21c\/library\core\src\panicking.rs:92
  11:   0x1cae17 - alloc::vec::{{impl}}::remove::assert_failed
                       at /rustc/42816d61ead7e46d462df997958ccfd514f8c21c\/library\alloc\src\vec\mod.rs:1355
  12:   0x1a7ad2 - rust_voxlap_test::plasma::PlasmaManager::update::h49ebdd9e8775f509
  13:   0x1a8ae0 - sdl2::render::InternalTexture::with_lock::hbbc9f3462daea1e5
  14:   0x1a2980 - alloc::alloc::box_free::habdf97cbabaadd57
  15:   0x1a4375 - std::sys_common::backtrace::__rust_begin_short_backtrace::h4cbdd816eb891df5
  16:   0x1a41df - main
  17: 0x773ffa29 - BaseThreadInitThunk
  18: 0x77b175f4 - RtlGetAppContainerNamedObjectPath
  19: 0x77b175c4 - RtlGetAppContainerNamedObjectPath
error: process didn't exit successfully: `target\i686-pc-windows-msvc\release\rust-voxlap-test.exe` (exit code: 101)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.