home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS - Coast to Coast
/
simteldosarchivecoasttocoast2.iso
/
wpj_mag
/
wpjv1n8.zip
/
GDI.ZIP
/
PBALL.ZIP
/
PBALL.H
< prev
next >
Wrap
Text File
|
1993-08-10
|
2KB
|
63 lines
// Menu ID's
#define IDM_ABOUT 100
#define IDM_SPEED1 200
#define IDM_SPEED2 201
#define IDM_SPEED3 202
#define IDM_SPEED4 203
// added these defines so that code is easy to read
#define LEFT 1
#define RIGHT 0
#define UP 1
#define DOWN 0
// function prototypes
int PASCAL WinMain(HANDLE, HANDLE, LPSTR, int);
BOOL InitApplication(HANDLE);
BOOL InitInstance(HANDLE, int);
long FAR PASCAL MainWndProc(HWND, unsigned, WORD, LONG);
BOOL FAR PASCAL About(HWND, unsigned, WORD, LONG);
void DrawBitmap (HBITMAP hBitmap, int xStart, int yStart);
void DrawBall(void);
void MoveBall(void);
void EraseOldBall(void);
// Variables to keep track of which menu item is checked
WORD wPrevSpeed = IDM_SPEED2;
WORD wPrevItem;
// Keep track of Windows variables
HWND hWnd; // handle to the window
HANDLE hInst; // current instance
HDC hDC; // handle to the device context for the window
HBITMAP hbBall;
BITMAP bmBall;
HDC hMemoryDC;
// variables to track position and direction of the ball
int x=10;
int xdirection=DOWN;
int y=10;
int ydirection=RIGHT;
// how many pixels the ball is moved every time a timer message
// is received
int AnimeStep=5;
PAINTSTRUCT ps;
DWORD dwSize;
WORD wHeight, wWidth;
int nWidth;
int nHeight;
RECT r; // Storage for window dimensions and invalid region
RECT rect1; // before moving
RECT rect2; // after moving
RECT rect3; // intersection of rect1 and rect2
RECT rect4; // first part of erasing region
RECT rect5; // second part of erasing region