Enum rafx_api::RafxApi [−][src]
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(
_window: &dyn HasRawWindowHandle,
_api_def: &RafxApiDef
) -> RafxResult<Self>
[src]
_window: &dyn HasRawWindowHandle,
_api_def: &RafxApiDef
) -> RafxResult<Self>
Create a device using the “default” backend for the platform.
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 empty_api(&self) -> Option<&RafxApiEmpty>
[src]
Get the underlying metal API object. This provides access to any internally created metal objects.
Auto Trait Implementations
impl RefUnwindSafe for RafxApi
impl Send for RafxApi
impl Sync for RafxApi
impl Unpin for RafxApi
impl UnwindSafe for RafxApi
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Resource for T where
T: Downcast + Send + Sync,
[src]
T: Downcast + Send + Sync,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,