Make `egui_wgpu::renderer` a private module (#3979)
All its contents is exported to the top-level
This commit is contained in:
parent
1858167296
commit
217e066626
|
|
@ -7,7 +7,7 @@ use raw_window_handle::{
|
||||||
use wasm_bindgen::JsValue;
|
use wasm_bindgen::JsValue;
|
||||||
use web_sys::HtmlCanvasElement;
|
use web_sys::HtmlCanvasElement;
|
||||||
|
|
||||||
use egui_wgpu::{renderer::ScreenDescriptor, RenderState, SurfaceErrorAction};
|
use egui_wgpu::{RenderState, SurfaceErrorAction};
|
||||||
|
|
||||||
use crate::WebOptions;
|
use crate::WebOptions;
|
||||||
|
|
||||||
|
|
@ -233,7 +233,7 @@ impl WebPainter for WebPainterWgpu {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Upload all resources for the GPU.
|
// Upload all resources for the GPU.
|
||||||
let screen_descriptor = ScreenDescriptor {
|
let screen_descriptor = egui_wgpu::ScreenDescriptor {
|
||||||
size_in_pixels,
|
size_in_pixels,
|
||||||
pixels_per_point,
|
pixels_per_point,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
//! If you're targeting WebGL you also need to turn on the
|
//! If you're targeting WebGL you also need to turn on the
|
||||||
//! `webgl` feature of the `wgpu` crate:
|
//! `webgl` feature of the `wgpu` crate:
|
||||||
//!
|
//!
|
||||||
//! ```ignore
|
//! ```toml
|
||||||
//! # Enable both WebGL and WebGPU backends on web.
|
//! # Enable both WebGL and WebGPU backends on web.
|
||||||
//! wgpu = { version = "*", features = ["webgpu", "webgl"] }
|
//! wgpu = { version = "*", features = ["webgpu", "webgl"] }
|
||||||
//! ```
|
//! ```
|
||||||
|
|
@ -21,9 +21,9 @@
|
||||||
pub use wgpu;
|
pub use wgpu;
|
||||||
|
|
||||||
/// Low-level painting of [`egui`](https://github.com/emilk/egui) on [`wgpu`].
|
/// Low-level painting of [`egui`](https://github.com/emilk/egui) on [`wgpu`].
|
||||||
pub mod renderer;
|
mod renderer;
|
||||||
pub use renderer::Renderer;
|
|
||||||
pub use renderer::{Callback, CallbackResources, CallbackTrait};
|
pub use renderer::*;
|
||||||
|
|
||||||
/// Module for painting [`egui`](https://github.com/emilk/egui) with [`wgpu`] on [`winit`].
|
/// Module for painting [`egui`](https://github.com/emilk/egui) with [`wgpu`] on [`winit`].
|
||||||
#[cfg(feature = "winit")]
|
#[cfg(feature = "winit")]
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ use std::{borrow::Cow, num::NonZeroU64, ops::Range};
|
||||||
|
|
||||||
use epaint::{ahash::HashMap, emath::NumExt, PaintCallbackInfo, Primitive, Vertex};
|
use epaint::{ahash::HashMap, emath::NumExt, PaintCallbackInfo, Primitive, Vertex};
|
||||||
|
|
||||||
use wgpu;
|
|
||||||
use wgpu::util::DeviceExt as _;
|
use wgpu::util::DeviceExt as _;
|
||||||
|
|
||||||
/// You can use this for storage when implementing [`CallbackTrait`].
|
/// You can use this for storage when implementing [`CallbackTrait`].
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ impl BufferPadding {
|
||||||
|
|
||||||
/// Everything you need to paint egui with [`wgpu`] on [`winit`].
|
/// 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.
|
/// NOTE: all egui viewports share the same painter.
|
||||||
pub struct Painter {
|
pub struct Painter {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ use std::num::NonZeroU64;
|
||||||
|
|
||||||
use eframe::{
|
use eframe::{
|
||||||
egui_wgpu::wgpu::util::DeviceExt,
|
egui_wgpu::wgpu::util::DeviceExt,
|
||||||
egui_wgpu::{self, renderer::ScreenDescriptor, wgpu},
|
egui_wgpu::{self, wgpu},
|
||||||
};
|
};
|
||||||
|
|
||||||
pub struct Custom3d {
|
pub struct Custom3d {
|
||||||
|
|
@ -148,7 +148,7 @@ impl egui_wgpu::CallbackTrait for CustomTriangleCallback {
|
||||||
&self,
|
&self,
|
||||||
device: &wgpu::Device,
|
device: &wgpu::Device,
|
||||||
queue: &wgpu::Queue,
|
queue: &wgpu::Queue,
|
||||||
_screen_descriptor: &ScreenDescriptor,
|
_screen_descriptor: &egui_wgpu::ScreenDescriptor,
|
||||||
_egui_encoder: &mut wgpu::CommandEncoder,
|
_egui_encoder: &mut wgpu::CommandEncoder,
|
||||||
resources: &mut egui_wgpu::CallbackResources,
|
resources: &mut egui_wgpu::CallbackResources,
|
||||||
) -> Vec<wgpu::CommandBuffer> {
|
) -> Vec<wgpu::CommandBuffer> {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue