Skip to content

Commit f5d3d5f

Browse files
committed
gui: Split OpenGL into OpenGL (glow), OpenGL ES (wgpu)
1 parent c327ed3 commit f5d3d5f

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

objdiff-gui/src/app.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ impl App {
465465
Backend::Vulkan => "Vulkan",
466466
Backend::Metal => "Metal",
467467
Backend::Dx12 => "DirectX 12",
468-
Backend::Gl => "OpenGL",
468+
Backend::Gl => "OpenGL ES",
469469
Backend::BrowserWebGpu => "WebGPU",
470470
}
471471
.to_string();
@@ -474,7 +474,7 @@ impl App {
474474
#[cfg(feature = "glow")]
475475
if let Some(gl) = &cc.gl {
476476
use eframe::glow::HasContext;
477-
app.view_state.graphics_state.active_backend = "OpenGL (Fallback)".to_string();
477+
app.view_state.graphics_state.active_backend = "OpenGL".to_string();
478478
app.view_state.graphics_state.active_device =
479479
unsafe { gl.get_parameter_string(0x1F01) }; // GL_RENDERER
480480
}

objdiff-gui/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ fn main() -> ExitCode {
9595
GraphicsBackend::Dx12 => wgpu::Backends::DX12,
9696
GraphicsBackend::Metal => wgpu::Backends::METAL,
9797
GraphicsBackend::Vulkan => wgpu::Backends::VULKAN,
98-
GraphicsBackend::OpenGL => wgpu::Backends::GL,
98+
GraphicsBackend::OpenGLES => wgpu::Backends::GL,
99+
GraphicsBackend::OpenGL => wgpu::Backends::empty(),
99100
};
100101
WgpuSetup::CreateNew(setup)
101102
}

objdiff-gui/src/views/graphics.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ pub enum GraphicsBackend {
2626
Vulkan,
2727
Metal,
2828
Dx12,
29-
OpenGL,
29+
OpenGL, // glow
30+
OpenGLES, // wgpu
3031
}
3132

3233
static ALL_BACKENDS: &[GraphicsBackend] = &[
@@ -35,6 +36,7 @@ static ALL_BACKENDS: &[GraphicsBackend] = &[
3536
GraphicsBackend::Metal,
3637
GraphicsBackend::Dx12,
3738
GraphicsBackend::OpenGL,
39+
GraphicsBackend::OpenGLES,
3840
];
3941

4042
#[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize)]
@@ -67,7 +69,8 @@ impl GraphicsBackend {
6769
}
6870
GraphicsBackend::Metal => cfg!(all(feature = "wgpu", target_os = "macos")),
6971
GraphicsBackend::Dx12 => cfg!(all(feature = "wgpu", target_os = "windows")),
70-
GraphicsBackend::OpenGL => true,
72+
GraphicsBackend::OpenGL => cfg!(feature = "glow"),
73+
GraphicsBackend::OpenGLES => cfg!(all(feature = "wgpu", target_os = "windows")),
7174
}
7275
}
7376

@@ -78,6 +81,7 @@ impl GraphicsBackend {
7881
GraphicsBackend::Metal => "Metal",
7982
GraphicsBackend::Dx12 => "DirectX 12",
8083
GraphicsBackend::OpenGL => "OpenGL",
84+
GraphicsBackend::OpenGLES => "OpenGL ES",
8185
}
8286
}
8387
}

0 commit comments

Comments
 (0)