Struct crayon::graphics::GraphicsSystemShared
[−]
[src]
pub struct GraphicsSystemShared { /* fields omitted */ }
The multi-thread friendly parts of GraphicsSystem
.
Methods
impl GraphicsSystemShared
[src]
pub fn dimensions(&self) -> (u32, u32)
[src]
Returns the size in points of the client area of the window.
The client area is the content of the window, excluding the title bar and borders.
pub fn dimensions_in_pixels(&self) -> (u32, u32)
[src]
Returns the size in pixels of the client area of the window.
The client area is the content of the window, excluding the title bar and borders. These are the dimensions of the frame buffer.
pub fn submit<'a, T1, T2>(
&self,
s: SurfaceHandle,
o: T1,
task: T2
) -> Result<()> where
T1: Into<u64>,
T2: Into<Command<'a>>,
[src]
&self,
s: SurfaceHandle,
o: T1,
task: T2
) -> Result<()> where
T1: Into<u64>,
T2: Into<Command<'a>>,
Submit a task into named bucket.
Tasks inside bucket will be executed in sequential order.
impl GraphicsSystemShared
[src]
pub fn create_surface(&self, setup: SurfaceSetup) -> Result<SurfaceHandle>
[src]
Creates an view with SurfaceSetup
.
pub fn surface(&self, handle: MeshHandle) -> Option<SurfaceParams>
[src]
Gets the SurfaceParams
if available.
pub fn is_surface_alive(&self, handle: SurfaceHandle) -> bool
[src]
Returns true if shader is exists.
pub fn delete_surface(&self, handle: SurfaceHandle)
[src]
Delete surface object.
impl GraphicsSystemShared
[src]
pub fn lookup_shader(&self, location: Location) -> Option<ShaderHandle>
[src]
Lookup shader object from location.
pub fn create_shader(&self, setup: ShaderSetup) -> Result<ShaderHandle>
[src]
Create a shader with initial shaders and render state. Pipeline encapusulate all the informations we need to configurate OpenGL before real drawing.
pub fn shader(&self, handle: MeshHandle) -> Option<ShaderParams>
[src]
Gets the ShaderParams
if available.
pub fn is_shader_alive(&self, handle: ShaderHandle) -> bool
[src]
Returns true if shader is exists.
pub fn delete_shader(&self, handle: ShaderHandle)
[src]
Delete shader state object.
impl GraphicsSystemShared
[src]
pub fn lookup_mesh(&self, location: Location) -> Option<MeshHandle>
[src]
Lookup mesh object from location.
pub fn create_mesh_from_file<T>(&self, setup: MeshSetup) -> Result<MeshHandle> where
T: MeshParser + Send + Sync + 'static,
[src]
T: MeshParser + Send + Sync + 'static,
Create a new mesh object from location.
pub fn create_mesh(&self, setup: MeshSetup) -> Result<MeshHandle>
[src]
Create a new mesh object.
pub fn mesh(&self, handle: MeshHandle) -> Option<Arc<MeshParams>>
[src]
Gets the MeshParams
if available.
Notes that this function might returns None
even if is_mesh_alive
returns
true. The underlying object might be still in creation process and can not be
provided yet.
pub fn is_mesh_alive(&self, handle: MeshHandle) -> bool
[src]
Checks whether the mesh is exists.
pub fn update_vertex_buffer(
&self,
mesh: MeshHandle,
offset: usize,
data: &[u8]
) -> Result<()>
[src]
&self,
mesh: MeshHandle,
offset: usize,
data: &[u8]
) -> Result<()>
Update a subset of dynamic vertex buffer. Use offset
specifies the offset
into the buffer object's data store where data replacement will begin, measured
in bytes.
pub fn update_index_buffer(
&self,
mesh: MeshHandle,
offset: usize,
data: &[u8]
) -> Result<()>
[src]
&self,
mesh: MeshHandle,
offset: usize,
data: &[u8]
) -> Result<()>
Update a subset of dynamic index buffer. Use offset
specifies the offset
into the buffer object's data store where data replacement will begin, measured
in bytes.
pub fn delete_mesh(&self, mesh: MeshHandle)
[src]
Delete mesh object.
impl GraphicsSystemShared
[src]
pub fn lookup_texture(&self, location: Location) -> Option<TextureHandle>
[src]
Lookup texture object from location.
pub fn create_texture_from_file<T>(
&self,
setup: TextureSetup
) -> Result<TextureHandle> where
T: TextureParser + Send + Sync + 'static,
[src]
&self,
setup: TextureSetup
) -> Result<TextureHandle> where
T: TextureParser + Send + Sync + 'static,
Create texture object from location.
pub fn create_texture(&self, setup: TextureSetup) -> Result<TextureHandle>
[src]
Create texture object. A texture is an image loaded in video memory, which can be sampled in shaders.
pub fn texture(&self, handle: TextureHandle) -> Option<TextureParams>
[src]
Gets the TextureParams
if available.
Notes that this function might returns None
even if is_texture_alive
returns
true. The underlying object might be still in creation process and can not be
provided yet.
pub fn is_texture_alive(&self, handle: TextureHandle) -> bool
[src]
Returns true if texture is exists.
pub fn update_texture(
&self,
handle: TextureHandle,
rect: Aabb2<f32>,
data: &[u8]
) -> Result<()>
[src]
&self,
handle: TextureHandle,
rect: Aabb2<f32>,
data: &[u8]
) -> Result<()>
Update a contiguous subregion of an existing two-dimensional texture object.
pub fn delete_texture(&self, handle: TextureHandle)
[src]
Delete the texture object.
impl GraphicsSystemShared
[src]
pub fn create_render_texture(
&self,
setup: RenderTextureSetup
) -> Result<RenderTextureHandle>
[src]
&self,
setup: RenderTextureSetup
) -> Result<RenderTextureHandle>
Create render texture object, which could be attached with a framebuffer.
pub fn render_texture(&self, handle: MeshHandle) -> Option<RenderTextureParams>
[src]
Gets the RenderTextureParams
if available.
pub fn is_render_texture_alive(&self, handle: RenderTextureHandle) -> bool
[src]
Returns true if texture is exists.
pub fn delete_render_texture(&self, handle: RenderTextureHandle)
[src]
Delete the render texture object.