From 97745276b8865d632743ad62bab42d4abf22ee51 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 5 Feb 2024 14:53:54 +0100 Subject: [PATCH] Make `egui_wgpu::renderer` a private module All its contents is exported to the top-level --- crates/egui-wgpu/src/lib.rs | 8 ++++---- crates/egui-wgpu/src/renderer.rs | 1 - crates/egui_demo_app/src/apps/custom3d_wgpu.rs | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/crates/egui-wgpu/src/lib.rs b/crates/egui-wgpu/src/lib.rs index bb696aa28df..78def51dbb0 100644 --- a/crates/egui-wgpu/src/lib.rs +++ b/crates/egui-wgpu/src/lib.rs @@ -3,7 +3,7 @@ //! If you're targeting WebGL you also need to turn on the //! `webgl` feature of the `wgpu` crate: //! -//! ```ignore +//! ```toml //! # Enable both WebGL and WebGPU backends on web. //! wgpu = { version = "*", features = ["webgpu", "webgl"] } //! ``` @@ -21,9 +21,9 @@ pub use wgpu; /// Low-level painting of [`egui`](https://github.com/emilk/egui) on [`wgpu`]. -pub mod renderer; -pub use renderer::Renderer; -pub use renderer::{Callback, CallbackResources, CallbackTrait}; +mod renderer; + +pub use renderer::*; /// Module for painting [`egui`](https://github.com/emilk/egui) with [`wgpu`] on [`winit`]. #[cfg(feature = "winit")] diff --git a/crates/egui-wgpu/src/renderer.rs b/crates/egui-wgpu/src/renderer.rs index 5f5452bdeff..058ce928768 100644 --- a/crates/egui-wgpu/src/renderer.rs +++ b/crates/egui-wgpu/src/renderer.rs @@ -4,7 +4,6 @@ use std::{borrow::Cow, num::NonZeroU64, ops::Range}; use epaint::{ahash::HashMap, emath::NumExt, PaintCallbackInfo, Primitive, Vertex}; -use wgpu; use wgpu::util::DeviceExt as _; /// You can use this for storage when implementing [`CallbackTrait`]. diff --git a/crates/egui_demo_app/src/apps/custom3d_wgpu.rs b/crates/egui_demo_app/src/apps/custom3d_wgpu.rs index 24fb970d5f8..6b748cb1d74 100644 --- a/crates/egui_demo_app/src/apps/custom3d_wgpu.rs +++ b/crates/egui_demo_app/src/apps/custom3d_wgpu.rs @@ -2,7 +2,7 @@ use std::num::NonZeroU64; use eframe::{ egui_wgpu::wgpu::util::DeviceExt, - egui_wgpu::{self, renderer::ScreenDescriptor, wgpu}, + egui_wgpu::{self, wgpu}, }; pub struct Custom3d { @@ -148,7 +148,7 @@ impl egui_wgpu::CallbackTrait for CustomTriangleCallback { &self, device: &wgpu::Device, queue: &wgpu::Queue, - _screen_descriptor: &ScreenDescriptor, + _screen_descriptor: &egui_wgpu::ScreenDescriptor, _egui_encoder: &mut wgpu::CommandEncoder, resources: &mut egui_wgpu::CallbackResources, ) -> Vec {