@ -39,8 +39,12 @@ int main(void)
{
{
/ / Update
/ / Update
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / Get multiple touchpoints
for ( int i = 0 ; i < MAX_TOUCH_POINTS ; + + i ) touchPositions [ i ] = GetTouchPosition ( i ) ;
/ / Get the touch point count ( how many fingers are touching the screen )
int tCount = GetTouchPointCount ( ) ;
/ / Clamp touch points available ( set the maximum touch points allowed )
if ( tCount > MAX_TOUCH_POINTS ) tCount = MAX_TOUCH_POINTS ;
/ / Get touch points positions
for ( int i = 0 ; i < tCount ; + + i ) touchPositions [ i ] = GetTouchPosition ( i ) ;
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / Draw
/ / Draw
@ -49,7 +53,7 @@ int main(void)
ClearBackground ( RAYWHITE ) ;
ClearBackground ( RAYWHITE ) ;
for ( int i = 0 ; i < MAX_TOUCH_POINTS ; + + i )
for ( int i = 0 ; i < tCount ; + + i )
{
{
/ / Make sure point is not ( 0 , 0 ) as this means there is no touch for it
/ / Make sure point is not ( 0 , 0 ) as this means there is no touch for it
if ( ( touchPositions [ i ] . x > 0 ) & & ( touchPositions [ i ] . y > 0 ) )
if ( ( touchPositions [ i ] . x > 0 ) & & ( touchPositions [ i ] . y > 0 ) )
@ -72,4 +76,4 @@ int main(void)
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
return 0 ;
return 0 ;
}
}