diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/render/Cargo.toml | 20 | ||||
-rw-r--r-- | examples/render/src/main.rs | 13 |
2 files changed, 24 insertions, 9 deletions
diff --git a/examples/render/Cargo.toml b/examples/render/Cargo.toml index 8a523e3..3144943 100644 --- a/examples/render/Cargo.toml +++ b/examples/render/Cargo.toml @@ -8,4 +8,22 @@ edition = "2018" stockton-render = { path = "../../stockton-render" } stockton-types = { path = "../../stockton-types" } stockton-bsp = "2.0.0" -winit = "0.19.1"
\ No newline at end of file +winit = "0.19.1" +log = "0.4.0" +simple_logger = "1.0" + +[target.'cfg(feature = "gl")'.dependencies.stockton-render] +path = "../../stockton-render" +features = ["gl"] + +# [target.'cfg(feature = "dx11")'.dependencies.stockton-render] +# path = "../../stockton-render" +# features = ["dx11"] + +# [target.'cfg(feature = "dx12")'.dependencies.stockton-render] +# path = "../../stockton-render" +# features = ["dx12"] + +# [target.'cfg(feature = "vulkan")'.dependencies.stockton-render] +# path = "../../stockton-render" +# features = ["vulkan"]
\ No newline at end of file diff --git a/examples/render/src/main.rs b/examples/render/src/main.rs index 044da4f..308a018 100644 --- a/examples/render/src/main.rs +++ b/examples/render/src/main.rs @@ -19,17 +19,18 @@ extern crate stockton_types; extern crate stockton_bsp; extern crate stockton_render; extern crate winit; +extern crate simple_logger; use stockton_bsp::BSPFile; use stockton_render::Renderer; use stockton_types::World; -use winit::{EventsLoop, Window}; - use std::sync::{Arc,RwLock}; - fn main() { + + simple_logger::init().unwrap(); + // Parse the BSP file. let data = include_bytes!("../13power.bsp"); let bsp = BSPFile::from_buffer(data).unwrap(); @@ -40,12 +41,8 @@ fn main() { None }).unwrap())); - // Create the window. - let events = EventsLoop::new(); - let window = Window::new(&events).unwrap(); - // Create the renderer. - let mut renderer = Renderer::new(world, &window).unwrap(); + let mut renderer = Renderer::new(world).unwrap(); loop { // TODO: Poll Window events |