Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Fix crash when creating OpenGLES context without explicit version
- Add `buffer_age` method on `WindowedContext`
- On Android, switched from `StaticStructGenerator` to `StructGenerator`, fixing some compilation errors.

# Version 0.28.0 (2021-12-02)

Expand Down
1 change: 1 addition & 0 deletions glutin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ winit = { version = "0.26", default-features = false }
[target.'cfg(target_os = "android")'.dependencies]
android_glue = "0.2"
glutin_egl_sys = { version = "0.1.5", path = "../glutin_egl_sys" }
libloading = "0.7"
parking_lot = "0.11"

[target.'cfg(target_os = "emscripten")'.dependencies]
Expand Down
1 change: 1 addition & 0 deletions glutin/src/api/dlloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd",
target_os = "android",
))]

use libloading::Library;
Expand Down
26 changes: 0 additions & 26 deletions glutin/src/api/egl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
))]
#![allow(unused_variables)]

#[cfg(not(target_os = "android"))]
mod egl {
use super::ffi;
use crate::api::dlloader::{SymTrait, SymWrapper};
Expand Down Expand Up @@ -90,20 +89,6 @@ mod egl {
}
}

#[cfg(target_os = "android")]
mod egl {
use super::ffi;

#[derive(Clone)]
pub struct Egl(pub ffi::egl::Egl);

impl Egl {
pub fn new() -> Result<Self, ()> {
Ok(Egl(ffi::egl::Egl))
}
}
}

mod make_current_guard;

pub use self::egl::Egl;
Expand Down Expand Up @@ -180,13 +165,6 @@ pub struct Context {
config_id: ffi::egl::types::EGLConfig,
}

#[cfg(target_os = "android")]
#[inline]
fn get_native_display(native_display: &NativeDisplay) -> *const raw::c_void {
let egl = EGL.as_ref().unwrap();
unsafe { egl.GetDisplay(ffi::egl::DEFAULT_DISPLAY as *mut _) }
}

fn get_egl_version(
display: ffi::egl::types::EGLDisplay,
) -> Result<(ffi::egl::types::EGLint, ffi::egl::types::EGLint), CreationError> {
Expand Down Expand Up @@ -256,7 +234,6 @@ unsafe fn bind_and_get_api<'a>(
}
}

#[cfg(not(target_os = "android"))]
fn get_native_display(native_display: &NativeDisplay) -> *const raw::c_void {
let egl = EGL.as_ref().unwrap();
// the first step is to query the list of extensions without any display, if
Expand Down Expand Up @@ -352,9 +329,6 @@ fn get_native_display(native_display: &NativeDisplay) -> *const raw::c_void {
}
}

// TODO: This will never be reached right now, as the android egl
// bindings use the static generator, so can't rely on
// GetPlatformDisplay(EXT).
NativeDisplay::Android
if has_dp_extension("EGL_KHR_platform_android")
&& egl.GetPlatformDisplay.is_loaded() =>
Expand Down
2 changes: 1 addition & 1 deletion glutin_egl_sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn main() {
],
);

if target.contains("android") || target.contains("ios") {
if target.contains("ios") {
reg.write_bindings(gl_generator::StaticStructGenerator, &mut file)
} else {
reg.write_bindings(gl_generator::StructGenerator, &mut file)
Expand Down