1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 06:40:06 -04:00

WGPU implementation

This commit is contained in:
Konkitoman
2023-07-27 18:18:14 +03:00
parent 46e85856b9
commit 769c71a714
5 changed files with 552 additions and 338 deletions

View File

@@ -4,6 +4,7 @@ use eframe::{
egui_wgpu::wgpu::util::DeviceExt,
egui_wgpu::{self, wgpu},
};
use egui::ViewportRender;
pub struct Custom3d {
angle: f32,
@@ -96,7 +97,16 @@ impl Custom3d {
}
impl eframe::App for Custom3d {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
fn update(
&mut self,
ctx: &egui::Context,
frame: &mut eframe::Frame,
render: Option<&ViewportRender>,
) {
if let Some(render) = render {
render(ctx, frame.viewport_id(), frame.parent_viewport_id());
return;
}
egui::CentralPanel::default().show(ctx, |ui| {
egui::ScrollArea::both()
.auto_shrink([false; 2])