I should break out the sections into functions but haven't yet. My main then would consist of about 4 functions.
int WINAPI WinMain(HINSTANCE hInstance,
//Create window for app
//Load settings from INI
INIReader *pReader = 0;
pReader = new INIReader();
catch (INIReader::INIFileError &err)
::MessageBox(0,"Cannot open INI file",0,0);
int iWidth = pReader->GetInt("Display","ScreenWidth");
int iHeight = pReader->GetInt("Display","ScreenHeight");
//Really need to make an ini function to get a bool from the file
bool bWindowed = false;
int result = ::MessageBox(0,"Do you wish to run in fullscreen mode?","Screen mode",
MB_YESNO | MB_ICONQUESTION);
if (result == IDNO)
bWindowed = true;
//Start the app by initializing D3D
::MessageBox(0, "InitD3D() - FAILED", 0, 0);
//Setup the app
::MessageBox(0, "Setup() - FAILED", 0, 0);
catch (X3DException &e)
catch (std::exception &e)
::MessageBox(0,e.what(),"UNKNOWN EXCEPTION CAUGHT",MB_OK | MB_ICONEXCLAMATION);
std::cout << e.what() << std::endl;
//Start the loop
//If we get here, we are done
//Clean up the memory and COM objects
//Ok Windows, it's all yours
The APIs are different and the calls are different. It will be more of a 'how do I do this in Linux/Windows' question when porting between the two. API calls for Win32 won't work in Linux.
Is there any way to be sure that when i send them the code it will work in windows as long as I am not using any linux specific functions.
The best way in my opinion is to define an interface that will not change and will define the behavior of the application. Then the implementation can be in Linux or Windows and as long as the interface does not change it will not break either of you.