use lexsdl::*; fn main(){ // initialize sdl let sdl_context = sdl2::init().unwrap(); let video_subsystem = sdl_context.video().unwrap(); // create window and canvas let window = video_subsystem.window("LEXSDL Rust Example - integrating", 800,600).position_centered().build().unwrap(); let mut canvas = window.into_canvas().build().unwrap(); // to integrate unsafe { // get the window pointer out of the canvas and set it. LEXSDL_SetWindow(canvas.window_mut().raw()); // get the renderer pointer out of the canvas and set it. LEXSDL_SetRenderer(canvas.raw()); } // now LEXSDL can be normally used unsafe { // set the backgroud to a lime color LEXSDL_SetBackgroundColor(0x7D,0xBF,0x2F,0xFF); // and render LEXSDL_NewFrame(); LEXSDL_ShowFrame(); } // sleep for 3 seconds before exiting. std::thread::sleep(std::time::Duration::from_secs(3)); }