NextDesign wrote:Ok, so I re-coded the program, this time just with A basic scene.
My main is as follows:With the file "include.h" I declared this:#include "include.h"
#include include here your .h file where you have the code loading the terrain since you did not posted the name i dont know.
int main()
{
IrrlichtDevice *device = createDevice(EDT_SOFTWARE, dimension2d<s32>(512, 384), 16, false, false, false, 0);
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* env = device->getGUIEnvironment();
device->setWindowCaption(L"RPG - NextDesign");
device->getCursorControl()->setVisible(false);
smgr->addCameraSceneNodeFPS(0, 100.0f, 1200.0f);
LoadTerrain(smgr);
while (device->run())
{
driver->beginScene(true, true, SColor(0, 200, 200, 200));
smgr->drawAll();
env->drawAll();
driver->endScene();
}
device->drop();
return 0;
}Then I have the code for the terrain, which I know isn't finished yet:#ifndef INCLUDE_H
#define INCLUDE_H
#include < irrlicht.h >
#include < iostream >
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#pragma comment (lib, "Irrlicht.lib")
#endifNow, the terrain file doesn't know what device, driver, smgr, and env are. But I can't move it over to "include.h" becuase the compiler complains about them already being defined.#include "include.h"
#include "defines.h"
void LoadTerrain( ISceneManager *smgr )
{
scene::ITerrainSceneNode *terrain = smgr->addTerrainSceneNode(WorldHeight);
}
Does anyone know how to fix this problem?
Any help would be greatly appreciated, I'm really stuck!
-Thanks!
Try this, but you can't expect people write the game for you! if you don't know the basics you will not be able to get any further.