From 4a222b60f417359a2e81eb797579a5cf843eaee3 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Tue, 15 Sep 2015 22:01:19 +0200 Subject: [PATCH] [DEV] {ANDROID} update new gale enum to have a correct interface --- gale/context/Android/Context.cpp | 22 +++++++++++++--------- gale/context/Context.h | 2 +- gale/renderer/openGL/openGL.cpp | 4 +++- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/gale/context/Android/Context.cpp b/gale/context/Android/Context.cpp index 1d3261f..f27b5a4 100644 --- a/gale/context/Android/Context.cpp +++ b/gale/context/Android/Context.cpp @@ -446,9 +446,13 @@ class AndroidContext : public gale::Context { _myChar); } - bool ANDROID_systemKeyboradEvent(enum gale::key::keyboardSystem _key, bool _down) { - return systemKeyboradEvent(_key, _down); + bool ANDROID_systemKeyboradEvent(enum gale::key::keyboard _key, bool _isDown) { + OS_setKeyboard(m_guiKeyBoardSpecialKeyMode, + _key, + (_isDown==true?gale::key::status_down:gale::key::status_up)); + return false; } + void ANDROID_SetKeyboardMove(int _move, bool _isDown, bool _isARepeateKey=false) { // direct wrapping : enum gale::key::keyboard move = (enum gale::key::keyboard)_move; @@ -832,25 +836,25 @@ extern "C" { switch (_keyVal) { case org_gale_GaleConstants_GALE_SYSTEM_KEY_VOLUME_UP: GALE_VERBOSE("IO keyboard Key system \"VOLUME_UP\" is down=" << _isdown); - return s_listInstance[_id]->ANDROID_systemKeyboradEvent(gale::key::keyboardSystemVolumeUp, _isdown); + return s_listInstance[_id]->ANDROID_systemKeyboradEvent(gale::key::keyboard_volumeUp, _isdown); case org_gale_GaleConstants_GALE_SYSTEM_KEY_VOLUME_DOWN: GALE_DEBUG("IO keyboard Key system \"VOLUME_DOWN\" is down=" << _isdown); - return s_listInstance[_id]->ANDROID_systemKeyboradEvent(gale::key::keyboardSystemVolumeDown, _isdown); + return s_listInstance[_id]->ANDROID_systemKeyboradEvent(gale::key::keyboard_volumeDown, _isdown); case org_gale_GaleConstants_GALE_SYSTEM_KEY_MENU: GALE_DEBUG("IO keyboard Key system \"MENU\" is down=" << _isdown); - return s_listInstance[_id]->ANDROID_systemKeyboradEvent(gale::key::keyboardSystemMenu, _isdown); + return s_listInstance[_id]->ANDROID_systemKeyboradEvent(gale::key::keyboard_menu, _isdown); case org_gale_GaleConstants_GALE_SYSTEM_KEY_CAMERA: GALE_DEBUG("IO keyboard Key system \"CAMERA\" is down=" << _isdown); - return s_listInstance[_id]->ANDROID_systemKeyboradEvent(gale::key::keyboardSystemCamera, _isdown); + return s_listInstance[_id]->ANDROID_systemKeyboradEvent(gale::key::keyboard_camera, _isdown); case org_gale_GaleConstants_GALE_SYSTEM_KEY_HOME: GALE_DEBUG("IO keyboard Key system \"HOME\" is down=" << _isdown); - return s_listInstance[_id]->ANDROID_systemKeyboradEvent(gale::key::keyboardSystemHome, _isdown); + return s_listInstance[_id]->ANDROID_systemKeyboradEvent(gale::key::keyboard_home, _isdown); case org_gale_GaleConstants_GALE_SYSTEM_KEY_POWER: GALE_DEBUG("IO keyboard Key system \"POWER\" is down=" << _isdown); - return s_listInstance[_id]->ANDROID_systemKeyboradEvent(gale::key::keyboardSystemPower, _isdown); + return s_listInstance[_id]->ANDROID_systemKeyboradEvent(gale::key::keyboard_power, _isdown); case org_gale_GaleConstants_GALE_SYSTEM_KEY_BACK: GALE_DEBUG("IO keyboard Key system \"BACK\" is down=" << _isdown); - return s_listInstance[_id]->ANDROID_systemKeyboradEvent(gale::key::keyboardSystemBack, _isdown); + return s_listInstance[_id]->ANDROID_systemKeyboradEvent(gale::key::keyboard_back, _isdown); default: GALE_ERROR("IO keyboard Key system event : \"" << _keyVal << "\" is down=" << _isdown); break; diff --git a/gale/context/Context.h b/gale/context/Context.h index 21c0038..78da56d 100644 --- a/gale/context/Context.h +++ b/gale/context/Context.h @@ -110,7 +110,7 @@ namespace gale { virtual void OS_Background(); public: void requestUpdateSize(); - protected: + public: // return true if a flush is needed bool OS_Draw(bool _displayEveryTime); public: diff --git a/gale/renderer/openGL/openGL.cpp b/gale/renderer/openGL/openGL.cpp index ed0bc82..9f70841 100644 --- a/gale/renderer/openGL/openGL.cpp +++ b/gale/renderer/openGL/openGL.cpp @@ -252,7 +252,9 @@ void gale::openGL::clearDepth(float _value) { #ifdef GALE_SIMULATION_OPENGL_AVAILLABLE if (s_simulationMode == false) { #endif - glClearDepth(_value); + #if !(defined(__TARGET_OS__Android) || defined(__TARGET_OS__MacOs)) + glClearDepth(_value); + #endif #ifdef GALE_SIMULATION_OPENGL_AVAILLABLE } #endif