ft: added dotenv for .env file

This commit is contained in:
2026-04-20 12:46:03 +02:00
parent 1920376e34
commit 66c6bf438b
5 changed files with 12 additions and 0 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
/target /target
output.png output.png
.env

7
Cargo.lock generated
View File

@@ -280,6 +280,12 @@ version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"
[[package]]
name = "dotenv"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f"
[[package]] [[package]]
name = "either" name = "either"
version = "1.15.0" version = "1.15.0"
@@ -1227,6 +1233,7 @@ dependencies = [
name = "raytracing" name = "raytracing"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"dotenv",
"image", "image",
"is_close", "is_close",
"log", "log",

View File

@@ -4,6 +4,7 @@ version = "0.1.0"
edition = "2024" edition = "2024"
[dependencies] [dependencies]
dotenv = "0.15.0"
image = "0.25.10" image = "0.25.10"
is_close = "0.1.3" is_close = "0.1.3"
log = "0.4.29" log = "0.4.29"

1
env.example Normal file
View File

@@ -0,0 +1 @@
RUST_LOG=info

View File

@@ -13,9 +13,11 @@ use crate::objects::materials::lambertian::{Lambertian, Metal};
use crate::objects::sphere::Sphere; use crate::objects::sphere::Sphere;
use crate::ray::Ray; use crate::ray::Ray;
use crate::vec3::Vec3; use crate::vec3::Vec3;
use dotenv::dotenv;
use pretty_env_logger; use pretty_env_logger;
fn main() { fn main() {
dotenv().ok();
pretty_env_logger::init(); pretty_env_logger::init();
// setup objects // setup objects