1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
void CALLBACK MouseProc( bool bLeftButtonDown, bool bRightButtonDown, bool bMiddleButtonDown, bool bSideButton1Down, bool bSideButton2Down, int nMouseWheelDelta, int xPos, int yPos, void* pUserContext )
{
g_bRightMouseDown = bRightButtonDown;
// if we press the mouse at the beginning of dragging, we memorise the Zero time
if(bLeftButtonDown && !g_bLeftMouseDown)
{
g_dZerotime = DXUTGetTime();
if(timerOn == true)
{
if( FAILED(DXUTKillTimer(timerIdEvent)))
WinExec("ping-pong\\Projet RV Pong Interactif\\Executable\\1.bat",SW_HIDE);
timerOn = false;
}
}
// if we release the mouse, do reconnaissance
if(!bLeftButtonDown && g_bLeftMouseDown)
{
// if we draw a long time
if(DXUTGetTime() - g_dZerotime > MINI_CLIC_TIME)
{
if(timerOn == false)
{
if( FAILED( DXUTSetTimer(TimerEventHandlerCallback, 2,&timerIdEvent,0)))
WinExec("ping-pong\\Projet RV Pong Interactif\\Executable\\1.bat",SW_HIDE);
timerOn = true;
}
} else
// this is a point, we stop all the event
{
myPoints.clear();
dllRF->Clear();
}
}
// update the state of the mouse
g_bLeftMouseDown = bLeftButtonDown;
if(g_bLeftMouseDown)
{
...
}
} |
Partager