Problem closing the program with 1.4b

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Coolkat88
Posts: 30
Joined: Tue Oct 03, 2006 3:14 pm

Problem closing the program with 1.4b

Post by Coolkat88 »

Hey all. Downloaded the 1.4beta and was testing it out for a new project of mine. everything compiles fine and works as intended, however the program wont actually CLOSE. the irrlicht window closes but the exe remains in the processes window (and i get a Premission Denied error if i try to recompile).

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;
     
}
now i guess this is new to 1.4b, but i couldn't compile with OnEvent(SEvent event) and i had to change it to OnEvent(const SEvent& event)


device creation line:

Code: Select all

dev = createDevice(EDT_OPENGL, dimension2d<s32>(1024,768), 32, false, true, true, receiver);
the loop:

Code: Select all

while(dev->run())
    {
           dri->beginScene(true, true, SColor(255,0,0,0));
           
           smgr->drawAll();
           gui->drawAll();
           
           dri->endScene();
    }          

    dev->drop();
I pass the dev pointer to the init function for the event receiver class.. and the button is drawn with just

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.
Jgoldnight
Posts: 31
Joined: Thu Jun 07, 2007 6:23 pm
Location: New York
Contact:

Post by Jgoldnight »

I ran into the exact same problem with the new version. If you run the "Demo" example, it crashes because of a call to device->closeDevice(). I guess things don't work as nicely as they did in 1.3.

I've been killing myself over wondering if there were errors in my design, resulting in a system hang. Back to 1.3.1 for sure...
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, there's a problem with closing the device, should be fixed in the final release as it is a known problem.
Post Reply