[][src]Struct sfml_rust::canvas::canvas_state::CanvasState

pub struct CanvasState { /* fields omitted */ }

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]

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]

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]

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]

Return the image buffer from an input image handle

pub fn load_texture(
    &mut self,
    filename: String
) -> Option<Arc<CanvasTextureHandle>>
[src]

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<CompiledShaderHandle>> where
    T: CompiledGraphicsPipeline
[src]

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]

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<CompiledShaderHandle>>
[src]

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]

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]

Using the texture handle, grab the stored texture and return the buffer

pub fn allocate(
    &mut self,
    canvas_frame: CanvasFrameTest
) -> CanvasFrameAllocation
[src]

Consume and allocated the canvas frame data to the GPU

pub fn draw_commands(
    &mut self,
    command_buffer: AutoCommandBufferBuilder,
    framebuffers: Vec<Arc<dyn FramebufferAbstract + Send + Sync>>,
    image_num: usize,
    allocated_buffers: CanvasFrameAllocation
) -> AutoCommandBufferBuilder
[src]

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]

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]

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for T[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.

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

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

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

impl<T> SetParameter for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> Content for T

impl<T> Erased for T

impl<T> SafeBorrow<T> for T