static HINSTANCE hinst; // The instance handle of our application |
static RECT wndRect; // A rectangle object for the window's client area |
static HWND hwndApp; // The handle of the application window |
static LPDIRECTDRAW lpdd; // Pointer to DirectDraw object |
static LPDIRECTDRAWSURFACE lpFrontBuffer; // Pointer to front buffer |
static LPDIRECTDRAWSURFACE lpBackBuffer; // Pointer to back buffer |
static LPGUID lpServiceProviderGuid; // Pointer to GUID of the service provider |
static LPDIRECTPLAY lpDirectPlay1; // Pointer for the DirectPlay Object |
static DPID playerID; // To store the player ID |
static BOOL joinSession; // Join a session(TRUE) or create a new one(FALSE) |
// Function declarations for forward references |
static BOOL WinInit( HINSTANCE hInst, int nCmdShow ); //Initialize & set up Windows |
static BOOL DXInit(void); //Initialize & set up DirectX components |
static void UpdateFrame(char* direction); |
static void CleanUp(); |
// Called by DirectX when enumerating service providers |
static BOOL FAR PASCAL DirectPlayEnumerateCallback( |
LPGUID lpSPGuid, |
LPTSTR lpszSPName, |
DWORD dwMajorVersion, |
DWORD dwMinorVersion, |
LPVOID lpContext |
); |
// Called by DirectPlay when enumerating sessions |
static BOOL FAR PASCAL EnumSessionsCallback( |
LPDPSESSIONDESC lpSessionDesc, |
LPVOID lpContext, |
LPDWORD lpdwTimeOut, |
DWORD dwFlags |
); |
//Helper functions |
static HRESULT CreateDirectPlayInterface(); |
static HRESULT FindSession(); |
static HRESULT OpenSession(); |
static HRESULT MakePlayer(); |
Variable & |
Function |
Declarations |