Environment: windows 7 64 bit, c++ visual studio 2012, no clr.
I'm new in irrlicht.
I have my own framework which I use in order to draw simple primitive in 3D
such as: lines, images,text, points etc.
In this framework:
*I use openGL (I define my own coordinate system).
* the framework has it's own "Game Loop"
now I want to draw a model using irrlicht within this framework.
I created a device using an handle I gave and set it to openGL:
Code: Select all
HWND hIrrlichtWindow = mGlFrame->GetHandle();
irr::video::SExposedVideoData videodata(hIrrlichtWindow);
irr::SIrrlichtCreationParameters param;
param.DriverType = irr::video::EDT_OPENGL;
param.WindowId = reinterpret_cast<void*>(hIrrlichtWindow);
param.Bits = 16;
param.Fullscreen = false;
param.Stencilbuffer = false;
param.Vsync = false;
irr::IrrlichtDevice* device = irr::createDeviceEx(param);
Code: Select all
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IAnimatedMesh* mesh = smgr->getMesh("sydney.md2");
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
node->setMaterialFlag(EMF_LIGHTING, false);
// I set a model position and camera position in such way I can see the result
smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
Code: Select all
driver->beginScene(false, true, SColor(0,0,0,255));
smgr->drawAll();
driver->endScene();
1.When I draw the model it seems the normals (it's my explanation for the phenomena) does not look right,
meaning - the back of the model is drawn in the front (sydney's left arm is drawn in the same plane of it's right although they are clearly not in the same plane).
2. it seems irrlicht sometimes causes the framework's game-loop to be stuck (I guess)
3. some of the primitive I draw is not shown
does anybody have an idea?