Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impl trait functions directly on EntryCustom/Instance/Device #412

Merged
merged 4 commits into from
Apr 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ash-window/examples/winit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//!
//! On instance extensions platform specific extensions need to be enabled.

use ash::{version::EntryV1_0, vk};
use ash::vk;
use std::error::Error;

fn main() -> Result<(), Box<dyn Error>> {
Expand Down
19 changes: 5 additions & 14 deletions ash-window/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
use ash::{
extensions::khr,
prelude::*,
version::{EntryV1_0, InstanceV1_0},
vk,
};
use ash::{extensions::khr, prelude::*, vk, EntryCustom, Instance};
use raw_window_handle::{HasRawWindowHandle, RawWindowHandle};
use std::ffi::CStr;

Expand All @@ -19,16 +14,12 @@ use ash::extensions::ext; // portability extensions
/// In order for the created `SurfaceKHR` to be valid for the duration of its
/// usage, the `Instance` this was called on must be dropped later than the
/// resulting `SurfaceKHR`.
pub unsafe fn create_surface<E, I>(
entry: &E,
instance: &I,
pub unsafe fn create_surface<L>(
entry: &EntryCustom<L>,
instance: &Instance,
window_handle: &dyn HasRawWindowHandle,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR>
where
E: EntryV1_0,
I: InstanceV1_0,
{
) -> VkResult<vk::SurfaceKHR> {
match window_handle.raw_window_handle() {
#[cfg(target_os = "windows")]
RawWindowHandle::Windows(handle) => {
Expand Down
Loading