You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

86 lines
1.8 KiB

#![cfg(not(test))]
use blonkus_fw::*;
fn entry(_conf: &conf::Conf) -> Result<(), Box<dyn std::error::Error>> {
//let start_time = std::time::Instant::now();
/*
let mut vfs = data::vfs::Vfs::default();
vfs.add_arc(data::vfs::Arc::read_path("testres".as_ref())?);
*/
//blonkus_fw::vire::rt::Rt::new()?;
/*
let hal = hal::ctx::Context::new()?;
let window = hal::win::Window::new(&hal, meta::ffi::NAME, 640, 480)?;
let mut ren = render::Renderer::new(
&window,
&conf.render,
&[
data::shader::Module::read(
vfs.get("shaders/main.vert.o.gz")?.data(),
data::shader::Stage::Vertex,
"main",
),
data::shader::Module::read(
vfs.get("shaders/main.frag.o.gz")?.data(),
data::shader::Stage::Fragment,
"main",
),
],
)?;
/*
let img = {
let arc = data::vfs::Arc::read_tar(
&mut vfs.get("scientist/hltex000.texture")?.data(),
)?;
let img = data::image::MipImage::read(&*arc)?;
Image::from_indep(IndepImage::create(&cmd_pool, &img)?)
};
let img_view = ImageView::create(img)?;
let img_sampler = Sampler::create(device.clone(), &conf.render)?;
let model = data::model::Model::read(&mut Cursor::new(
vfs.get("scientist/scientist.iqm")?.data(),
))?;
let model = Model::create(&cmd_pool, model.0, model.1)?;
*/
'main_loop: loop {
// FIXME: can remove allow once this has more events
#[allow(clippy::never_loop)]
for event in hal::evt::EventIterator {
match event {
| hal::evt::Event::Quit => break 'main_loop,
}
}
ren.draw_frame()?;
}
*/
Ok(())
}
fn main() {
let conf = conf::Conf::read("blonkus.toml").unwrap_or_else(|err| {
match err {
| conf::ErrConfLoad::NoFile => println!("{}", err),
| _ => eprintln!("{}", err),
};
println!("Using default configuration.");
conf::Conf::default()
});
if let Err(e) = entry(&conf) {
eprintln!("Uncaught error: {}", e);
}
}
// EOF