home *** CD-ROM | disk | FTP | other *** search
- #include "StrangeGlove.h"
-
- extern WindowPtr gBallWindow;
- extern GrafPort ballOffScr;
- extern Boolean gBall;
-
- /***** DrawBall *****/
- DrawBall(int x, int y, int z)
- {
- GrafPtr oldPort;
- Rect ballRect;
- int size;
-
- GetPort(&oldPort);
- SetPort(&ballOffScr); /* Set port to off-screen port */
-
- EraseRect(&(gBallWindow->portRect));
-
- size = z / 5;
- ballRect.top = y - size;
- ballRect.left = x - size;
- ballRect.bottom = y + size;
- ballRect.right = x + size;
- PaintOval(&ballRect);
-
- GetWind(gBallWindow, ballOffScr); /* Copy stuff to window */
-
- SetPort(oldPort);
- }
-
-
- /***** StartBall *****/
- StartBall()
- {
- gBall = TRUE;
-
- SetPort(gBallWindow);
- ShowWindow(gBallWindow);
- SelectWindow(gBallWindow);
- AdjustWindowMenu();
-
- StartContinuous(); /* Put glove into continuous mode */
- }
-
-
- /***** StopTerm *****/
- StopBall()
- {
- gBall = FALSE;
- HideWindow(gBallWindow);
- AdjustWindowMenu();
- }
-
-