pub struct Instance {
pub raw: Arc<RawInstance>,
pub extensions: Vec<&'static CStr>,
pub entry: Entry,
}
Fields§
§raw: Arc<RawInstance>
§extensions: Vec<&'static CStr>
Supported extensions of this instance.
entry: Entry
Implementations§
Source§impl Instance
impl Instance
pub fn create_surface_from_hwnd( &self, hinstance: *mut c_void, hwnd: *mut c_void, ) -> Surface
pub fn create_surface_from_vk_surface_khr(&self, surface: SurfaceKHR) -> Surface
Source§impl Instance
impl Instance
pub fn required_extensions( entry: &Entry, driver_api_version: Version, ) -> Result<Vec<&'static CStr>, UnsupportedBackend>
pub fn required_layers( entry: &Entry, ) -> Result<Vec<&'static CStr>, UnsupportedBackend>
Sourcepub unsafe fn from_raw(
entry: Entry,
raw_instance: Instance,
driver_api_version: Version,
extensions: Vec<&'static CStr>,
) -> Result<Self, UnsupportedBackend>
pub unsafe fn from_raw( entry: Entry, raw_instance: Instance, driver_api_version: Version, extensions: Vec<&'static CStr>, ) -> Result<Self, UnsupportedBackend>
§Safety
raw_instance
must be created using at least the extensions provided by Instance::required_extensions()
and the layers provided by Instance::required_extensions()
.
driver_api_version
must match the version used to create raw_instance
.
extensions
must match the extensions used to create raw_instance
.
raw_instance
must be manually destroyed after gfx-hal Instance has been dropped.
Sourcepub unsafe fn adapter_from_raw(
&self,
raw_physical_device: PhysicalDevice,
) -> Adapter<Backend>
pub unsafe fn adapter_from_raw( &self, raw_physical_device: PhysicalDevice, ) -> Adapter<Backend>
§Safety
raw_physical_device
must be created from self
(or from the inner raw handle)
Trait Implementations§
Source§impl Instance<Backend> for Instance
impl Instance<Backend> for Instance
Source§fn create(name: &str, version: u32) -> Result<Self, UnsupportedBackend>
fn create(name: &str, version: u32) -> Result<Self, UnsupportedBackend>
Create a new instance. Read more
Source§fn enumerate_adapters(&self) -> Vec<Adapter<Backend>>
fn enumerate_adapters(&self) -> Vec<Adapter<Backend>>
Return all available graphics adapters.
Source§unsafe fn create_surface(
&self,
has_handle: &impl HasRawWindowHandle,
) -> Result<Surface, InitError>
unsafe fn create_surface( &self, has_handle: &impl HasRawWindowHandle, ) -> Result<Surface, InitError>
Source§unsafe fn destroy_surface(&self, surface: Surface)
unsafe fn destroy_surface(&self, surface: Surface)
Destroy a surface, freeing the resources associated with it and
releasing it from this graphics API. Read more
Source§unsafe fn create_display_plane_surface(
&self,
display_plane: &DisplayPlane<'_, Backend>,
plane_stack_index: u32,
transformation: SurfaceTransform,
alpha: DisplayPlaneAlpha,
image_extent: Extent2D,
) -> Result<Surface, DisplayPlaneSurfaceError>
unsafe fn create_display_plane_surface( &self, display_plane: &DisplayPlane<'_, Backend>, plane_stack_index: u32, transformation: SurfaceTransform, alpha: DisplayPlaneAlpha, image_extent: Extent2D, ) -> Result<Surface, DisplayPlaneSurfaceError>
Auto Trait Implementations§
impl Freeze for Instance
impl RefUnwindSafe for Instance
impl Send for Instance
impl Sync for Instance
impl Unpin for Instance
impl UnwindSafe for Instance
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more