或者是不需要修改 libcocos2dx, 通過setWindow(GLWidget*) 的方式給窗口. 如下:
AppDelegate.cpp:
#if (CC_TARGET_PLATFORM == CC_PLATFORM_QT)
static CCEGLView* pMainWnd = NULL;
static void mouseMove(QMouseEvent *event)
{
pMainWnd->mouseMove(event);
}
static void mousePress(QMouseEvent *event)
{
pMainWnd->mousePress(event);
}
static void mouseRelease(QMouseEvent *event)
{
pMainWnd->mouseRelease(event);
}
#endif
bool AppDelegate::initInstance() {