M
Michael Sgier
Hello
In main.cpp:
CWorld* gameWorld = new CWorld; // do i need this?
CSimpEngine* MyCSimpEngine = new CSimpEngine;
CWorld *world = MyCSimpEngine->OnGetWorld();
world->Prepare(); //here i get the error below
in simpengine.h:
class CSimpEngine //: public CEngine
{
private:
CWorld *gameWorld;
public:
CWorld *OnGetWorld() { return gameWorld; }
}
in world.cpp:
CWorld::CWorld()
{
CTerrain* terrain = new CTerrain(256, 0.5);
}
world.cpp:59: error: ` terrain' undeclared (first use this function)
Why do i get the error? After my understanding OnGetWorld initializes
CWorld which constructor initializes terrain? Am i wrong? Do i need the
first line of main.cpp?
THANKS and regards from Switzerland
Michael
In main.cpp:
CWorld* gameWorld = new CWorld; // do i need this?
CSimpEngine* MyCSimpEngine = new CSimpEngine;
CWorld *world = MyCSimpEngine->OnGetWorld();
world->Prepare(); //here i get the error below
in simpengine.h:
class CSimpEngine //: public CEngine
{
private:
CWorld *gameWorld;
public:
CWorld *OnGetWorld() { return gameWorld; }
}
in world.cpp:
CWorld::CWorld()
{
CTerrain* terrain = new CTerrain(256, 0.5);
}
world.cpp:59: error: ` terrain' undeclared (first use this function)
Why do i get the error? After my understanding OnGetWorld initializes
CWorld which constructor initializes terrain? Am i wrong? Do i need the
first line of main.cpp?
THANKS and regards from Switzerland
Michael