fixed #417 When mouse pressed, capture it in EGLView.

This commit is contained in:
yangws 2011-03-26 11:34:18 +08:00
parent 326bc998da
commit 2015e468ca
1 changed files with 2 additions and 0 deletions

View File

@ -280,6 +280,7 @@ LRESULT CCEGLView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
if (PtInRect(&m_rcViewPort, pt))
{
m_bCaptured = true;
SetCapture(m_hWnd);
m_pTouch->SetTouchInfo(0, (float)(pt.x - m_rcViewPort.left) / m_fScreenScaleFactor,
(float)(pt.y - m_rcViewPort.top) / m_fScreenScaleFactor);
m_pSet->addObject(m_pTouch);
@ -304,6 +305,7 @@ LRESULT CCEGLView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
(float)(HIWORD(lParam) - m_rcViewPort.top) / m_fScreenScaleFactor);
m_pDelegate->touchesEnded(m_pSet, NULL);
m_pSet->removeObject(m_pTouch);
ReleaseCapture();
m_bCaptured = false;
}
break;