Skip to content

Instantly share code, notes, and snippets.

@Riateche
Created November 23, 2015 18:21
Show Gist options
  • Save Riateche/596161fe00ad08653f81 to your computer and use it in GitHub Desktop.
Save Riateche/596161fe00ad08653f81 to your computer and use it in GitHub Desktop.
[package]
name = "test2"
version = "0.1.0"
authors = ["ri"]
[dependencies]
sdl2 = "0.11"
sdl2_image = "0.4"
extern crate sdl2;
extern crate sdl2_image;
use sdl2_image::LoadTexture;
use std::path::PathBuf;
fn main() {
let sdl_context = sdl2::init().unwrap();
sdl2_image::init(sdl2_image::INIT_PNG);
let video_subsystem = sdl_context.video().unwrap();
let window = video_subsystem.window(
"title", 100, 100
).position_centered().opengl().build().unwrap();
let mut renderer = window.renderer().build().unwrap();
renderer.load_texture(PathBuf::from("/tmp/1.png"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment