An SDL2 back-end for the Piston game engine
Maintainers: @TyOverby, @bvssvni, @Coeuvre
let mut window = WindowSDL2::new(
piston::shader_version::opengl::OpenGL_3_2,
piston::WindowSettings {
title: "My application".to_string(),
size: [640, 480],
fullscreen: false,
exit_on_esc: true,
samples: 4,
}
);
After you have created a window, do the following:
let mut device = gfx::GlDevice::new(|s| unsafe {
transmute(sdl2::video::gl_get_proc_address(s))
});
let (w, h) = window.get_size();
let frame = gfx::Frame::new(w as u16, h as u16);