1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

Refactor example code

This commit is contained in:
Emil Ernerfeldt
2020-04-12 12:07:51 +02:00
parent 4889296f7a
commit d999962602
13 changed files with 402 additions and 343 deletions

View File

@@ -4,6 +4,7 @@ use std::time::{Duration, Instant};
use {
emigui::{
example_app::ExampleApp,
label,
math::vec2,
widgets::{Button, Label},
@@ -37,6 +38,8 @@ fn main() {
let mut frame_start = Instant::now();
let mut example_app = ExampleApp::default();
while !quit {
{
// Keep smooth frame rate. TODO: proper vsync
@@ -85,7 +88,8 @@ fn main() {
if region.add(Button::new("Quit")).clicked {
quit = true;
}
emigui.example(&mut region);
example_app.ui(&mut region);
emigui.ui(&mut region);
let mesh = emigui.paint();
painter.paint(&display, mesh, emigui.texture());
}