From 9f6e9c94d69be62d1f2cc21f128829c3e8f4951f Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Fri, 8 May 2020 22:25:28 +0200 Subject: [PATCH] Merge struct Emigui into Context --- emigui/README.md | 2 +- emigui/src/context.rs | 191 +++++++++++++++++++++++++++++++++++--- emigui/src/emigui.rs | 152 ------------------------------ emigui/src/lib.rs | 2 - emigui/src/mesher.rs | 19 +--- example_glium/src/main.rs | 16 ++-- example_wasm/src/lib.rs | 26 +++--- 7 files changed, 205 insertions(+), 203 deletions(-) delete mode 100644 emigui/src/emigui.rs diff --git a/emigui/README.md b/emigui/README.md index 3fe020a2..a6e00051 100644 --- a/emigui/README.md +++ b/emigui/README.md @@ -84,7 +84,7 @@ Add extremely quick animations for some things, maybe 2-3 frames. For instance: ### Names and structure * [ ] Rename things to be more consistent with Dear ImGui -* [ ] Combine Emigui and Context? +* [x] Combine Emigui and Context? * [ ] Solve which parts of Context are behind a mutex * [ ] All of Context behind one mutex? * [ } Break up Context into Input, State, Output ? diff --git a/emigui/src/context.rs b/emigui/src/context.rs index fad63cf4..6cfd1dfd 100644 --- a/emigui/src/context.rs +++ b/emigui/src/context.rs @@ -4,6 +4,14 @@ use parking_lot::Mutex; use crate::{layout::align_rect, *}; +#[derive(Clone, Copy, Default)] +struct PaintStats { + num_batches: usize, + num_primitives: usize, + num_vertices: usize, + num_triangles: usize, +} + /// Contains the input, style and output of all GUI commands. /// Regions keep an Arc pointer to this. /// This allows us to create several child regions at once, @@ -11,10 +19,11 @@ use crate::{layout::align_rect, *}; pub struct Context { /// The default style for new regions style: Mutex