-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade winit to window resizing on macOS and upgrade Android setup (#…
…287) * Upgrade winit to window resizes on macOS * Use native activity feature * Update intellij file * Configure winit correctly * Fix android * Fix android backend to GL * Depend on SystemConfiguration in swift and example target * Rename functions
- Loading branch information
Showing
22 changed files
with
137 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,33 @@ | ||
#![deny(unused_imports)] | ||
|
||
use std::ffi::CString; | ||
|
||
use jni::{objects::JClass, JNIEnv}; | ||
use log::Level; | ||
use maplibre_winit::run_headed_map; | ||
use maplibre::render::settings::WgpuSettings; | ||
use maplibre_winit::{run_headed_map, WinitMapWindowConfig}; | ||
|
||
#[cfg(not(any(no_pendantic_os_check, target_os = "android")))] | ||
compile_error!("android works only on android."); | ||
|
||
#[cfg_attr(target_os = "android", ndk_glue::main(backtrace = "on"))] | ||
pub fn android_main() { | ||
env_logger::init_from_env(env_logger::Env::default().default_filter_or("info")); | ||
|
||
// TODO: Maybe requires: Some(Backends::VULKAN) | ||
run_headed_map(None); | ||
#[no_mangle] | ||
pub fn android_main(app: android_activity::AndroidApp) { | ||
android_logger::init_once( | ||
android_logger::Config::default().with_max_level(log::LevelFilter::Info), | ||
); | ||
log::log!(Level::Info, "maplibre starting"); | ||
run_headed_map( | ||
None, | ||
WinitMapWindowConfig::new("maplibre".to_string(), app), | ||
WgpuSettings { | ||
backends: Some(maplibre::render::settings::Backends::GL), | ||
..WgpuSettings::default() | ||
}, | ||
); | ||
} | ||
|
||
#[no_mangle] | ||
pub extern "system" fn Java_org_maplibre_1rs_MapLibreRs_android_1main( | ||
_env: JNIEnv, | ||
_class: JClass, | ||
) { | ||
let tag = CString::new("maplibre").unwrap(); | ||
let message = CString::new("maplibre WOORKING").unwrap(); | ||
ndk_glue::android_log(Level::Warn, &tag, &message); | ||
log::log!(Level::Warn, "maplibre WOORKING"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.