1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 05:10:03 -04:00

Enable depth buffer in WebGL backend (#1499)

This is useful when embedding 3D into eframe using egui::PaintCallback
This commit is contained in:
Emil Ernerfeldt
2022-04-15 12:41:42 +02:00
committed by GitHub
parent f3e31391e0
commit 5a78213421
3 changed files with 78 additions and 30 deletions

View File

@@ -663,7 +663,7 @@ pub struct PaintCallbackInfo {
/// This specifies where on the screen to paint, and the borders of this
/// Rect is the [-1, +1] of the Normalized Device Coordinates.
///
/// Note than only a portion of this may be visible due to [`Self::clip`].
/// Note than only a portion of this may be visible due to [`Self::clip_rect`].
pub viewport: Rect,
/// Clip rectangle in points.
@@ -706,12 +706,12 @@ impl PaintCallbackInfo {
}
}
/// The viewport rectangle.
/// The viewport rectangle. This is what you would use in e.g. `glViewport`.
pub fn viewport_in_pixels(&self) -> ViewportInPixels {
self.points_to_pixels(&self.viewport)
}
/// The "scissor" or "clip" rectangle.
/// The "scissor" or "clip" rectangle. This is what you would use in e.g. `glScissor`.
pub fn clip_rect_in_pixels(&self) -> ViewportInPixels {
self.points_to_pixels(&self.clip_rect)
}