mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 13:20:05 -04:00
Add a custom 3D demo using glow to egui_demo_app (#1546)
This commit is contained in:
@@ -20,6 +20,27 @@ pub use glow::Context;
|
||||
const VERT_SRC: &str = include_str!("shader/vertex.glsl");
|
||||
const FRAG_SRC: &str = include_str!("shader/fragment.glsl");
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum TextureFilter {
|
||||
Linear,
|
||||
Nearest,
|
||||
}
|
||||
|
||||
impl Default for TextureFilter {
|
||||
fn default() -> Self {
|
||||
TextureFilter::Linear
|
||||
}
|
||||
}
|
||||
|
||||
impl TextureFilter {
|
||||
pub(crate) fn glow_code(&self) -> u32 {
|
||||
match self {
|
||||
TextureFilter::Linear => glow::LINEAR,
|
||||
TextureFilter::Nearest => glow::NEAREST,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// An OpenGL painter using [`glow`].
|
||||
///
|
||||
/// This is responsible for painting egui and managing egui textures.
|
||||
@@ -56,27 +77,6 @@ pub struct Painter {
|
||||
destroyed: bool,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum TextureFilter {
|
||||
Linear,
|
||||
Nearest,
|
||||
}
|
||||
|
||||
impl Default for TextureFilter {
|
||||
fn default() -> Self {
|
||||
TextureFilter::Linear
|
||||
}
|
||||
}
|
||||
|
||||
impl TextureFilter {
|
||||
pub(crate) fn glow_code(&self) -> u32 {
|
||||
match self {
|
||||
TextureFilter::Linear => glow::LINEAR,
|
||||
TextureFilter::Nearest => glow::NEAREST,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Painter {
|
||||
/// Create painter.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user