From 872011e0baa19a1fed4202dc02a467c6a15d4677 Mon Sep 17 00:00:00 2001 From: Erlend Powell Date: Wed, 21 Aug 2024 00:29:43 +1200 Subject: [PATCH] Added Rgb24 format. --- crates/notan_glow/src/texture.rs | 1 + crates/notan_graphics/src/texture.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/crates/notan_glow/src/texture.rs b/crates/notan_glow/src/texture.rs index 287aa5c6..0ec647b2 100644 --- a/crates/notan_glow/src/texture.rs +++ b/crates/notan_glow/src/texture.rs @@ -203,6 +203,7 @@ pub(crate) fn texture_type(tf: &TextureFormat) -> u32 { pub(crate) fn texture_format(tf: &TextureFormat) -> u32 { match tf { + TextureFormat::Rgb24 => glow::RGB, TextureFormat::Rgba32 => glow::RGBA, TextureFormat::Rgba32Float => RGBA, TextureFormat::R8 => glow::RED, diff --git a/crates/notan_graphics/src/texture.rs b/crates/notan_graphics/src/texture.rs index 14333183..c97a2e19 100644 --- a/crates/notan_graphics/src/texture.rs +++ b/crates/notan_graphics/src/texture.rs @@ -81,6 +81,7 @@ impl TextureFormat { R8 => 1, R8Uint => 1, R16Uint => 2, + Rgb24 => 3, Rgba32Float => 4 * 4, _ => 4, } @@ -249,6 +250,7 @@ impl AsRef for Texture { #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub enum TextureFormat { SRgba8, + Rgb24, Rgba32, R8, R8Uint,