[−][src]Struct sfml_rust::canvas::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(
&mut self,
filename: String,
physical: PhysicalDevice,
capabilities: Capabilities
) -> Option<Arc<CanvasShaderHandle>>
[src]
&mut self,
filename: String,
physical: PhysicalDevice,
capabilities: Capabilities
) -> Option<Arc<CanvasShaderHandle>>
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]
&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<CanvasShaderHandle>>
[src]
&self,
shader_name: String
) -> Option<Arc<CanvasShaderHandle>>
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]
&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(
&self,
command_buffer: AutoCommandBufferBuilder,
framebuffers: Vec<Arc<dyn FramebufferAbstract + Send + Sync>>,
image_num: usize
) -> AutoCommandBufferBuilder
[src]
&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]
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]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto 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> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
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>,
SS: SubsetOf<SP>,