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]
gl = "0.14.0"
imgui={version="0.4.0", optional=true}
imgui-winit-support = {version="0.4.0", optional=true}
imgui-opengl-renderer = {version="0.8", optional = true}
imgui={version="0.6.1", optional=true}
imgui-winit-support = {version="0.6.1", optional=true}
imgui-opengl-renderer = {version="0.10.0", optional = true}
cgmath = {version="0.17.0", features=["serde"]}
imgui-inspect = {version="0.5.0", optional = true}
imgui-inspect-derive = {version="0.5.0", optional= true}
imgui-inspect = {version="0.7.0", optional = true}
imgui-inspect-derive = {version="0.7.0", optional= true}
tobj = "2.0.2"
inline_tweak = "1.0.8"
log = "0.4.11"
simple-logging = "2.0.2"
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_json = "1.0.59"

View File

@ -102,6 +102,7 @@ impl Engine {
.with_resizable(true);
let gl_window = glutin::ContextBuilder::new()
.with_gl_profile(glutin::GlProfile::Core)
.build_windowed(window, &event_loop)
.unwrap();
@ -227,7 +228,9 @@ impl Engine {
// other application-specific logic
#[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 => {

View File

@ -31,7 +31,7 @@ impl InspectRenderDefault<Vector3<f32>> for CgmathVec3f32 {
let mut change = false;
for el in data.iter_mut() {
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.y = array[1];
el.z = array[2];
@ -66,7 +66,7 @@ impl InspectRenderDefault<Point3<f32>> for CgmathPoint3f32 {
let mut change = false;
for el in data.iter_mut() {
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.y = array[1];
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
// necessary though because of the `offset!` macro used below in setupMesh()
#[repr(C)]
#[derive(Clone)]
#[derive(Clone,Debug)]
pub struct Vertex {
// position
pub position: Vector3<f32>,
@ -42,7 +42,7 @@ impl Default for Vertex {
}
}
#[derive(Clone)]
#[derive(Clone,Debug)]
pub struct Texture {
pub id: u32,
pub type_: String,
@ -57,7 +57,7 @@ impl Drop for Texture {
}
}
#[derive(Clone)]
#[derive(Clone,Debug)]
pub struct Mesh {
/* Mesh Data */
pub vertices: Vec<Vertex>,

View File

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

View File

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