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:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user