Rename load_vulkan to new, as Vulkan is loaded at startup time

This commit is contained in:
maik klein 2017-01-01 08:56:38 +01:00
parent 2ce185959b
commit a02fb615c0
3 changed files with 3 additions and 3 deletions

View file

@ -111,7 +111,7 @@ use ash::{Device, Instance};
use ash::version::V1_0; use ash::version::V1_0;
// Those traits implement the version specific functions // Those traits implement the version specific functions
use ash::{InstanceV1_0, DeviceV1_0}; use ash::{InstanceV1_0, DeviceV1_0};
let entry = Entry::<V1_0>::load_vulkan().unwrap(); let entry = Entry::<V1_0>::new().unwrap();
let instance = entry.create_instance(...).expect("Instance creation error."); let instance = entry.create_instance(...).expect("Instance creation error.");
let device = instance.create_device(...).expect("Device creation error."); let device = instance.create_device(...).expect("Device creation error.");
``` ```

View file

@ -241,7 +241,7 @@ impl ExampleBase {
.with_window_resize_callback(resize_callback) .with_window_resize_callback(resize_callback)
.build() .build()
.unwrap(); .unwrap();
let entry = Entry::load_vulkan().unwrap(); let entry = Entry::new().unwrap();
let app_name = CString::new("VulkanTriangle").unwrap(); let app_name = CString::new("VulkanTriangle").unwrap();
let raw_name = app_name.as_ptr(); let raw_name = app_name.as_ptr();

View file

@ -65,7 +65,7 @@ impl<V: FunctionPointers> Entry<V> {
Ok(Instance::from_raw(instance, instance_fp)) Ok(Instance::from_raw(instance, instance_fp))
} }
} }
pub fn load_vulkan() -> Result<Entry<V>, LoadingError> { pub fn new() -> Result<Entry<V>, LoadingError> {
let static_fn = match *VK_LIB { let static_fn = match *VK_LIB {
Ok(ref lib) => { Ok(ref lib) => {
let static_fn = vk::StaticFn::load(|name| unsafe { let static_fn = vk::StaticFn::load(|name| unsafe {