Code: Select all
irr::IReferenceCounted CXX0030: Error: expression cannot be evaluated
Heres my code
init.h
Code: Select all
#include "irrlicht.h"
#include "driverChoice.h"
#include "iostream"
class initGame
{
public:
initGame();
int CreateDevice();
void StartGame();
irr::IrrlichtDevice *graphics;
float time;
};
Code: Select all
#include "StdAfx.h"
#include "init.h"
using namespace irr;
using namespace std;
#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif
int main()
{
initGame Init;
initGame();
Init.CreateDevice();
Init.StartGame();
return 0;
}
initGame::initGame()
{
}
void initGame::StartGame()
{
graphics->setWindowCaption(L"SAFSSDFSDFS");
}
int initGame::CreateDevice()
{
video::E_DRIVER_TYPE driverType;
IrrlichtDevice *graphics = createDevice(video::EDT_DIRECT3D9, core::dimension2d<u32>(1024,768),32,false,true,false,0);
/*
if(!graphics)
{
return 1; //returns 1
}
*/
//KeyListener receiver;
graphics->setWindowCaption(L"Test");
video::IVideoDriver *driver=graphics->getVideoDriver();
scene::ISceneManager *smgr=graphics->getSceneManager();
gui::IGUIEnvironment* gui=graphics->getGUIEnvironment();
gui::IGUISkin* skin = gui->getSkin();
gui::IGUIFont* font = gui->getFont("../../media/fonthaettenschweiler.bmp");
while(graphics->run())
{
//core::vector3df playerposition=playercam->getAbsolutePosition();
driver->beginScene(true, true, video::SColor(255,20,20,100));
smgr->drawAll();
gui->drawAll();
driver->endScene();
}
graphics->drop();
return 0;
}