https://github.com/i80and/horde3d-sys
https://github.com/i80and/horde3d-sys
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/i80and/horde3d-sys
- Owner: i80and
- Created: 2017-11-21T16:45:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-28T19:18:08.000Z (over 8 years ago)
- Last Synced: 2025-10-04T00:57:02.736Z (9 months ago)
- Language: Rust
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Low-level [Horde3D](http://www.horde3d.org/) bindings for [Rust](https://www.rust-lang.org/)
See [crates.io](https://crates.io/crates/horde3d-sys).
This crate exposes the raw Horde3D API, so the [Horde3D manual](http://www.horde3d.org/docs/manual.html) applies.
## Requirements
* build-essentials (gcc, etc.)
## Example
```rust
extern crate glutin;
extern crate horde3d_sys;
use glutin::GlContext;
fn main() {
let mut events_loop = glutin::EventsLoop::new();
let window = glutin::WindowBuilder::new()
.with_title("Dungeon")
.with_dimensions(1024, 768);
let context = glutin::ContextBuilder::new()
.with_vsync(true)
.with_gl(glutin::GlRequest::Latest)
.with_gl_profile(glutin::GlProfile::Core);
let gl_window = glutin::GlWindow::new(window, context, &events_loop).unwrap();
unsafe {
gl_window.context().make_current().unwrap();
eprintln!("{:?}", horde3d_sys::h3dInit(horde3d_sys::H3DRenderDevice::OpenGL4));
}
let mut running = true;
while running {
events_loop.poll_events(|event| {
match event {
glutin::Event::WindowEvent{ event, .. } => match event {
glutin::WindowEvent::Closed => running = false,
glutin::WindowEvent::Resized(w, h) => gl_window.resize(w, h),
_ => ()
},
_ => ()
}
});
gl_window.swap_buffers().unwrap();
}
unsafe {
horde3d_sys::h3dRelease();
}
}
```