Function gfx_window_sdl::init [] [src]

pub fn init(builder: &mut WindowBuilder) -> (Window, GLContext, Device, Factory, RenderTargetView<Resources, Srgba8>, DepthStencilView<Resources, DepthStencil>)

Builds an SDL2 window from a WindowBuilder struct.

Example

extern crate gfx_window_sdl;
extern crate sdl2;
 
fn main() {
    let sdl = sdl2::init().unwrap();
 
    let mut builder = sdl.video().unwrap().window("Example", 800, 600);
    let (window, glcontext, device, factory, color_view, depth_view) =
        gfx_window_sdl::init(&mut builder);

    // some code...
}