Make `egui_wgpu::renderer` a private module (#3979)

All its contents is exported to the top-level
This commit is contained in:
Emil Ernerfeldt 2024-02-05 15:12:59 +01:00 committed by GitHub
parent 1858167296
commit 217e066626
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 9 additions and 10 deletions

View File

@ -7,7 +7,7 @@ use raw_window_handle::{
use wasm_bindgen::JsValue;
use web_sys::HtmlCanvasElement;
use egui_wgpu::{renderer::ScreenDescriptor, RenderState, SurfaceErrorAction};
use egui_wgpu::{RenderState, SurfaceErrorAction};
use crate::WebOptions;
@ -233,7 +233,7 @@ impl WebPainter for WebPainterWgpu {
});
// Upload all resources for the GPU.
let screen_descriptor = ScreenDescriptor {
let screen_descriptor = egui_wgpu::ScreenDescriptor {
size_in_pixels,
pixels_per_point,
};

View File

@ -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")]

View File

@ -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`].

View File

@ -73,7 +73,7 @@ impl BufferPadding {
/// Everything you need to paint egui with [`wgpu`] on [`winit`].
///
/// Alternatively you can use [`crate::renderer`] directly.
/// Alternatively you can use [`crate::Renderer`] directly.
///
/// NOTE: all egui viewports share the same painter.
pub struct Painter {

View File

@ -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<wgpu::CommandBuffer> {