Say this is my main.cpp
Code: Select all
#include "masterhead.h"
int main()
{
createAcorn();
device->drop();
return 0;
}
#include "functionmain.h"
Code: Select all
#pragma once
#include <irrlicht.h>
// irrlicht's namespaces
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
// Link the library
#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif
#include "prototype.h"
Code: Select all
#pragma once
// CREATE THE ENGINE AND DRIVERS
int createAcorn(void)
{
IrrlichtDevice *device =
#ifdef _IRR_OSX_PLATFORM_
createDevice( video::EDT_OPENGL, dimension2d<s32>(640, 480), 16,
false, false, false, 0);
#else
createDevice( video::EDT_SOFTWARE, dimension2d<s32>(640, 480), 16,
false, false, false, 0);
#endif
if(!device)
return 1;
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
}
/****************************************************************/
// FRAMES PER SECOND return
int returnFPS(void)
{
driver->getFPS();
}
// Current Software Running return
int returnDriver(void)
{
driver->getName();
}
Also, I call this project Acorn, which will explain why the function is called createAcorn() if anyone doesn't understand that, createAcorn() is the initiation function.
Also, I'm probably gonna get yelled at for using an #include at the bottom of main.cpp
My question I need help with is... How do I organize my source codes to work with the compiler I'm using (Visual C++ 2008 Express)