summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorRosyid Haryadi <rosyid_haryadi@protonmail.com>2025-03-05 10:23:58 +0700
committerRosyid Haryadi <rosyid_haryadi@protonmail.com>2025-03-05 10:23:58 +0700
commitec4612427a5ce743ba0759227eaa422dd1ff9b0e (patch)
tree4b17557a63963a64241a4707fcc52f41c4612f88 /src/main.rs
parent9f25ab78396c155a6d73d7c5676d489d7ee66b76 (diff)
upd switch display buffer to vec. large array somehow causing stack overflow in windows
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 386810e..9696840 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -13,7 +13,7 @@ use crate::object::{HittableList, Sphere};
use crate::view::{render_viewer, View};
fn main() {
- let mut display_buffer: DisplayBuffer = [[Pixel::default(); IMG_WIDTH]; IMG_HEIGHT];
+ let mut display_buffer: DisplayBuffer = vec![Vec::from([Pixel::default(); IMG_WIDTH]); IMG_HEIGHT];
let mut world = HittableList::new();
let ground = Material::new(Color::from_name(ColorName::Gray), MaterialType::Diffuse);