Skip to content

MaulingMonkey/bgfx-rs

 
 

Repository files navigation

bgfx-rs travis-ci status appveyor status

Rust wrapper around bgfx, providing a clean, safe API for rust applications.

Note: This is a fork of rhoot/bgfx-rs, which is no longer maintained. This may also end up unmaintained, but let's give it a shot anyways.

Quick Reference

Platforms

OS Requirements
Windows (MSVC) Rust, VS2017, VS2015, or VS2013 with the standard C++ tools [1].
Windows (GNU) Rust, MinGW?, Some GnuWin32 Utilities
Linux Rust, G++ 4.8?, Make, OpenGL and X11 dev packages
Windows UWP Rust and BGFX have support, needs implementing though.
Android Rust and BGFX have support, needs implementing though.
iOS Rust and BGFX have support, needs implementing though.
OS X Rust and BGFX have support, needs implementing though.
Windows Phone BGFX has support, but Microsoft has sunset this platform.
  1. The x86 compiler may require an opt-in individual component in some VS versions.
  2. See also bgfx's build docs. bx, bimg, and genie dependencies can be ignored as they're handled via submodules.

For working on this project, I also recommend grabbing Git, VS Code, and installing the workspace recommended extensions, rust-lang.rust and ms-vscode.cpptools.

Quick Start

Debug Examples (VS Code, Windows)

  1. If you haven't already, install VS2017 w/ Desktop C++ Tools, VS Code, and Git
  2. Open a cmd prompt
    • Run git clone --recurse-submodules https://github.com/MaulingMonkey/bgfx-rs.git to get the full source code, or run git submodule update --init if you already had a partial checkout.
    • Run code bgfx-rs to open VS Code in the right folder.
  3. Consider installing workspace recommended extensions (Ctrl+Shift+X to open the Extensions tab)
  4. Press F5 to Start Debugging
  5. Press Enter to select the default example, 00-helloworld, when VS Code prompts you
  6. Profit! Set breakpoints, step through code, inspect variables, etc.

Run Examples (Command Line, Multi-Platform)

Just use the regular cargo commands:

cargo run --example 00-helloworld
cargo run --example 01-cubes

OSX Note: There is currently no really clean way to exit the examples in OSX, and closing the window may in fact cause a crash. This is due to limitations in glutin (specifically #468 and #520). This only effects the examples, and not the crate itself. The best way of closing them is to simply Ctrl-C in the console.

License

Copyright (c) 2015-2016, Johan Sköld

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

About

Rust wrapper around bgfx.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rust 98.1%
  • Batchfile 1.7%
  • Makefile 0.2%