Skip to content

Commit a26e707

Browse files
authored
Make it possible to force GLES usage on Linux (#305)
1 parent 038955d commit a26e707

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/platform/unix/wayland/connection.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ impl Connection {
6363
/// Returns the OpenGL API flavor that this connection supports (OpenGL or OpenGL ES).
6464
#[inline]
6565
pub fn gl_api(&self) -> GLApi {
66-
GLApi::GL
66+
if std::env::var("SURFMAN_FORCE_GLES").is_ok() {
67+
GLApi::GLES
68+
} else {
69+
GLApi::GL
70+
}
6771
}
6872

6973
/// Returns the "best" adapter on this system, preferring high-performance hardware adapters.

src/platform/unix/wayland/device.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ impl Device {
6363
/// Returns the OpenGL API flavor that this device supports (OpenGL or OpenGL ES).
6464
#[inline]
6565
pub fn gl_api(&self) -> GLApi {
66-
GLApi::GL
66+
if std::env::var("SURFMAN_FORCE_GLES").is_ok() {
67+
GLApi::GLES
68+
} else {
69+
GLApi::GL
70+
}
6771
}
6872
}

0 commit comments

Comments
 (0)