I pretty much followed the examples of the GUI tutorial and i came up with this code. hopefully i just made some stupid mistake and you all can find it. (i just kinda threw this all together today)
Event Reciever:
Code: Select all
void EHandle::init(IrrlichtDevice* dev)
{
d = dev;
scenenum = 0;
}
bool EHandle::OnEvent(const SEvent& event)
{
if(event.EventType == EET_GUI_EVENT)
{
s32 id = event.GUIEvent.Caller->getID();
switch(event.GUIEvent.EventType)
{
case EGET_BUTTON_CLICKED:
if(id == 101)
{
d->closeDevice();
return true;
}
break;
}
}
return false;
}device creation line:
Code: Select all
dev = createDevice(EDT_OPENGL, dimension2d<s32>(1024,768), 32, false, true, true, receiver);Code: Select all
while(dev->run())
{
dri->beginScene(true, true, SColor(255,0,0,0));
smgr->drawAll();
gui->drawAll();
dri->endScene();
}
dev->drop();Code: Select all
gui->addButton(rect<s32>(0,0,100,100), 0, 101, L"Hello World");When i run the program I get a button that appears in the top corner, i click on it.. the window closes out. no problems except that the executable is still running in the task manager.
I compiled this using DevC++ 4.9.9.2 on win XP.
thank you in advance for any help.