Add Surface::new()
* Add Surface::new()
Creates a `Surface` given the raw handler
* Surface::from_raw_surface instead of new
and removed useless clone
@@ -45,6 +45,18 @@ pub struct Surface {
}
impl Surface {
+ /// Creates a `Surface` given the raw handler.
+ ///
+ /// Be careful when using it
+ ///
+ pub unsafe fn from_raw_surface(instance: Arc<Instance>, surface: vk::SurfaceKHR) -> Surface {
+ Surface {
+ instance: instance,
+ surface: surface,
+ has_swapchain: AtomicBool::new(false),
+ }
+ }
+
/// Creates a `Surface` that covers a display mode.
///
/// # Panic
