diff --git a/examples/chaos_game.rs b/examples/chaos_game.rs index d17654d1..7e707788 100644 --- a/examples/chaos_game.rs +++ b/examples/chaos_game.rs @@ -9,7 +9,7 @@ use winit::dpi::PhysicalSize; use winit::event::WindowEvent::KeyboardInput; use winit::event::{DeviceEvent, Event, WindowEvent}; use winit::event_loop::{ControlFlow, EventLoop}; -use winit::raw_window_handle::HasWindowHandle; +use winit::raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle, HasWindowHandle}; use winit::window::WindowBuilder; #[cfg(target_os = "macos")] @@ -30,14 +30,13 @@ static TRIANGLE_POINTS: [(f32, f32); 3] = [ (400.0 - 259.81, 300.0 + 75.0 - 300.0), ]; -#[cfg(not(all(target_os = "macos", feature = "sm-raw-window-handle-05")))] +#[cfg(not(all(target_os = "macos", feature = "sm-raw-window-handle-06")))] fn main() { println!("The `chaos_game` demo is not yet supported on this platform."); } -#[cfg(all(target_os = "macos", feature = "sm-raw-window-handle-05"))] +#[cfg(all(target_os = "macos", feature = "sm-raw-window-handle-06"))] fn main() { - use rwh_05::{HasRawDisplayHandle, HasRawWindowHandle}; let connection = SystemConnection::new().unwrap(); let adapter = connection.create_adapter().unwrap(); let mut device = connection.create_device(&adapter).unwrap(); diff --git a/examples/threads.rs b/examples/threads.rs index c414a639..7d049795 100644 --- a/examples/threads.rs +++ b/examples/threads.rs @@ -2,10 +2,7 @@ // // This example demonstrates how to create a multithreaded OpenGL application using `surfman`. -#![cfg(any( - feature = "sm-raw-window-handle-05", - feature = "sm-raw-window-handle-06" -))] +#![cfg(feature = "sm-raw-window-handle-06")] use self::common::{ck, Buffer, Program, ResourceLoader, Shader, ShaderKind}; @@ -29,9 +26,6 @@ use winit::{ window::WindowBuilder, }; -#[cfg(feature = "sm-raw-window-handle-05")] -use rwh_05::{HasRawDisplayHandle, HasRawWindowHandle}; -#[cfg(not(feature = "sm-raw-window-handle-05"))] use rwh_06::{HasDisplayHandle, HasWindowHandle}; pub mod common; @@ -95,14 +89,6 @@ static BACKGROUND_COLOR: [f32; 4] = [ 1.0, ]; -#[cfg(feature = "sm-raw-window-handle-05")] -fn make_connection(window: &winit::window::Window) -> surfman::Connection { - let raw_display_handle = window.raw_display_handle(); - let connection = Connection::from_raw_display_handle(raw_display_handle).unwrap(); - connection -} - -#[cfg(not(feature = "sm-raw-window-handle-05"))] fn make_connection(window: &winit::window::Window) -> surfman::Connection { let display_handle = window .display_handle() @@ -111,20 +97,6 @@ fn make_connection(window: &winit::window::Window) -> surfman::Connection { connection } -#[cfg(feature = "sm-raw-window-handle-05")] -fn make_native_widget( - window: &winit::window::Window, - connection: &surfman::Connection, - window_size: Size2D, -) -> surfman::NativeWidget { - let raw_window_handle = window.raw_window_handle(); - let native_widget = connection - .create_native_widget_from_raw_window_handle(raw_window_handle, window_size) - .unwrap(); - native_widget -} - -#[cfg(not(feature = "sm-raw-window-handle-05"))] fn make_native_widget( window: &winit::window::Window, connection: &surfman::Connection,