its my first post and m new here
straight to the problem ,
when i tried to draw a 3d line along with the gui env. , then whenever i clicked the menu , the line goes black colored.. where as i drawn it in white color ...
see herez the code :
Code: Select all
IrrlichtDevice *Device = 0;
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(const SEvent& event)
{
if(event.EventType==EET_GUI_EVENT)
if(event.GUIEvent.EventType == EGET_MENU_ITEM_SELECTED)
Device->getGUIEnvironment()->addMessageBox(L"asd",L"asd");
}
};
int main(){
Device = createDevice(EDT_OPENGL, dimension2d<s32>(640,480),16);
IGUIContextMenu *menu= Device->getGUIEnvironment()->addMenu();
menu->addItem(L"file",-1,true,true);
menu->getSubMenu(0)->addItem(L"open",101);
Device->getSceneManager()->addCameraSceneNodeFPS();
Device->getSceneManager()->getActiveCamera()->setFarValue(20000.0f);
bool c=false;
while(Device->run()){
Device->getVideoDriver()->beginScene(true,true,SColor(255,100,100,100));
Device->getVideoDriver()->draw3DLine(vector3df(-50,0,0),vector3df(50,0,0),SColor(255,255,255,255));
Device->getSceneManager()->drawAll();
Device->getGUIEnvironment()->drawAll();
tempNode=0;
/tempNode = col->getSceneNodeFromCameraBB(Device->getSceneManager()->getActiveCamera());
if(tempNode)
c=true;
else
c=false;
if(c)
{
Device->getGUIEnvironment()->getBuiltInFont()->draw(L"collision",rect<s32>(0,0,100,10),SColor(255,255,255,255));
};
if(!c){
tempNode=0;
}
Device->getVideoDriver()->endScene();
}
Device->drop();
}