gfx_window_glutin

Crates.iogfx_window_glutin
lib.rsgfx_window_glutin
version0.31.0
sourcesrc
created_at2015-05-10 03:18:17.209403
updated_at2019-04-25 15:11:55.940435
descriptionGlutin window for gfx-rs
homepagehttps://github.com/gfx-rs/gfx
repositoryhttps://github.com/gfx-rs/gfx
max_upload_size
id2070
size26,431
Brendan Zabarauskas (brendanzab)

documentation

https://docs.rs/gfx_window_glutin

README

gfx_window_glutin

Glutin window backend for gfx-rs

Usage

Make sure you have the following in your Cargo.toml:

gfx_core = "0.9"
gfx_device_gl = "0.16"
gfx_window_glutin = "0.30.0"
glutin = "0.20"

Then, initialize gfx as follows:

extern crate gfx_core;
extern crate gfx_device_gl;
extern crate gfx_window_glutin;
extern crate glutin;

use gfx_core::format::{DepthStencil, Rgba8};

fn main() {
    let events_loop = glutin::EventsLoop::new();
    let window_builder = glutin::WindowBuilder::new().with_title("Example".to_owned());
    let context = glutin::ContextBuilder::new();
    let (window, device, factory, rtv, stv) =
        gfx_window_glutin::init::<Rgba8, DepthStencil>(window_builder, context, &events_loop);

    // your code
}
Commit count: 6137

cargo fmt