Skip to content

dpogretskiy/sdl2_game_window

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sdl2_game_window Build Status

An SDL2 back-end for the Piston game engine

Maintainers: @TyOverby, @bvssvni, @Coeuvre

How to create a window

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

How to set up Gfx

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

About

A SDL2 back-end for the Piston game engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%