From 7abe3894137f55aaa7aa0e0c491795342b6124bc Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 26 Aug 2026 17:39:17 +0200 Subject: feat(engine): add cube map support to UpdateTexture rendering commmand --- engine/src/rendering.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'engine/src/rendering.rs') 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), - // 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, }, 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 -- cgit v1.2.3-18-g5258