Update dependencies

This commit is contained in:
Piotr 2020-12-22 02:09:00 +01:00
parent e546a3cca6
commit 18860a165d
6 changed files with 20 additions and 17 deletions

View File

@ -6,18 +6,18 @@ edition = "2018"
[dependencies] [dependencies]
gl = "0.14.0" gl = "0.14.0"
imgui={version="0.4.0", optional=true} imgui={version="0.6.1", optional=true}
imgui-winit-support = {version="0.4.0", optional=true} imgui-winit-support = {version="0.6.1", optional=true}
imgui-opengl-renderer = {version="0.8", optional = true} imgui-opengl-renderer = {version="0.10.0", optional = true}
cgmath = {version="0.17.0", features=["serde"]} cgmath = {version="0.17.0", features=["serde"]}
imgui-inspect = {version="0.5.0", optional = true} imgui-inspect = {version="0.7.0", optional = true}
imgui-inspect-derive = {version="0.5.0", optional= true} imgui-inspect-derive = {version="0.7.0", optional= true}
tobj = "2.0.2" tobj = "2.0.2"
inline_tweak = "1.0.8" inline_tweak = "1.0.8"
log = "0.4.11" log = "0.4.11"
simple-logging = "2.0.2" simple-logging = "2.0.2"
image2 = { git = "https://github.com/Leinnan/image2-rs", branch="legacy", default-features = false, features=["io"] } image2 = { git = "https://github.com/Leinnan/image2-rs", branch="legacy", default-features = false, features=["io"] }
glutin = "0.24.1" glutin = "0.26.0"
serde = { version = "1.0.117", features = ["derive"] } serde = { version = "1.0.117", features = ["derive"] }
serde_json = "1.0.59" serde_json = "1.0.59"

View File

@ -102,6 +102,7 @@ impl Engine {
.with_resizable(true); .with_resizable(true);
let gl_window = glutin::ContextBuilder::new() let gl_window = glutin::ContextBuilder::new()
.with_gl_profile(glutin::GlProfile::Core)
.build_windowed(window, &event_loop) .build_windowed(window, &event_loop)
.unwrap(); .unwrap();
@ -227,7 +228,9 @@ impl Engine {
// other application-specific logic // other application-specific logic
#[cfg(feature = "imgui_inspect")] #[cfg(feature = "imgui_inspect")]
{ {
last_frame = imgui.io_mut().update_delta_time(last_frame); let now = Instant::now();
imgui.io_mut().update_delta_time(now - last_frame);
last_frame = now;
} }
} }
Event::MainEventsCleared => { Event::MainEventsCleared => {

View File

@ -31,7 +31,7 @@ impl InspectRenderDefault<Vector3<f32>> for CgmathVec3f32 {
let mut change = false; let mut change = false;
for el in data.iter_mut() { for el in data.iter_mut() {
let mut array: [f32; 3] = [el.x, el.y, el.z]; let mut array: [f32; 3] = [el.x, el.y, el.z];
change |= ui.drag_float3(&label_im, &mut array).build(); change |= ui.input_float3(&label_im, &mut array).build();
el.x = array[0]; el.x = array[0];
el.y = array[1]; el.y = array[1];
el.z = array[2]; el.z = array[2];
@ -66,7 +66,7 @@ impl InspectRenderDefault<Point3<f32>> for CgmathPoint3f32 {
let mut change = false; let mut change = false;
for el in data.iter_mut() { for el in data.iter_mut() {
let mut array: [f32; 3] = [el.x, el.y, el.z]; let mut array: [f32; 3] = [el.x, el.y, el.z];
change |= ui.drag_float3(&label_im, &mut array).build(); change |= ui.input_float3(&label_im, &mut array).build();
el.x = array[0]; el.x = array[0];
el.y = array[1]; el.y = array[1];
el.z = array[2]; el.z = array[2];

View File

@ -16,7 +16,7 @@ use crate::shader::Shader;
// Depending on how you pass the data to OpenGL, this may be bad. In this case it's not strictly // Depending on how you pass the data to OpenGL, this may be bad. In this case it's not strictly
// necessary though because of the `offset!` macro used below in setupMesh() // necessary though because of the `offset!` macro used below in setupMesh()
#[repr(C)] #[repr(C)]
#[derive(Clone)] #[derive(Clone,Debug)]
pub struct Vertex { pub struct Vertex {
// position // position
pub position: Vector3<f32>, pub position: Vector3<f32>,
@ -42,7 +42,7 @@ impl Default for Vertex {
} }
} }
#[derive(Clone)] #[derive(Clone,Debug)]
pub struct Texture { pub struct Texture {
pub id: u32, pub id: u32,
pub type_: String, pub type_: String,
@ -57,7 +57,7 @@ impl Drop for Texture {
} }
} }
#[derive(Clone)] #[derive(Clone,Debug)]
pub struct Mesh { pub struct Mesh {
/* Mesh Data */ /* Mesh Data */
pub vertices: Vec<Vertex>, pub vertices: Vec<Vertex>,

View File

@ -9,7 +9,7 @@ use log::{info, warn};
use std::path::Path; use std::path::Path;
use tobj; use tobj;
#[derive(Clone)] #[derive(Clone,Debug)]
pub struct Model { pub struct Model {
/* Model Data */ /* Model Data */
pub meshes: Vec<Mesh>, pub meshes: Vec<Mesh>,

View File

@ -210,7 +210,8 @@ impl Client for ExampleClient {
.size([250.0, 250.0], Condition::FirstUseEver) .size([250.0, 250.0], Condition::FirstUseEver)
.opened(&mut show_window) .opened(&mut show_window)
.build(&ui, || { .build(&ui, || {
ui.drag_int(im_str!("id"), &mut id).min(0).max(max).build(); ui.input_int(im_str!("id"), &mut id).build();
id = if id < 0 { 0 } else if id > max { max } else { id };
let mut selected_mut = vec![&mut self.models[id as usize].transform]; let mut selected_mut = vec![&mut self.models[id as usize].transform];
<Transform as imgui_inspect::InspectRenderStruct<Transform>>::render_mut( <Transform as imgui_inspect::InspectRenderStruct<Transform>>::render_mut(
@ -244,10 +245,9 @@ impl Client for ExampleClient {
); );
} }
ui.separator(); ui.separator();
ui.drag_int(im_str!("Light ID"), &mut id) ui.input_int(im_str!("Light ID"), &mut id)
.min(0)
.max(max)
.build(); .build();
id = if id < 0 { 0 } else if id > max { max } else { id };
{ {
let mut selected_mut = let mut selected_mut =
vec![&mut self.lighting_system.point_lights[id as usize]]; vec![&mut self.lighting_system.point_lights[id as usize]];