MCPcopy Create free account
hub / github.com/AryanpurTech/BlueEngine / main

Function main

examples/utils/headless.rs:38–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36}
37
38fn main() -> Result<(), blue_engine::error::Error> {
39 let mut engine = Engine::new_config(EngineSettings {
40 // The width and height must be respecting of the 256 padding
41 height: 1024,
42 width: 1024,
43 ..Default::default()
44 })?;
45
46 triangle(
47 "trig",
48 ObjectSettings::default(),
49 &mut engine.renderer,
50 &mut engine.objects,
51 )?;
52
53 // let instant = std::time::Instant::now();
54 engine.update_loop(move |_engine| {
55 #[cfg(feature = "headless")]
56 output_image_native(
57 _engine.renderer.headless_texture_data.clone(),
58 (
59 // since we do not have a window, the width and
60 // height is taken from the configuration of the renderer
61 _engine.renderer.config.width as usize,
62 _engine.renderer.config.height as usize,
63 ),
64 "img.png",
65 );
66 })?;
67 Ok(())
68}

Callers

nothing calls this directly

Calls 3

triangleFunction · 0.85
output_image_nativeFunction · 0.85
update_loopMethod · 0.80

Tested by

no test coverage detected