Не могу понять, в чем ошибка, поправьте, может, где-то что-то не так делаю. Если убрать StartClass();
, то программ-то пишет, что непонятно, чему равно s
. Использую irrlicht
, но в данной ситуации это не имеет значения.
StartGame.h
#ifndef _STARTGAME_H
#define _STARTGAME_H
using namespace irr;
using namespace gui;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
class StartClass
{
public:
void Start();
StartClass();
IrrlichtDevice *device;
video::IVideoDriver* driver;
scene::ISceneManager* smgr;
IGUIEnvironment* guienv;
scene::ICameraSceneNode* camera;
};
#endif
StartGame.cpp
#include <irrlicht.h>
#include <iostream>
#include <sys/stat.h>
#include "AILoad.h"
#include <cmath>
#include "StartGame.h"
using namespace irr;
using namespace gui;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
void StartClass::Start()
{
StartClass s;
s.device = createDevice(video::EDT_OPENGL,core::dimension2d<u32>(800,600));
s.driver = s.device->getVideoDriver();
s.smgr = s.device->getSceneManager();
s.guienv = s.device->getGUIEnvironment();
s.camera = s.smgr->addCameraSceneNodeFPS();
}
main.cpp
#include "main.h"
#include <irrlicht.h>
#include <iostream>
#include <sys/stat.h>
#include "AILoad.h"
#include <cmath>
#include "StartGame.h"
using namespace irr;
using namespace gui;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
#ifdef _MSC_VER
#pragma comment(lib, "Irrlicht.lib")
#endif
int main()
{
StartClass s;
s.camera->setPosition(core::vector3df(0,0,0));
s.camera->setFarValue(10000.0f);
}
Ошибка: