Вроде все правильно, почему так? Что забыл? Не видит device, driver, smgr, guienv, camera, skybox, font.
#include "Game.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
class StartClass
{
public:
IrrlichtDevice* device;
video::IVideoDriver* driver;
scene::ISceneManager* smgr;
IGUIEnvironment* guienv;
scene::ICameraSceneNode* camera;
scene::ISceneNode* skybox;
gui::IGUIFont* font;
StartClass::StartClass()
{
device = createDevice(video::EDT_OPENGL,core::dimension2d<u32>(800,600));
driver = device->getVideoDriver();
smgr = device->getSceneManager();
guienv = device->getGUIEnvironment();
camera = smgr->addCameraSceneNodeFPS();
skybox=smgr->addSkyBoxSceneNode(
driver->getTexture("textures/skyboxes/Swamp/Swamp_sky_up.jpg"),
driver->getTexture("textures/skyboxes/Swamp/Swamp_sky_dn.jpg"),
driver->getTexture("textures/skyboxes/Swamp/Swamp_sky_lf.jpg"),
driver->getTexture("textures/skyboxes/Swamp/Swamp_sky_rt.jpg"),
driver->getTexture("textures/skyboxes/Swamp/Swamp_sky_ft.jpg"),
driver->getTexture("textures/skyboxes/Swamp/Swamp_sky_bk.jpg"));
device->getCursorControl()->setVisible(false);
font = device->getGUIEnvironment()->getFont("font/ddfont.png");
driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);
camera->setPosition(core::vector3df(0,0,0));
camera->setFarValue(10000.0f);
}
};
int main()
{
AiSceneLoad<int>(1,0,0,0);
s32 lastFPS = -1;
while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, 0);
smgr->drawAll();
font->draw(L"Dark Dimension Pre-Alpha 0.1",
core::rect<s32>(420,570,420,570),
video::SColor(255,255,255,255));
font->draw(L"The quick brown fox jumps over the lazy dog.",
core::rect<s32>(0,0,0,0),
video::SColor(255,255,255,255));
driver->endScene();
const s32 fps = driver->getFPS();
if (lastFPS != fps)
{
core::stringw str = L"Dark dimension ";
str += driver->getName();
str += "] FPS:";
str += fps;
device->setWindowCaption(str.c_str());
lastFPS = fps;
}
}
device->drop();
}