[−][src]Struct sfml_rust::canvas::canvas_state::CanvasState
Canvas state is used for storage of texture and image buffers in addition to vertex buffers Canvas state also contains logic for writing the stored buffers to the command_buffer
Methods
impl CanvasState
[src]
pub fn window_size_dependent_setup(
&mut self,
images: &[Arc<SwapchainImage<Window>>]
) -> Vec<Arc<dyn FramebufferAbstract + Send + Sync>>
[src]
&mut self,
images: &[Arc<SwapchainImage<Window>>]
) -> Vec<Arc<dyn FramebufferAbstract + Send + Sync>>
This method is called once during initialization, then again whenever the window is resized
pub fn new(
queue: Arc<Queue>,
device: Arc<Device>,
physical: PhysicalDevice,
capabilities: Capabilities
) -> CanvasState
[src]
queue: Arc<Queue>,
device: Arc<Device>,
physical: PhysicalDevice,
capabilities: Capabilities
) -> CanvasState
Creates a Canvas State. Which at this point is pretty empty
pub fn create_image(
&mut self,
dimensions: (u32, u32),
usage: ImageUsage
) -> Arc<CanvasImageHandle>
[src]
&mut self,
dimensions: (u32, u32),
usage: ImageUsage
) -> Arc<CanvasImageHandle>
Using the dimensions and suggested usage, load a CanvasImage and return it's handle
pub fn get_image(
&self,
image_handle: Arc<CanvasImageHandle>
) -> Arc<AttachmentImage>
[src]
&self,
image_handle: Arc<CanvasImageHandle>
) -> Arc<AttachmentImage>
Return the image buffer from an input image handle
pub fn load_texture(
&mut self,
filename: String
) -> Option<Arc<CanvasTextureHandle>>
[src]
&mut self,
filename: String
) -> Option<Arc<CanvasTextureHandle>>
Load a texture using it's filename from a file. Returns the handle of the loaded texture
pub fn load_shader<T: 'static>(
&mut self,
filename: String,
physical: PhysicalDevice,
capabilities: Capabilities
) -> Option<Arc<CompiledGraphicsPipelineHandle>> where
T: CompiledGraphicsPipeline,
[src]
&mut self,
filename: String,
physical: PhysicalDevice,
capabilities: Capabilities
) -> Option<Arc<CompiledGraphicsPipelineHandle>> where
T: CompiledGraphicsPipeline,
Load and Compile a shader with the filename at resources/shaders Takes physical and capabilities as we don't store that in Canvas
pub fn load_font(&mut self, name: String) -> Arc<CanvasFontHandle>
[src]
Using the dimensions and suggested usage, load a CanvasImage and return it's handle
pub fn get_texture_handle(
&self,
texture_name: String
) -> Option<Arc<CanvasTextureHandle>>
[src]
&self,
texture_name: String
) -> Option<Arc<CanvasTextureHandle>>
Using the texture name, iterates through the stored textures and matches by the name
pub fn get_shader_handle(
&self,
shader_name: String
) -> Option<Arc<CompiledGraphicsPipelineHandle>>
[src]
&self,
shader_name: String
) -> Option<Arc<CompiledGraphicsPipelineHandle>>
Using the shader name, iterates through the stored shaders and matches by the name
pub fn get_font_handle(
&self,
font_name: String
) -> Option<Arc<CanvasFontHandle>>
[src]
&self,
font_name: String
) -> Option<Arc<CanvasFontHandle>>
Using the font name, iterates through the stored fonts and matches by the name
pub fn get_texture(
&self,
texture_handle: Arc<CanvasTextureHandle>
) -> Arc<ImmutableImage<Format>>
[src]
&self,
texture_handle: Arc<CanvasTextureHandle>
) -> Arc<ImmutableImage<Format>>
Using the texture handle, grab the stored texture and return the buffer
pub fn draw(&mut self, canvas_frame: CanvasFrame)
[src]
Scrape all the values from the CanvasFrame and then allocate the vertex buffers
pub fn draw_commands(
&mut self,
command_buffer: AutoCommandBufferBuilder,
framebuffers: Vec<Arc<dyn FramebufferAbstract + Send + Sync>>,
image_num: usize
) -> AutoCommandBufferBuilder
[src]
&mut self,
command_buffer: AutoCommandBufferBuilder,
framebuffers: Vec<Arc<dyn FramebufferAbstract + Send + Sync>>,
image_num: usize
) -> AutoCommandBufferBuilder
Pushes the draw commands to the command buffer. Requires the framebuffers and image number to be passed in as they are taken care of by the vkprocessor
Trait Implementations
impl Clone for CanvasState
[src]
fn clone(&self) -> CanvasState
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl !Send for CanvasState
impl Unpin for CanvasState
impl !Sync for CanvasState
impl !UnwindSafe for CanvasState
impl !RefUnwindSafe for CanvasState
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> SetParameter for T
[src]
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,