Hey everyone,
I’ve added some code to CCEGLView_win32.cpp/.h that adds some primitive scroll wheel support. This is useful for testing pinching features on Windows machines.
In CCEGLView_win32.h, I’ve added a new private variable: CCTouch *m_pTouch2 and m_eZoom;
In CCEGLView::CCEGLView(), allocate the new variable m_pTouch2, and set m_eZoom = 0.
Finally, in CCEGLView::WindowProc, add:
case WM_MOUSEWHEEL:
if((short) HIWORD (wParam) < 0){
m_eZoom++;
}else{
m_eZoom—;
}
if(m_eZoom >= 24){
m_eZoom = 24;
}
if(m_eZoom <= ~~24){
m_eZoom =~~24;
}
//Add upper touch point
m_pTouch~~>SetTouchInfo) / m_fScreenScaleFactor,
) / m_fScreenScaleFactor);
m_pSet~~>addObject(m_pTouch);
//Add lower touch point
m_pTouch2~~>SetTouchInfo) / m_fScreenScaleFactor,
) / m_fScreenScaleFactor);
m_pSet~~>addObject(m_pTouch2);
//Send touch to delegate
m_pDelegate~~>touchesMoved;
m_pSet~~>removeObject(m_pTouch);
m_pSet~~>removeObject;
break;
To use the new feature, in a touchesMoved callback:
switch ) {
case 1:
break;
case 2:
touch1 = );
touches~~>removeObject(touch1);
touch2 = (CCTouch*)(*touches->begin());
break;
}
Like I said, it is pretty primitive, feedback is welcome!
Austin