mirror of https://github.com/Leinnan/doppler.git
Less dependencies in example crate
This commit is contained in:
parent
0070890092
commit
67cb813f35
|
|
@ -257,12 +257,7 @@ dependencies = [
|
||||||
name = "doppler_example"
|
name = "doppler_example"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cgmath",
|
|
||||||
"doppler",
|
"doppler",
|
||||||
"glutin",
|
|
||||||
"imgui",
|
|
||||||
"imgui-inspect",
|
|
||||||
"imgui-inspect-derive",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,6 @@ lto = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
doppler = {path="doppler"}
|
doppler = {path="doppler"}
|
||||||
glutin = "0.24.1"
|
|
||||||
cgmath = "0.17.0"
|
|
||||||
imgui="0.4.0"
|
|
||||||
imgui-inspect = "0.5.0"
|
|
||||||
imgui-inspect-derive = "0.5.0"
|
|
||||||
|
|
||||||
[profile.dev.package."*"]
|
[profile.dev.package."*"]
|
||||||
opt-level = 2
|
opt-level = 2
|
||||||
|
|
@ -1,14 +1,11 @@
|
||||||
pub extern crate gl;
|
pub extern crate gl;
|
||||||
pub extern crate glutin;
|
|
||||||
|
|
||||||
#[cfg(feature = "imgui_inspect")]
|
|
||||||
pub extern crate imgui;
|
pub extern crate imgui;
|
||||||
pub extern crate log;
|
pub extern crate log;
|
||||||
pub extern crate simple_logging;
|
pub extern crate simple_logging;
|
||||||
|
|
||||||
pub use cgmath::*;
|
pub use cgmath as math;
|
||||||
pub use glutin::*;
|
pub use glutin;
|
||||||
pub use imgui::*;
|
pub use imgui_inspect;
|
||||||
|
|
||||||
pub mod macros;
|
pub mod macros;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
use crate::doppler::assets_cache::AssetsCache;
|
use doppler::assets_cache::AssetsCache;
|
||||||
use crate::doppler::camera::*;
|
use doppler::camera::*;
|
||||||
use crate::doppler::client::Client;
|
use doppler::client::Client;
|
||||||
use crate::doppler::components::{ModelComponent, Transform};
|
use doppler::components::{ModelComponent, Transform};
|
||||||
use crate::doppler::consts;
|
use doppler::consts;
|
||||||
use crate::doppler::light::*;
|
use doppler::light::*;
|
||||||
use crate::doppler::sky::Sky;
|
use doppler::sky::Sky;
|
||||||
use cgmath::prelude::*;
|
use doppler::math::prelude::*;
|
||||||
use cgmath::{perspective, vec3, Deg, Matrix4, Point3};
|
use doppler::math::{perspective, vec3, Deg, Matrix4, Point3};
|
||||||
use glutin::event::{ElementState, VirtualKeyCode};
|
use doppler::glutin::event::{ElementState, VirtualKeyCode};
|
||||||
use imgui::*;
|
use doppler::imgui::*;
|
||||||
|
|
||||||
pub struct ExampleClient {
|
pub struct ExampleClient {
|
||||||
models: Vec<ModelComponent>,
|
models: Vec<ModelComponent>,
|
||||||
|
|
@ -149,8 +149,7 @@ impl Client for ExampleClient {
|
||||||
self.delta = delta;
|
self.delta = delta;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn debug_draw(&mut self, ui: &imgui::Ui) {
|
fn debug_draw(&mut self, ui: &doppler::imgui::Ui) {
|
||||||
use imgui::*;
|
|
||||||
if let Some(menu_bar) = ui.begin_main_menu_bar() {
|
if let Some(menu_bar) = ui.begin_main_menu_bar() {
|
||||||
if let Some(menu) = ui.begin_menu(im_str!("Basic"), true) {
|
if let Some(menu) = ui.begin_menu(im_str!("Basic"), true) {
|
||||||
if MenuItem::new(im_str!("Show Object info"))
|
if MenuItem::new(im_str!("Show Object info"))
|
||||||
|
|
@ -177,7 +176,7 @@ impl Client for ExampleClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
use imgui_inspect::InspectArgsStruct;
|
use doppler::imgui_inspect;
|
||||||
|
|
||||||
if self.show_camera_info {
|
if self.show_camera_info {
|
||||||
Window::new(im_str!("CameraInfo"))
|
Window::new(im_str!("CameraInfo"))
|
||||||
|
|
@ -218,7 +217,7 @@ impl Client for ExampleClient {
|
||||||
&mut selected_mut,
|
&mut selected_mut,
|
||||||
"Object info",
|
"Object info",
|
||||||
&ui,
|
&ui,
|
||||||
&InspectArgsStruct::default(),
|
&imgui_inspect::InspectArgsStruct::default(),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
self.object_info_id = id;
|
self.object_info_id = id;
|
||||||
|
|
@ -241,7 +240,7 @@ impl Client for ExampleClient {
|
||||||
&mut selected_mut,
|
&mut selected_mut,
|
||||||
"DirectionalLightInfo",
|
"DirectionalLightInfo",
|
||||||
&ui,
|
&ui,
|
||||||
&InspectArgsStruct::default(),
|
&imgui_inspect::InspectArgsStruct::default(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
ui.separator();
|
ui.separator();
|
||||||
|
|
@ -256,7 +255,7 @@ impl Client for ExampleClient {
|
||||||
&mut selected_mut,
|
&mut selected_mut,
|
||||||
"PointLightInfo",
|
"PointLightInfo",
|
||||||
&ui,
|
&ui,
|
||||||
&InspectArgsStruct::default(),
|
&imgui_inspect::InspectArgsStruct::default(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
10
src/main.rs
10
src/main.rs
|
|
@ -1,16 +1,8 @@
|
||||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
extern crate doppler;
|
extern crate doppler;
|
||||||
|
|
||||||
mod example_client;
|
mod example_client;
|
||||||
|
|
||||||
use doppler::engine::Engine;
|
|
||||||
use crate::example_client::ExampleClient;
|
use crate::example_client::ExampleClient;
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
|
doppler::engine::Engine::default().run::<ExampleClient>();
|
||||||
let engine = Engine::default();
|
|
||||||
|
|
||||||
engine.run::<ExampleClient>();
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue