X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=ABM2%2Fmain.cpp;h=48dcd73f664a1692542a03fd47e7b3546c122ccc;hb=c0066ee748d25faed654973d09fab4d90ed5cc51;hp=061cce287b80b62b7731f51d5ac2c27f1b077c21;hpb=0b314338a46fe83c1c4bb646da858ebd5d4a7317;p=matthijs%2FABM2.git diff --git a/ABM2/main.cpp b/ABM2/main.cpp index 061cce2..48dcd73 100755 --- a/ABM2/main.cpp +++ b/ABM2/main.cpp @@ -1,6 +1,8 @@ // include the basic windows header files and the Direct3D header file +#ifdef WIN32 #include #include +#endif #include "Engine/engine.h" #include "Engine/game.h" @@ -11,13 +13,13 @@ #define SCREEN_WIDTH 640 #define SCREEN_HEIGHT 480 +#ifdef WIN32 HINSTANCE hInstance; HWND hWnd; // the WindowProc function prototype LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); - class CPongTask : public ITask { public: @@ -118,6 +120,7 @@ public: AUTO_SIZE; }; +#endif // WIN32 void CApplication::Run(int argc, char *argv[]) { //open logfiles @@ -168,6 +171,7 @@ void CApplication::Run(int argc, char *argv[]) delete CSettingsManager::GetSingletonPtr(); } +#ifdef WIN32 // the entry point for any Windows program int WINAPI WinMain(HINSTANCE hInst, @@ -215,7 +219,6 @@ int WINAPI WinMain(HINSTANCE hInst, return 0; } - // this is the main message handler for the program LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { @@ -230,3 +233,17 @@ LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara return DefWindowProc (hWnd, message, wParam, lParam); } +#else // WIN32 +int main(int argc, char *argv[]) +{ + new CApplication(); + CApplication::GetSingleton().Run(argc,argv); + delete CApplication::GetSingletonPtr(); + + //clean up any remaining unreleased objects + IMMObject::CollectRemainingObjects(true); + + return 0; +} +#endif //WIN32 +