diff --git a/azure.rc b/azure.rc index 7c005b0..4bb4afb 100644 --- a/azure.rc +++ b/azure.rc @@ -15,6 +15,8 @@ extern mod layers = "rust-layers"; extern mod opengles = "rust-opengles"; #[cfg(target_os = "linux")] extern mod xlib = "rust-xlib"; +#[cfg(target_os = "android")] +extern mod egl; #[cfg(not(target_os = "android"))] extern mod glfw; diff --git a/azure_hl.rs b/azure_hl.rs index abc990a..be405e9 100644 --- a/azure_hl.rs +++ b/azure_hl.rs @@ -792,7 +792,6 @@ pub fn current_graphics_metadata() -> NativeGraphicsMetadata { } #[cfg(target_os="macos")] -#[cfg(target_os="android")] #[fixed_stack_segment] pub fn current_graphics_metadata() -> NativeGraphicsMetadata { use opengles::cgl::{CGLGetCurrentContext, CGLGetPixelFormat}; @@ -803,3 +802,13 @@ pub fn current_graphics_metadata() -> NativeGraphicsMetadata { } } +#[cfg(target_os="android")] +#[fixed_stack_segment] +pub fn current_graphics_metadata() -> NativeGraphicsMetadata { + use egl::egl::GetCurrentDisplay; + unsafe { + NativeGraphicsMetadata { + display: GetCurrentDisplay(), + } + } +}