#![no_std] extern crate alloc; pub mod pixel_format; mod engine_internals; use alloc::boxed::Box; use engine_internals::engine_startup; use pixel_format::Rgba64; use core::result::Result; use rhai::{EvalAltResult, Scope}; pub const SHADER: &str = include_str!("../shaders/simple.shade"); pub fn evaluate_shader(x: usize, y: usize, pixel: Rgba64) -> Result> { let engine = engine_startup(); let ast = engine.compile(SHADER)?; let mut scope = Scope::new(); scope.push("PIXEL_RGBA", pixel); scope.push("PIXEL_X", x); scope.push("PIXEL_Y", y); engine.call_fn(&mut scope, &ast, "main", ()) }