#sys #linked #bindings

sys horde3d-sys

FFI bindings for Horde3D v1.0 Horde3D is automatically built and linked statically

2 releases

0.1.1 Nov 28, 2017
0.1.0 Nov 21, 2017

#13 in Rendering engine

Download history 2/week @ 2018-07-31 10/week @ 2018-08-07 17/week @ 2018-08-14 1/week @ 2018-08-21 2/week @ 2018-08-28 3/week @ 2018-09-04 1/week @ 2018-09-11 1/week @ 2018-09-18 6/week @ 2018-10-02 2/week @ 2018-10-09 10/week @ 2018-10-16 4/week @ 2018-10-23

8 downloads per month

EPL-1.0 license

7MB
44K SLoC

C++ 39K SLoC // 0.2% comments C# 3.5K SLoC // 0.4% comments Rust 1K SLoC JavaScript 112 SLoC // 0.2% comments Batch 22 SLoC Lua 16 SLoC // 0.3% comments

Low-level Horde3D bindings for Rust

See crates.io.

This crate exposes the raw Horde3D API, so the Horde3D manual applies.

Requirements

  • build-essentials (gcc, etc.)

Example

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();
    }
}

No runtime deps

  • build build.rs
  • build cc 1.0