2
0

os_android.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750
  1. /*************************************************************************/
  2. /* os_android.cpp */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
  9. /* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /*************************************************************************/
  30. #include "os_android.h"
  31. #include "core/io/file_access_buffered_fa.h"
  32. #include "core/project_settings.h"
  33. #include "drivers/gles2/rasterizer_gles2.h"
  34. #include "drivers/gles3/rasterizer_gles3.h"
  35. #include "drivers/unix/dir_access_unix.h"
  36. #include "drivers/unix/file_access_unix.h"
  37. #include "file_access_android.h"
  38. #include "main/main.h"
  39. #include "servers/visual/visual_server_raster.h"
  40. #include "servers/visual/visual_server_wrap_mt.h"
  41. #include "dir_access_jandroid.h"
  42. #include "file_access_jandroid.h"
  43. #include <dlfcn.h>
  44. #include "java_godot_io_wrapper.h"
  45. #include "java_godot_wrapper.h"
  46. class AndroidLogger : public Logger {
  47. public:
  48. virtual void logv(const char *p_format, va_list p_list, bool p_err) {
  49. __android_log_vprint(p_err ? ANDROID_LOG_ERROR : ANDROID_LOG_INFO, "godot", p_format, p_list);
  50. }
  51. virtual ~AndroidLogger() {}
  52. };
  53. int OS_Android::get_video_driver_count() const {
  54. return 2;
  55. }
  56. const char *OS_Android::get_video_driver_name(int p_driver) const {
  57. switch (p_driver) {
  58. case VIDEO_DRIVER_GLES3:
  59. return "GLES3";
  60. case VIDEO_DRIVER_GLES2:
  61. return "GLES2";
  62. }
  63. ERR_EXPLAIN("Invalid video driver index " + itos(p_driver));
  64. ERR_FAIL_V(NULL);
  65. }
  66. int OS_Android::get_audio_driver_count() const {
  67. return 1;
  68. }
  69. const char *OS_Android::get_audio_driver_name(int p_driver) const {
  70. return "Android";
  71. }
  72. void OS_Android::initialize_core() {
  73. OS_Unix::initialize_core();
  74. if (use_apk_expansion)
  75. FileAccess::make_default<FileAccessUnix>(FileAccess::ACCESS_RESOURCES);
  76. else {
  77. #ifdef USE_JAVA_FILE_ACCESS
  78. FileAccess::make_default<FileAccessBufferedFA<FileAccessJAndroid> >(FileAccess::ACCESS_RESOURCES);
  79. #else
  80. //FileAccess::make_default<FileAccessBufferedFA<FileAccessAndroid> >(FileAccess::ACCESS_RESOURCES);
  81. FileAccess::make_default<FileAccessAndroid>(FileAccess::ACCESS_RESOURCES);
  82. #endif
  83. }
  84. FileAccess::make_default<FileAccessUnix>(FileAccess::ACCESS_USERDATA);
  85. FileAccess::make_default<FileAccessUnix>(FileAccess::ACCESS_FILESYSTEM);
  86. //FileAccessBufferedFA<FileAccessUnix>::make_default();
  87. if (use_apk_expansion)
  88. DirAccess::make_default<DirAccessUnix>(DirAccess::ACCESS_RESOURCES);
  89. else
  90. DirAccess::make_default<DirAccessJAndroid>(DirAccess::ACCESS_RESOURCES);
  91. DirAccess::make_default<DirAccessUnix>(DirAccess::ACCESS_USERDATA);
  92. DirAccess::make_default<DirAccessUnix>(DirAccess::ACCESS_FILESYSTEM);
  93. }
  94. void OS_Android::set_opengl_extensions(const char *p_gl_extensions) {
  95. ERR_FAIL_COND(!p_gl_extensions);
  96. gl_extensions = p_gl_extensions;
  97. }
  98. int OS_Android::get_current_video_driver() const {
  99. return video_driver_index;
  100. }
  101. Error OS_Android::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
  102. bool use_gl3 = godot_java->get_gles_version_code() >= 0x00030000;
  103. use_gl3 = use_gl3 && (GLOBAL_GET("rendering/quality/driver/driver_name") == "GLES3");
  104. bool gl_initialization_error = false;
  105. while (true) {
  106. if (use_gl3) {
  107. if (RasterizerGLES3::is_viable() == OK) {
  108. godot_java->gfx_init(false);
  109. RasterizerGLES3::register_config();
  110. RasterizerGLES3::make_current();
  111. break;
  112. } else {
  113. if (GLOBAL_GET("rendering/quality/driver/fallback_to_gles2")) {
  114. p_video_driver = VIDEO_DRIVER_GLES2;
  115. use_gl3 = false;
  116. continue;
  117. } else {
  118. gl_initialization_error = true;
  119. break;
  120. }
  121. }
  122. } else {
  123. if (RasterizerGLES2::is_viable() == OK) {
  124. godot_java->gfx_init(true);
  125. RasterizerGLES2::register_config();
  126. RasterizerGLES2::make_current();
  127. break;
  128. } else {
  129. gl_initialization_error = true;
  130. break;
  131. }
  132. }
  133. }
  134. if (gl_initialization_error) {
  135. OS::get_singleton()->alert("Your device does not support any of the supported OpenGL versions.\n"
  136. "Please try updating your Android version.",
  137. "Unable to initialize Video driver");
  138. return ERR_UNAVAILABLE;
  139. }
  140. video_driver_index = p_video_driver;
  141. visual_server = memnew(VisualServerRaster);
  142. if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
  143. visual_server = memnew(VisualServerWrapMT(visual_server, false));
  144. }
  145. visual_server->init();
  146. AudioDriverManager::initialize(p_audio_driver);
  147. input = memnew(InputDefault);
  148. input->set_fallback_mapping("Default Android Gamepad");
  149. //power_manager = memnew(PowerAndroid);
  150. return OK;
  151. }
  152. void OS_Android::set_main_loop(MainLoop *p_main_loop) {
  153. main_loop = p_main_loop;
  154. input->set_main_loop(p_main_loop);
  155. }
  156. void OS_Android::delete_main_loop() {
  157. memdelete(main_loop);
  158. }
  159. void OS_Android::finalize() {
  160. memdelete(input);
  161. }
  162. GodotJavaWrapper *OS_Android::get_godot_java() {
  163. return godot_java;
  164. }
  165. GodotIOJavaWrapper *OS_Android::get_godot_io_java() {
  166. return godot_io_java;
  167. }
  168. void OS_Android::alert(const String &p_alert, const String &p_title) {
  169. //print("ALERT: %s\n", p_alert.utf8().get_data());
  170. godot_java->alert(p_alert, p_title);
  171. }
  172. bool OS_Android::request_permission(const String &p_name) {
  173. return godot_java->request_permission(p_name);
  174. }
  175. Error OS_Android::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path) {
  176. p_library_handle = dlopen(p_path.utf8().get_data(), RTLD_NOW);
  177. if (!p_library_handle) {
  178. ERR_EXPLAIN("Can't open dynamic library: " + p_path + ". Error: " + dlerror());
  179. ERR_FAIL_V(ERR_CANT_OPEN);
  180. }
  181. return OK;
  182. }
  183. void OS_Android::set_mouse_show(bool p_show) {
  184. //android has no mouse...
  185. }
  186. void OS_Android::set_mouse_grab(bool p_grab) {
  187. //it really has no mouse...!
  188. }
  189. bool OS_Android::is_mouse_grab_enabled() const {
  190. //*sigh* technology has evolved so much since i was a kid..
  191. return false;
  192. }
  193. Point2 OS_Android::get_mouse_position() const {
  194. return Point2();
  195. }
  196. int OS_Android::get_mouse_button_state() const {
  197. return 0;
  198. }
  199. void OS_Android::set_window_title(const String &p_title) {
  200. }
  201. void OS_Android::set_video_mode(const VideoMode &p_video_mode, int p_screen) {
  202. }
  203. OS::VideoMode OS_Android::get_video_mode(int p_screen) const {
  204. return default_videomode;
  205. }
  206. void OS_Android::get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen) const {
  207. p_list->push_back(default_videomode);
  208. }
  209. void OS_Android::set_keep_screen_on(bool p_enabled) {
  210. OS::set_keep_screen_on(p_enabled);
  211. godot_java->set_keep_screen_on(p_enabled);
  212. }
  213. Size2 OS_Android::get_window_size() const {
  214. return Vector2(default_videomode.width, default_videomode.height);
  215. }
  216. String OS_Android::get_name() {
  217. return "Android";
  218. }
  219. MainLoop *OS_Android::get_main_loop() const {
  220. return main_loop;
  221. }
  222. bool OS_Android::can_draw() const {
  223. return true; //always?
  224. }
  225. void OS_Android::set_cursor_shape(CursorShape p_shape) {
  226. //android really really really has no mouse.. how amazing..
  227. }
  228. void OS_Android::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
  229. }
  230. void OS_Android::main_loop_begin() {
  231. if (main_loop)
  232. main_loop->init();
  233. }
  234. bool OS_Android::main_loop_iterate() {
  235. if (!main_loop)
  236. return false;
  237. return Main::iteration();
  238. }
  239. void OS_Android::main_loop_end() {
  240. if (main_loop)
  241. main_loop->finish();
  242. }
  243. void OS_Android::main_loop_focusout() {
  244. if (main_loop)
  245. main_loop->notification(MainLoop::NOTIFICATION_WM_FOCUS_OUT);
  246. audio_driver_android.set_pause(true);
  247. }
  248. void OS_Android::main_loop_focusin() {
  249. if (main_loop)
  250. main_loop->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN);
  251. audio_driver_android.set_pause(false);
  252. }
  253. void OS_Android::process_joy_event(OS_Android::JoypadEvent p_event) {
  254. switch (p_event.type) {
  255. case JOY_EVENT_BUTTON:
  256. input->joy_button(p_event.device, p_event.index, p_event.pressed);
  257. break;
  258. case JOY_EVENT_AXIS:
  259. InputDefault::JoyAxis value;
  260. value.min = -1;
  261. value.value = p_event.value;
  262. input->joy_axis(p_event.device, p_event.index, value);
  263. break;
  264. case JOY_EVENT_HAT:
  265. input->joy_hat(p_event.device, p_event.hat);
  266. break;
  267. default:
  268. return;
  269. }
  270. }
  271. void OS_Android::process_event(Ref<InputEvent> p_event) {
  272. input->parse_input_event(p_event);
  273. }
  274. void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> &p_points) {
  275. switch (p_what) {
  276. case 0: { //gesture begin
  277. if (touch.size()) {
  278. //end all if exist
  279. for (int i = 0; i < touch.size(); i++) {
  280. Ref<InputEventScreenTouch> ev;
  281. ev.instance();
  282. ev->set_index(touch[i].id);
  283. ev->set_pressed(false);
  284. ev->set_position(touch[i].pos);
  285. input->parse_input_event(ev);
  286. }
  287. }
  288. touch.resize(p_points.size());
  289. for (int i = 0; i < p_points.size(); i++) {
  290. touch.write[i].id = p_points[i].id;
  291. touch.write[i].pos = p_points[i].pos;
  292. }
  293. //send touch
  294. for (int i = 0; i < touch.size(); i++) {
  295. Ref<InputEventScreenTouch> ev;
  296. ev.instance();
  297. ev->set_index(touch[i].id);
  298. ev->set_pressed(true);
  299. ev->set_position(touch[i].pos);
  300. input->parse_input_event(ev);
  301. }
  302. } break;
  303. case 1: { //motion
  304. ERR_FAIL_COND(touch.size() != p_points.size());
  305. for (int i = 0; i < touch.size(); i++) {
  306. int idx = -1;
  307. for (int j = 0; j < p_points.size(); j++) {
  308. if (touch[i].id == p_points[j].id) {
  309. idx = j;
  310. break;
  311. }
  312. }
  313. ERR_CONTINUE(idx == -1);
  314. if (touch[i].pos == p_points[idx].pos)
  315. continue; //no move unncesearily
  316. Ref<InputEventScreenDrag> ev;
  317. ev.instance();
  318. ev->set_index(touch[i].id);
  319. ev->set_position(p_points[idx].pos);
  320. ev->set_relative(p_points[idx].pos - touch[i].pos);
  321. input->parse_input_event(ev);
  322. touch.write[i].pos = p_points[idx].pos;
  323. }
  324. } break;
  325. case 2: { //release
  326. if (touch.size()) {
  327. //end all if exist
  328. for (int i = 0; i < touch.size(); i++) {
  329. Ref<InputEventScreenTouch> ev;
  330. ev.instance();
  331. ev->set_index(touch[i].id);
  332. ev->set_pressed(false);
  333. ev->set_position(touch[i].pos);
  334. input->parse_input_event(ev);
  335. }
  336. touch.clear();
  337. }
  338. } break;
  339. case 3: { // add touch
  340. for (int i = 0; i < p_points.size(); i++) {
  341. if (p_points[i].id == p_pointer) {
  342. TouchPos tp = p_points[i];
  343. touch.push_back(tp);
  344. Ref<InputEventScreenTouch> ev;
  345. ev.instance();
  346. ev->set_index(tp.id);
  347. ev->set_pressed(true);
  348. ev->set_position(tp.pos);
  349. input->parse_input_event(ev);
  350. break;
  351. }
  352. }
  353. } break;
  354. case 4: { // remove touch
  355. for (int i = 0; i < touch.size(); i++) {
  356. if (touch[i].id == p_pointer) {
  357. Ref<InputEventScreenTouch> ev;
  358. ev.instance();
  359. ev->set_index(touch[i].id);
  360. ev->set_pressed(false);
  361. ev->set_position(touch[i].pos);
  362. input->parse_input_event(ev);
  363. touch.remove(i);
  364. break;
  365. }
  366. }
  367. } break;
  368. }
  369. }
  370. void OS_Android::process_accelerometer(const Vector3 &p_accelerometer) {
  371. input->set_accelerometer(p_accelerometer);
  372. }
  373. void OS_Android::process_gravity(const Vector3 &p_gravity) {
  374. input->set_gravity(p_gravity);
  375. }
  376. void OS_Android::process_magnetometer(const Vector3 &p_magnetometer) {
  377. input->set_magnetometer(p_magnetometer);
  378. }
  379. void OS_Android::process_gyroscope(const Vector3 &p_gyroscope) {
  380. input->set_gyroscope(p_gyroscope);
  381. }
  382. bool OS_Android::has_touchscreen_ui_hint() const {
  383. return true;
  384. }
  385. bool OS_Android::has_virtual_keyboard() const {
  386. return true;
  387. }
  388. int OS_Android::get_virtual_keyboard_height() const {
  389. return godot_io_java->get_vk_height();
  390. // ERR_PRINT("Cannot obtain virtual keyboard height.");
  391. // return 0;
  392. }
  393. void OS_Android::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect) {
  394. if (godot_io_java->has_vk()) {
  395. godot_io_java->show_vk(p_existing_text);
  396. } else {
  397. ERR_PRINT("Virtual keyboard not available");
  398. };
  399. }
  400. void OS_Android::hide_virtual_keyboard() {
  401. if (godot_io_java->has_vk()) {
  402. godot_io_java->hide_vk();
  403. } else {
  404. ERR_PRINT("Virtual keyboard not available");
  405. };
  406. }
  407. void OS_Android::init_video_mode(int p_video_width, int p_video_height) {
  408. default_videomode.width = p_video_width;
  409. default_videomode.height = p_video_height;
  410. default_videomode.fullscreen = true;
  411. default_videomode.resizable = false;
  412. }
  413. void OS_Android::main_loop_request_go_back() {
  414. if (main_loop)
  415. main_loop->notification(MainLoop::NOTIFICATION_WM_GO_BACK_REQUEST);
  416. }
  417. void OS_Android::set_display_size(Size2 p_size) {
  418. default_videomode.width = p_size.x;
  419. default_videomode.height = p_size.y;
  420. }
  421. Error OS_Android::shell_open(String p_uri) {
  422. return godot_io_java->open_uri(p_uri);
  423. }
  424. String OS_Android::get_resource_dir() const {
  425. return "/"; //android has its own filesystem for resources inside the APK
  426. }
  427. String OS_Android::get_locale() const {
  428. String locale = godot_io_java->get_locale();
  429. if (locale != "") {
  430. return locale;
  431. }
  432. return OS_Unix::get_locale();
  433. }
  434. void OS_Android::set_clipboard(const String &p_text) {
  435. // DO we really need the fallback to OS_Unix here?!
  436. if (godot_java->has_set_clipboard()) {
  437. godot_java->set_clipboard(p_text);
  438. } else {
  439. OS_Unix::set_clipboard(p_text);
  440. }
  441. }
  442. String OS_Android::get_clipboard() const {
  443. // DO we really need the fallback to OS_Unix here?!
  444. if (godot_java->has_get_clipboard()) {
  445. return godot_java->get_clipboard();
  446. }
  447. return OS_Unix::get_clipboard();
  448. }
  449. String OS_Android::get_model_name() const {
  450. String model = godot_io_java->get_model();
  451. if (model != "")
  452. return model;
  453. return OS_Unix::get_model_name();
  454. }
  455. int OS_Android::get_screen_dpi(int p_screen) const {
  456. return godot_io_java->get_screen_dpi();
  457. }
  458. String OS_Android::get_user_data_dir() const {
  459. if (data_dir_cache != String())
  460. return data_dir_cache;
  461. String data_dir = godot_io_java->get_user_data_dir();
  462. if (data_dir != "") {
  463. //store current dir
  464. char real_current_dir_name[2048];
  465. getcwd(real_current_dir_name, 2048);
  466. //go to data dir
  467. chdir(data_dir.utf8().get_data());
  468. //get actual data dir, so we resolve potential symlink (Android 6.0+ seems to use symlink)
  469. char data_current_dir_name[2048];
  470. getcwd(data_current_dir_name, 2048);
  471. //cache by parsing utf8
  472. data_dir_cache.parse_utf8(data_current_dir_name);
  473. //restore original dir so we don't mess things up
  474. chdir(real_current_dir_name);
  475. return data_dir_cache;
  476. }
  477. return ".";
  478. }
  479. void OS_Android::set_screen_orientation(ScreenOrientation p_orientation) {
  480. godot_io_java->set_screen_orientation(p_orientation);
  481. }
  482. String OS_Android::get_unique_id() const {
  483. String unique_id = godot_io_java->get_unique_id();
  484. if (unique_id != "")
  485. return unique_id;
  486. return OS::get_unique_id();
  487. }
  488. Error OS_Android::native_video_play(String p_path, float p_volume, String p_audio_track, String p_subtitle_track) {
  489. // FIXME: Add support for volume, audio and subtitle tracks
  490. godot_io_java->play_video(p_path);
  491. return OK;
  492. }
  493. bool OS_Android::native_video_is_playing() const {
  494. return godot_io_java->is_video_playing();
  495. }
  496. void OS_Android::native_video_pause() {
  497. godot_io_java->pause_video();
  498. }
  499. String OS_Android::get_system_dir(SystemDir p_dir) const {
  500. return godot_io_java->get_system_dir(p_dir);
  501. }
  502. void OS_Android::native_video_stop() {
  503. godot_io_java->stop_video();
  504. }
  505. void OS_Android::set_context_is_16_bits(bool p_is_16) {
  506. //use_16bits_fbo = p_is_16;
  507. //if (rasterizer)
  508. // rasterizer->set_force_16_bits_fbo(p_is_16);
  509. }
  510. void OS_Android::joy_connection_changed(int p_device, bool p_connected, String p_name) {
  511. return input->joy_connection_changed(p_device, p_connected, p_name, "");
  512. }
  513. bool OS_Android::is_joy_known(int p_device) {
  514. return input->is_joy_mapped(p_device);
  515. }
  516. String OS_Android::get_joy_guid(int p_device) const {
  517. return input->get_joy_guid_remapped(p_device);
  518. }
  519. bool OS_Android::_check_internal_feature_support(const String &p_feature) {
  520. if (p_feature == "mobile") {
  521. //TODO support etc2 only if GLES3 driver is selected
  522. return true;
  523. }
  524. #if defined(__aarch64__)
  525. if (p_feature == "arm64-v8a") {
  526. return true;
  527. }
  528. #elif defined(__ARM_ARCH_7A__)
  529. if (p_feature == "armeabi-v7a" || p_feature == "armeabi") {
  530. return true;
  531. }
  532. #elif defined(__arm__)
  533. if (p_feature == "armeabi") {
  534. return true;
  535. }
  536. #endif
  537. return false;
  538. }
  539. OS_Android::OS_Android(GodotJavaWrapper *p_godot_java, GodotIOJavaWrapper *p_godot_io_java, bool p_use_apk_expansion) {
  540. use_apk_expansion = p_use_apk_expansion;
  541. default_videomode.width = 800;
  542. default_videomode.height = 600;
  543. default_videomode.fullscreen = true;
  544. default_videomode.resizable = false;
  545. main_loop = NULL;
  546. gl_extensions = NULL;
  547. //rasterizer = NULL;
  548. use_gl2 = false;
  549. godot_java = p_godot_java;
  550. godot_io_java = p_godot_io_java;
  551. Vector<Logger *> loggers;
  552. loggers.push_back(memnew(AndroidLogger));
  553. _set_logger(memnew(CompositeLogger(loggers)));
  554. AudioDriverManager::add_driver(&audio_driver_android);
  555. }
  556. OS_Android::~OS_Android() {
  557. }