There is a bug in 2.6.2 version of glfw that stops the app from exiting cleanly, I have upgraded to 2.7.2 where the bug is fixed.
But saying that, in the cocos2d-x code, there code is missing to exit the app when closing the window anyway, I added this to my version of CCEGLView_linux.cpp:
int windowCloseEventHandle(void) {
CCDirector::sharedDirector()->end();
s_pMainWindow->release();
return GL_TRUE;
}
bool CCEGLView::Create(const char* pTitle, int iPixelWidth, int iPixelHeight, int iWidth, int iHeight, int iDepth) {
...
//register the glfw mouse pos event
glfwSetMousePosCallback(mousePosEventHandle);
glfwSetWindowCloseCallback(windowCloseEventHandle); // <- New call here
...
}
This will close the window on request (correct), but this still isn’t letting the application exit to shell.
What am I missing?
Thanks,
Luke.