////////////////////////////////////////////////////////////////////////////GameMain.h////////////////////////////////////////////////////////////////////////////#ifndef GAMEMAIN#define GAMEMAIN#include <windows.h>#include "C:\Games\Brent's Games\Outpost\Outpost.h"bool Game_Init(/*TOutpost_Graphic, */HWND, int, int);bool Game_Main();void Game_End();#endif////////////////////////////////////////////////////////////////////////////GameInit.cpp////////////////////////////////////////////////////////////////////////////#include <windows.h>#include "C:\Games\Brent's Games\Outpost\Outpost.h"bool Game_Init(/*TOutpost_Graphic Graphic, */HWND hWnd, int Width, int Height){ if(!Graphic.D3D_Init(hWnd, 800, 600)) return false; return true;}////////////////////////////////////////////////////////////////////////////WinMain.cpp////////////////////////////////////////////////////////////////////////////#define WIN32_LEAN_AND_MEAN#define DIRECTINPUT_VERSION 0x0800#include <windows.h>#include "GameMain.h"...TOutpost_Graphic Graphic;...int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){ ... if(!Game_Init(Graphic, g_hWnd, 800, 600)) //error message}...////////////////////////////////////////////////////////////////////////////Outpost.h////////////////////////////////////////////////////////////////////////////#ifndef OUTPOST#define OUTPOST#include <d3d8.h>#include <d3dx8.h>#include <dinput.h>#include <dplay8.h>#include <dpaddr.h>#include "OutpostG.h" //Graphic#include "OutpostI.h" //Input#endif////////////////////////////////////////////////////////////////////////////OutpostG.h (there's no Outpost.cpp)////////////////////////////////////////////////////////////////////////////#ifndef OUTPOSTG#define OUTPOSTG#include <d3d8.h>#include <d3dx8.h>#include "Outpost.h"#include "TParticle.h"#define WThinLine_FVF (D3DFVF_XYZ | D3DFVF_DIFFUSE)#define SThinLine_FVF (D3DFVF_XYZRHW | D3DFVF_DIFFUSE)#define PolyObject_FVF (D3DFVF_XYZ | D3DFVF_TEX1)#define POINT_LIGHT 0#define DIRECTIONAL_LIGHT 1class declarations from this point....#include "OutpostG.cpp"#endif////////////////////////////////////////////////////////////////////////////OutpostI.h////////////////////////////////////////////////////////////////////////////#ifndef OUTPOSTI_H#define OUTPOSTI_H#include <dinput.h>#include "Outpost.h"#define LEFT_BUTTON 0#define RIGHT_BUTTON 1#define MIDDLE_BUTTON 2#define MouseButtonState(x) ((m_MouseState.rgbButtons[x] & 0x80) ? TRUE : FALSE)class TOutpost_Input {private: UCHAR keystate[256]; DIMOUSESTATE m_MouseState; int m_MouseXPos, m_MouseYPos; LPDIRECTINPUT8 m_lpdi; // direct input object LPDIRECTINPUTDEVICE8 m_lpdikey; LPDIRECTINPUTDEVICE8 m_lpdimouse;public: TOutpost_Input(); ~TOutpost_Input(); bool DI_Init(HINSTANCE, HWND); void DI_End(); bool KeyDown(int n); int MouseXPos(); int MouseYPos(); bool MouseDown(int); bool UpdateKeyboard(); bool UpdateMouse(int, int, HWND, bool Windowed = false);};#include "OutpostI.cpp"#endif
I don't know how to do code blocks. But this is my code.