Merge pull request #1299 from moadib/handle_window_close_on_linux

Handle window close on linux
This commit is contained in:
minggo 2012-09-10 18:34:21 -07:00
commit 951d5b4e59
1 changed files with 7 additions and 0 deletions

View File

@ -142,6 +142,11 @@ void mousePosEventHandle(int iPosX,int iPosY) {
}
}
int closeEventHandle() {
CCDirector::sharedDirector()->end();
return GL_TRUE;
}
void CCEGLView::setFrameSize(float width, float height)
{
bool eResult = false;
@ -217,6 +222,8 @@ void CCEGLView::setFrameSize(float width, float height)
//register the glfw mouse pos event
glfwSetMousePosCallback(mousePosEventHandle);
glfwSetWindowCloseCallback(closeEventHandle);
//Inits extensions
eResult = initExtensions();