From 67f7f11363e62f09aa0e1288a17800e505860486 Mon Sep 17 00:00:00 2001 From: Seth Pyle Date: Thu, 6 Jun 2024 11:59:16 -0500 Subject: [PATCH] allocate texture data vec with room for 3 bytes per pixel --- imgui-glow-renderer/examples/glow_04_custom_textures.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui-glow-renderer/examples/glow_04_custom_textures.rs b/imgui-glow-renderer/examples/glow_04_custom_textures.rs index 2128ae3..bdf9e99 100644 --- a/imgui-glow-renderer/examples/glow_04_custom_textures.rs +++ b/imgui-glow-renderer/examples/glow_04_custom_textures.rs @@ -129,7 +129,7 @@ impl TexturesUi { const WIDTH: usize = 100; const HEIGHT: usize = 100; - let mut data = Vec::with_capacity(WIDTH * HEIGHT); + let mut data = Vec::with_capacity(WIDTH * HEIGHT * 3); for i in 0..WIDTH { for j in 0..HEIGHT { // Insert RGB values