diff --git a/cocos2dx/platform/uphone/CCXApplication_uphone.cpp b/cocos2dx/platform/uphone/CCXApplication_uphone.cpp index 06afa7a648..0849ae16f3 100644 --- a/cocos2dx/platform/uphone/CCXApplication_uphone.cpp +++ b/cocos2dx/platform/uphone/CCXApplication_uphone.cpp @@ -23,11 +23,11 @@ namespace cocos2d { CCXApplication::CCXApplication() { - memset(&m_tMsg, 0, sizeof(m_tMsg)); - SS_GetCurrentGTID(&m_tMsg.gtid); - m_tMsg.type = CCX_ON_APPLICATION_IDLE; + memset(&m_tMsg, 0, sizeof(m_tMsg)); + SS_GetCurrentGTID(&m_tMsg.gtid); + m_tMsg.type = CCX_ON_APPLICATION_IDLE; - Sys_RegisterMessageCallBack(CCX_ON_APPLICATION_IDLE, _OnAppIdle, (UInt32)&m_tMsg); + Sys_RegisterMessageCallBack(CCX_ON_APPLICATION_IDLE, _OnAppIdle, (UInt32)&m_tMsg); } CCXApplication::~CCXApplication() @@ -41,17 +41,27 @@ namespace cocos2d { switch (pEvent->eType) { case EVENT_AppLoad: - if (! initCocos2d()) - { - SendStopEvent(); - } - bHandled = Sys_PostMessage2(MESSAGE_PRIOR_LOWEST, &m_tMsg); +// if (! initCocos2d()) +// { +// SendStopEvent(); +// } + /*bHandled = Sys_PostMessage2(MESSAGE_PRIOR_LOWEST, &m_tMsg);*/ bHandled = TRUE; break; case EVENT_AppStopNotify: break; + + case EVENT_PenUserDrag: + if (! initCocos2d()) + { + SendStopEvent(); + } + Sys_PostMessage2(MESSAGE_PRIOR_LOWEST, &m_tMsg); + + bHandled = TRUE; + break; } if (! bHandled) diff --git a/cocos2dx/platform/uphone/CCXEGLView_uphone.cpp b/cocos2dx/platform/uphone/CCXEGLView_uphone.cpp index ed45b9ac42..1cf80b2d34 100644 --- a/cocos2dx/platform/uphone/CCXEGLView_uphone.cpp +++ b/cocos2dx/platform/uphone/CCXEGLView_uphone.cpp @@ -341,7 +341,21 @@ public: void resizeSurface() { - // do nothing on uPhone device, because of TWindow can't change size +// if (! m_eglWnd || EGL_NO_DISPLAY == m_eglDisplay) +// { +// return; +// } +// +// // release old surface +// if (EGL_NO_SURFACE != m_eglSurface) +// { +// eglDestroySurface(m_eglDisplay, m_eglSurface); +// m_eglSurface = EGL_NO_SURFACE; +// } +// +// // create new surface and make current +// m_eglSurface = eglCreateWindowSurface(m_eglDisplay, m_eglConfig, m_eglWnd, NULL); +// eglMakeCurrent(m_eglDisplay, m_eglSurface, m_eglSurface, m_eglContext); } void swapBuffers() @@ -404,15 +418,16 @@ Boolean CCXEGLView::EventHandler(TApplication * pApp, EventType * pEvent) break; case EVENT_WinRotationChanged: +#ifdef _TRANZDA_VM_ + if (m_pEGL) { - if (m_pEGL) - { - m_pEGL->resizeSurface(); - UpdateWindow(0); - } + m_pEGL->resizeSurface(); + UpdateWindow(0); } -// CCX_SAFE_DELETE(m_pEGL); -// m_pEGL = CCXEGL::create(this); +#else // _TRANZDA_VM_ + CCX_SAFE_DELETE(m_pEGL); + m_pEGL = CCXEGL::create(this); +#endif // _TRANZDA_VM_ bHandled = TRUE; break;