Skip to content

Commit

Permalink
eframe: If both glow and wgpu features are enabled, default to …
Browse files Browse the repository at this point in the history
…`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`.
  • Loading branch information
emilk authored Dec 19, 2023
1 parent 4a2cafe commit 9253caf
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions crates/eframe/src/epi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,16 +526,23 @@ pub enum Renderer {
#[cfg(any(feature = "glow", feature = "wgpu"))]
impl Default for Renderer {
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(not(feature = "wgpu"))]
return Self::Glow;

#[cfg(not(feature = "glow"))]
#[cfg(feature = "wgpu")]
return Self::Wgpu;

#[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'");
// By default, only the `glow` feature is enabled, so if the user added `wgpu` to the feature list
// they probably wanted to use wgpu:
#[cfg(feature = "glow")]
#[cfg(feature = "wgpu")]
return Self::Wgpu;
}
}

Expand Down

0 comments on commit 9253caf

Please sign in to comment.