summaryrefslogtreecommitdiffhomepage
path: root/examples/web/core/core_input_multitouch.c
diff options
context:
space:
mode:
authorRay <[email protected]>2019-05-20 16:40:30 +0200
committerRay <[email protected]>2019-05-20 16:40:30 +0200
commit3d7d174c70b2d00fd879ade64c5085d4ff34d4aa (patch)
tree3b690948f186f855aa2ee8bab312b3ca28a56200 /examples/web/core/core_input_multitouch.c
parent0b56b996bd053ec875c229e9793f7806b666839c (diff)
downloadraylib.com-3d7d174c70b2d00fd879ade64c5085d4ff34d4aa.tar.gz
raylib.com-3d7d174c70b2d00fd879ade64c5085d4ff34d4aa.zip
Review and recompile ALL examples
Diffstat (limited to 'examples/web/core/core_input_multitouch.c')
-rw-r--r--examples/web/core/core_input_multitouch.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/web/core/core_input_multitouch.c b/examples/web/core/core_input_multitouch.c
index e4dd9f1..75f659c 100644
--- a/examples/web/core/core_input_multitouch.c
+++ b/examples/web/core/core_input_multitouch.c
@@ -37,9 +37,9 @@ Vector2 touchPosition = { 0.0f };
void UpdateDrawFrame(void); // Update and Draw one frame
//----------------------------------------------------------------------------------
-// Main Enry Point
+// Program Main Entry Point
//----------------------------------------------------------------------------------
-int main()
+int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
@@ -50,7 +50,7 @@ int main()
#else
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
-
+
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
@@ -74,7 +74,7 @@ void UpdateDrawFrame(void)
// Update
//----------------------------------------------------------------------------------
ballPosition = GetMousePosition();
-
+
ballColor = BEIGE;
if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) ballColor = MAROON;
@@ -84,7 +84,7 @@ void UpdateDrawFrame(void)
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) touchCounter = 10;
if (IsMouseButtonPressed(MOUSE_MIDDLE_BUTTON)) touchCounter = 10;
if (IsMouseButtonPressed(MOUSE_RIGHT_BUTTON)) touchCounter = 10;
-
+
if (touchCounter > 0) touchCounter--;
//----------------------------------------------------------------------------------
@@ -96,15 +96,15 @@ void UpdateDrawFrame(void)
// Multitouch
for (int i = 0; i < MAX_TOUCH_POINTS; ++i)
- {
+ {
touchPosition = GetTouchPosition(i); // Get the touch point
-
+
if ((touchPosition.x >= 0) && (touchPosition.y >= 0)) // Make sure point is not (-1,-1) as this means there is no touch for it
{
// Draw circle and touch index number
DrawCircleV(touchPosition, 34, ORANGE);
DrawText(FormatText("%d", i), touchPosition.x - 10, touchPosition.y - 70, 40, BLACK);
- }
+ }
}
// Draw the normal mouse location