I have a newbie question.
A friend of mine and I are beginning a VR project, and we've chosen to use the Irrlicht engine to accomplish this. He's a CompSci major but he's not being too helpful at the moment, and I'm trying to learn to program in order to get the project rolling.
I've decided to use .obj files, since we already have a copy of Maya and I know it fairly well.
Unfortunately try as I might I just cannot get a program to compile. I've tried all I know (which isn't much, mind you...) including forum diving here, and I'm more or less stuck..
So, I was wondering if any of you programming gurus out there might point out the ID10t s in my code.
Code: Select all
#include <irrlicht.h>
#include <iostream>
using namespace irr;
#pragma comment(lib, "Irrlicht.lib")
int main()
{
// ask user for driver
video::E_DRIVER_TYPE driverType;
printf("Please select the driver you want for this example:\n"\
" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
" (d) Software Renderer\n (e) Apfelbaum Software Renderer\n"\
" (f) NullDevice\n (otherKey) exit\n\n");
char i;
std::cin >> i;
switch(i)
{
case 'a': driverType = video::EDT_DIRECT3D9;break;
case 'b': driverType = video::EDT_DIRECT3D8;break;
case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_SOFTWARE; break;
case 'e': driverType = video::EDT_SOFTWARE2;break;
case 'f': driverType = video::EDT_NULL; break;
default: return 1;
}
// create device and exit if creation failed
IrrlichtDevice *device =
createDevice(driverType, core::dimension2d<s32>(640, 480));
if (device == 0)
return 1; // could not create selected driver.
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
device->getFileSystem()->addZipFileArchive("../../media/test.zip");
return 0;
int object () *********
{
IAnimatedMesh* mesh = smgr->getMesh("regularsize.obj");
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(regularsize);
if (mesh)
node = smgr->addOctTreeSceneNode(mesh->getMesh(0));
if (node)
node->setPosition(core::vector3df(-1300,-144,-1249));
smgr->addCameraSceneNodeFPS();
device->getCursorControl()->setVisible(false);
return 0;
}
; int lastFPS = -1;
while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, video::SColor(0,200,200,200));
smgr->drawAll();
driver->endScene();
int fps = driver->getFPS();
if (lastFPS != fps)
{
core::stringw str = L"STILL trying to make a basic .obj loader![";
str += driver->getName();
str += "] FPS:";
str += fps;
device->setWindowCaption(str.c_str());
lastFPS = fps;
}
}
device->drop();
return 0;
}
Error codes are:
in function int main ()
Line 55- expected primary expression before 'int'
Line 55- expected ';' before 'int'
Stars denote line 55- *********
Thanks for all your help!