Page 1 of 1

DirectX 9 message pumping and event handling

Posted: Wed Oct 20, 2010 19:04
by Fra3ture
I have CEGUI working DirectX 9. I have managed to get it to read in XML files and create a few buttons with it. The only problem I have now is getting both getting user input and proper event handling working.

I've looked through the documentation on both but I was very confused about how both of these work. I thought I had it working at one stage but it turns out I had implimented direct input instead :?

Could someone please show me working code on how both of these work?

Re: DirectX 9 message pumping and event handling

Posted: Wed Oct 20, 2010 19:07
by Kulik
It's up to you to handle input, CEGUI only has functions that allow you to "inject" that input into it. Doing this via DirectInput is fine...

Look into CEGUI::System::inject* methods

Re: DirectX 9 message pumping and event handling

Posted: Wed Oct 20, 2010 19:53
by Fra3ture
Ah, ok. Thanks.

How about event handling though? I.e getting the application to quit when I hit the exit button on the gui?

Re: DirectX 9 message pumping and event handling

Posted: Wed Oct 20, 2010 20:29
by Kulik
You implement a method that quits your application and then you subscribe that method to the button. How you do the quitting is again your business :D

Code: Select all

quitButton->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&YourClass::handle_Quit, theClassInstance));


HTH