pub struct Context { /* private fields */ }
Expand description
The application context.
Implementations
sourceimpl Context
impl Context
sourcepub fn plan_to_close(&self)
pub fn plan_to_close(&self)
Plans the main loop to close.
Calling this function dosn’t guarantee closing.
It triggers the close_requested
function in the Loop
, which can handle the closing event.
sourcepub fn set_limits(&mut self, limits: Limits)
pub fn set_limits(&mut self, limits: Limits)
Sets context’s Limits
.
sourcepub fn set_frame_parameters(&mut self, params: FrameParameters)
pub fn set_frame_parameters(&mut self, params: FrameParameters)
Sets context’s frame parameters via FrameParameters
struct.
No effect if pixel_size
in FrameParameters
is 0.
sourcepub fn create_texture(&mut self, data: TextureData<'_>) -> TextureHandle
pub fn create_texture(&mut self, data: TextureData<'_>) -> TextureHandle
Creates a new texture.
sourcepub fn update_texture(
&mut self,
handle: TextureHandle,
data: TextureData<'_>
) -> Result<(), Error>
pub fn update_texture(
&mut self,
handle: TextureHandle,
data: TextureData<'_>
) -> Result<(), Error>
Updates the texture.
sourcepub fn delete_texture(&mut self, handle: TextureHandle) -> Result<(), Error>
pub fn delete_texture(&mut self, handle: TextureHandle) -> Result<(), Error>
Deletes the texture.
sourcepub fn create_instances<I>(&mut self, data: I) -> InstanceHandlewhere
I: IntoIterator,
I::Item: IntoTransform,
<I::Item as IntoTransform>::IntoQuat: IntoQuat,
pub fn create_instances<I>(&mut self, data: I) -> InstanceHandlewhere
I: IntoIterator,
I::Item: IntoTransform,
<I::Item as IntoTransform>::IntoQuat: IntoQuat,
Creates new instances.
sourcepub fn update_instances<I>(
&mut self,
handle: InstanceHandle,
data: I
) -> Result<(), Error>where
I: IntoIterator,
I::Item: IntoTransform,
<I::Item as IntoTransform>::IntoQuat: IntoQuat,
pub fn update_instances<I>(
&mut self,
handle: InstanceHandle,
data: I
) -> Result<(), Error>where
I: IntoIterator,
I::Item: IntoTransform,
<I::Item as IntoTransform>::IntoQuat: IntoQuat,
Updates instances.
sourcepub fn delete_instances(&mut self, handle: InstanceHandle) -> Result<(), Error>
pub fn delete_instances(&mut self, handle: InstanceHandle) -> Result<(), Error>
Deletes instances.
sourcepub fn create_mesh<V>(&mut self, data: MeshData<'_, V>) -> MeshHandle<V>where
V: Vertex,
pub fn create_mesh<V>(&mut self, data: MeshData<'_, V>) -> MeshHandle<V>where
V: Vertex,
Creates a new mesh.
sourcepub fn update_mesh<V>(
&mut self,
handle: MeshHandle<V>,
data: MeshData<'_, V>
) -> Result<(), Error>where
V: Vertex,
pub fn update_mesh<V>(
&mut self,
handle: MeshHandle<V>,
data: MeshData<'_, V>
) -> Result<(), Error>where
V: Vertex,
Updates the mesh.
sourcepub fn delete_mesh<V>(&mut self, handle: MeshHandle<V>) -> Result<(), Error>
pub fn delete_mesh<V>(&mut self, handle: MeshHandle<V>) -> Result<(), Error>
Deletes the mesh.
sourcepub fn create_view<P>(&mut self, view: View<P>) -> ViewHandlewhere
P: IntoProjection,
pub fn create_view<P>(&mut self, view: View<P>) -> ViewHandlewhere
P: IntoProjection,
Creates a new view.
sourcepub fn update_view<P>(
&mut self,
handle: ViewHandle,
view: View<P>
) -> Result<(), Error>where
P: IntoProjection,
pub fn update_view<P>(
&mut self,
handle: ViewHandle,
view: View<P>
) -> Result<(), Error>where
P: IntoProjection,
Updates the view.
sourcepub fn delete_view(&mut self, handle: ViewHandle) -> Result<(), Error>
pub fn delete_view(&mut self, handle: ViewHandle) -> Result<(), Error>
Deletes the view.
Auto Trait Implementations
impl !RefUnwindSafe for Context
impl Send for Context
impl !Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more