[][src]Struct sfml_rust::canvas::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(
    &mut self,
    filename: String,
    physical: PhysicalDevice,
    capabilities: Capabilities
) -> Option<Arc<CanvasShaderHandle>>
[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 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<CanvasShaderHandle>>
[src]

Using the shader name, iterates through the stored textures 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 draw(&mut self, canvas_frame: CanvasFrame)[src]

Scrape all the values from the CanvasFrame and then allocate the vertex buffers

pub fn draw_commands(
    &self,
    command_buffer: AutoCommandBufferBuilder,
    framebuffers: Vec<Arc<dyn FramebufferAbstract + Send + Sync>>,
    image_num: usize
) -> 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]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for CanvasState

impl Sync for CanvasState

Blanket Implementations

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

impl<T, U> TryInto 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> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.

impl<T> Same for T

type Output = T

Should always be Self

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

impl<T> Content for T

impl<T> Erased for T

impl<T> SafeBorrow for T