[][src]Enum rafx_api::RafxApi

pub enum RafxApi {
    Vk(RafxApiVulkan),
}

Primary entry point to using the API. Use the new_* functions to initialize the desired backend.

This API object must persist for the lifetime of all objects created through it. This is verified at runtime when the API object is destroyed - either explicitly via destroy() or by dropping the object.

Once the API object is created, use device_context() to obtain a cloneable handle to the device. The RafxDeviceContext is the primary way of interacting with the API once it has been initialized. These contexts and all other objects created through them must be dropped before dropping RafxApi or calling RafxApi::destroy().

Variants

Implementations

impl RafxApi[src]

pub fn new_vulkan(
    window: &dyn HasRawWindowHandle,
    api_def: &RafxApiDef,
    vk_api_def: &RafxApiDefVulkan
) -> RafxResult<Self>
[src]

Initialize a device using vulkan

pub fn device_context(&self) -> RafxDeviceContext[src]

Create a cloneable handle to the device. Most of the interaction with the graphics backend is done through this handle.

The RafxDeviceContext does not need to be kept in scope. As long as the RafxApi remains in scope, dropping the device context does not do anything, and it can be obtained again by calling this function.

This context is intended to be safely shared across threads. This function is thread-safe, and generally all APIs on the device context itself are thread-safe.

pub fn destroy(&mut self) -> RafxResult<()>[src]

Destroys the graphics API instance. Any RafxDeviceContext created through this API, and any object created through those device contexts, must be dropped before calling destroy()

destroy() is automatically called if RafxApi is dropped and it has not yet been called, so it is not necessary to call this function explicitly.

pub fn vk_api(&self) -> Option<&RafxApiVulkan>[src]

Get the underlying vulkan API object. This provides access to any internally created vulkan objects.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Resource for T where
    T: Downcast + Send + Sync
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.