mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 23:00:04 -04:00
eframe: If both glow and wgpu features are enabled, default to wgpu (#3717)
By default, only the `glow` feature is enabled, so if the user added `wgpu` to the feature list they probably wanted to use `wgpu`.
This commit is contained in:
@@ -526,16 +526,23 @@ pub enum Renderer {
|
|||||||
#[cfg(any(feature = "glow", feature = "wgpu"))]
|
#[cfg(any(feature = "glow", feature = "wgpu"))]
|
||||||
impl Default for Renderer {
|
impl Default for Renderer {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
|
#[cfg(not(feature = "glow"))]
|
||||||
|
#[cfg(not(feature = "wgpu"))]
|
||||||
|
compile_error!("eframe: you must enable at least one of the rendering backend features: 'glow' or 'wgpu'");
|
||||||
|
|
||||||
#[cfg(feature = "glow")]
|
#[cfg(feature = "glow")]
|
||||||
|
#[cfg(not(feature = "wgpu"))]
|
||||||
return Self::Glow;
|
return Self::Glow;
|
||||||
|
|
||||||
#[cfg(not(feature = "glow"))]
|
#[cfg(not(feature = "glow"))]
|
||||||
#[cfg(feature = "wgpu")]
|
#[cfg(feature = "wgpu")]
|
||||||
return Self::Wgpu;
|
return Self::Wgpu;
|
||||||
|
|
||||||
#[cfg(not(feature = "glow"))]
|
// By default, only the `glow` feature is enabled, so if the user added `wgpu` to the feature list
|
||||||
#[cfg(not(feature = "wgpu"))]
|
// they probably wanted to use wgpu:
|
||||||
compile_error!("eframe: you must enable at least one of the rendering backend features: 'glow' or 'wgpu'");
|
#[cfg(feature = "glow")]
|
||||||
|
#[cfg(feature = "wgpu")]
|
||||||
|
return Self::Wgpu;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user