This commit is contained in:
Ming 2010-09-08 01:33:43 +00:00
parent 03cdfe1e27
commit 712da80ffb
2 changed files with 42 additions and 17 deletions

View File

@ -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)

View File

@ -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;