diff --git a/src/extensions/android_surface.rs b/src/extensions/android_surface.rs index 84e39d3..55a4500 100644 --- a/src/extensions/android_surface.rs +++ b/src/extensions/android_surface.rs @@ -1,11 +1,10 @@ #![allow(dead_code)] use prelude::*; use std::mem; -use instance::Instance; -use entry::Entry; use vk; use std::ffi::CStr; use ::RawPtr; +use version::{EntryV1_0, InstanceV1_0}; #[derive(Clone)] pub struct AndroidSurface { @@ -14,7 +13,9 @@ pub struct AndroidSurface { } impl AndroidSurface { - pub fn new(entry: &Entry, instance: &Instance) -> Result> { + pub fn new(entry: &E, + instance: &I) + -> Result> { let surface_fn = vk::AndroidSurfaceFn::load(|name| { unsafe { mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr())) @@ -37,9 +38,9 @@ impl AndroidSurface { let mut surface = mem::uninitialized(); let err_code = self.android_surface_fn .create_android_surface_khr(self.handle, - create_info, - allocation_callbacks.as_raw_ptr(), - &mut surface); + create_info, + allocation_callbacks.as_raw_ptr(), + &mut surface); match err_code { vk::Result::Success => Ok(surface), _ => Err(err_code), diff --git a/src/extensions/mir_surface.rs b/src/extensions/mir_surface.rs index dffc9db..f58991d 100644 --- a/src/extensions/mir_surface.rs +++ b/src/extensions/mir_surface.rs @@ -1,11 +1,10 @@ #![allow(dead_code)] use prelude::*; use std::mem; -use instance::Instance; -use entry::Entry; use vk; use std::ffi::CStr; use ::RawPtr; +use version::{EntryV1_0, InstanceV1_0}; #[derive(Clone)] pub struct MirSurface { @@ -14,7 +13,9 @@ pub struct MirSurface { } impl MirSurface { - pub fn new(entry: &Entry, instance: &Instance) -> Result> { + pub fn new(entry: &E, + instance: &I) + -> Result> { let surface_fn = vk::MirSurfaceFn::load(|name| { unsafe { mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr())) @@ -31,15 +32,15 @@ impl MirSurface { } pub unsafe fn create_mir_surface_khr(&self, - create_info: &vk::MirSurfaceCreateInfoKHR, - allocation_callbacks: Option<&vk::AllocationCallbacks>) - -> VkResult { + create_info: &vk::MirSurfaceCreateInfoKHR, + allocation_callbacks: Option<&vk::AllocationCallbacks>) + -> VkResult { let mut surface = mem::uninitialized(); let err_code = self.mir_surface_fn .create_mir_surface_khr(self.handle, - create_info, - allocation_callbacks.as_raw_ptr(), - &mut surface); + create_info, + allocation_callbacks.as_raw_ptr(), + &mut surface); match err_code { vk::Result::Success => Ok(surface), _ => Err(err_code), diff --git a/src/extensions/mod.rs b/src/extensions/mod.rs index bbdaa29..d0c71b0 100644 --- a/src/extensions/mod.rs +++ b/src/extensions/mod.rs @@ -3,17 +3,17 @@ pub use self::surface::Surface; pub use self::xlib_surface::XlibSurface; pub use self::debug_report::DebugReport; pub use self::win32_surface::Win32Surface; -//pub use self::mir_surface::MirSurface; -//pub use self::xcb_surface::XcbSurface; -//pub use self::wayland_surface::WaylandSurface; -//pub use self::android_surface::AndroidSurface; -// +pub use self::mir_surface::MirSurface; +pub use self::xcb_surface::XcbSurface; +pub use self::wayland_surface::WaylandSurface; +pub use self::android_surface::AndroidSurface; + mod swapchain; mod surface; mod xlib_surface; mod win32_surface; mod debug_report; -//mod mir_surface; -//mod android_surface; -//mod wayland_surface; -//mod xcb_surface; +mod mir_surface; +mod android_surface; +mod wayland_surface; +mod xcb_surface; diff --git a/src/extensions/wayland_surface.rs b/src/extensions/wayland_surface.rs index 5abad4a..a02a779 100644 --- a/src/extensions/wayland_surface.rs +++ b/src/extensions/wayland_surface.rs @@ -1,10 +1,10 @@ +#![allow(dead_code)] use prelude::*; use std::mem; -use instance::Instance; -use entry::Entry; use vk; use std::ffi::CStr; use ::RawPtr; +use version::{EntryV1_0, InstanceV1_0}; #[derive(Clone)] pub struct WaylandSurface { @@ -13,7 +13,9 @@ pub struct WaylandSurface { } impl WaylandSurface { - pub fn new(entry: &Entry, instance: &Instance) -> Result> { + pub fn new(entry: &E, + instance: &I) + -> Result> { let surface_fn = vk::WaylandSurfaceFn::load(|name| { unsafe { mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr())) @@ -36,9 +38,9 @@ impl WaylandSurface { let mut surface = mem::uninitialized(); let err_code = self.wayland_surface_fn .create_wayland_surface_khr(self.handle, - create_info, - allocation_callbacks.as_raw_ptr(), - &mut surface); + create_info, + allocation_callbacks.as_raw_ptr(), + &mut surface); match err_code { vk::Result::Success => Ok(surface), _ => Err(err_code), diff --git a/src/extensions/xcb_surface.rs b/src/extensions/xcb_surface.rs index 3f1e2f6..d9a8341 100644 --- a/src/extensions/xcb_surface.rs +++ b/src/extensions/xcb_surface.rs @@ -1,11 +1,10 @@ #![allow(dead_code)] use prelude::*; use std::mem; -use instance::Instance; -use entry::Entry; use vk; use std::ffi::CStr; use ::RawPtr; +use version::{EntryV1_0, InstanceV1_0}; #[derive(Clone)] pub struct XcbSurface { @@ -14,7 +13,9 @@ pub struct XcbSurface { } impl XcbSurface { - pub fn new(entry: &Entry, instance: &Instance) -> Result> { + pub fn new(entry: &E, + instance: &I) + -> Result> { let surface_fn = vk::XcbSurfaceFn::load(|name| { unsafe { mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr())) @@ -31,15 +32,15 @@ impl XcbSurface { } pub unsafe fn create_xcb_surface_khr(&self, - create_info: &vk::XcbSurfaceCreateInfoKHR, - allocation_callbacks: Option<&vk::AllocationCallbacks>) - -> VkResult { + create_info: &vk::XcbSurfaceCreateInfoKHR, + allocation_callbacks: Option<&vk::AllocationCallbacks>) + -> VkResult { let mut surface = mem::uninitialized(); let err_code = self.xcb_surface_fn .create_xcb_surface_khr(self.handle, - create_info, - allocation_callbacks.as_raw_ptr(), - &mut surface); + create_info, + allocation_callbacks.as_raw_ptr(), + &mut surface); match err_code { vk::Result::Success => Ok(surface), _ => Err(err_code),