Crates.io | horde3d-sys |
lib.rs | horde3d-sys |
version | 0.1.1 |
source | src |
created_at | 2017-11-21 17:04:55.607675 |
updated_at | 2017-11-28 19:18:59.944428 |
description | FFI bindings for Horde3D v1.0 Horde3D is automatically built and linked statically. |
homepage | https://github.com/i80and/horde3d-sys |
repository | https://github.com/i80and/horde3d-sys.git |
max_upload_size | |
id | 40160 |
size | 13,687,181 |
See crates.io.
This crate exposes the raw Horde3D API, so the Horde3D manual applies.
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();
}
}