diff options
Diffstat (limited to 'engine/src/rendering.rs')
| -rw-r--r-- | engine/src/rendering.rs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/engine/src/rendering.rs b/engine/src/rendering.rs index 2a73625..572f045 100644 --- a/engine/src/rendering.rs +++ b/engine/src/rendering.rs @@ -25,7 +25,7 @@ use crate::rendering::blending::Config as BlendingConfig; use crate::rendering::object::{Id as ObjectId, Store as ObjectStore}; use crate::rendering::shader::cursor::Binding as ShaderBinding; use crate::rendering::shader::Program as ShaderProgram; -use crate::texture::Texture; +use crate::texture::{CubeMapFace, Texture}; use crate::vector::Vec2; use crate::windowing::dpi::PhysicalSize; use crate::windowing::window::Window; @@ -216,11 +216,14 @@ pub enum Command ActivateShader(ObjectId), SetShaderBinding(ShaderBinding), CreateTexture(ObjectId, AssetOrValue<Texture>), - // TODO: Make UpdateTexture command able to handle textures other than 2D textures UpdateTexture { obj_id: ObjectId, image: Image, + update: TextureUpdate, + + /// Specifies texel index offsets in the x and y directions within the texture + /// pixels. offset: Vec2<u32>, }, RemoveTexture(ObjectId), @@ -399,6 +402,17 @@ bitflags! { } } +#[derive(Debug, Clone)] +#[non_exhaustive] +pub enum TextureUpdate +{ + Texture2D, + CubeMap + { + face: CubeMapFace, + }, +} + /// Rendering command FIFO queue. #[derive(Debug, Sole)] pub struct CommandQueue |
