axmol/test_uphone/test_uphoneApp.cpp

65 lines
1.0 KiB
C++

// Application application cpp file.
// Original file name: test_uphoneApp.cpp
// Generated by TOPS Builder:Project wizard,Date:2010-7-26
#include "test_uphoneApp.h"
#include "test_uphoneMainForm.h"
#include "CCDirector.h"
using namespace cocos2d;
Ttest_uphoneApp::Ttest_uphoneApp()
: m_pMainWnd(NULL)
{
}
Ttest_uphoneApp::~Ttest_uphoneApp()
{
}
Boolean Ttest_uphoneApp::initCocos2d()
{
CCDirector::getSharedDirector()->setOpenGLView(m_pMainWnd);
return TRUE;
}
Boolean Ttest_uphoneApp::EventHandler(EventType* pEvent)
{
Boolean bHandled = FALSE;
switch(pEvent->eType)
{
case EVENT_AppLoad:
{
m_pMainWnd = new TMainForm(this);
if (m_pMainWnd)
{
SetActiveWindow(m_pMainWnd);
}
else
{ // 窗口创建失败,退出应用。
SendStopEvent();
}
}
break;
case EVENT_AppStopNotify:
{
}
bHandled = FALSE;
break;
}
if (FALSE == bHandled)
{
return CCXApplication::EventHandler(pEvent);
}
return bHandled;
}