DirectX 9 message pumping and event handling

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Fra3ture
Just popping in
Just popping in
Posts: 9
Joined: Wed Oct 13, 2010 14:59

DirectX 9 message pumping and event handling

Postby Fra3ture » Wed Oct 20, 2010 19:04

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?

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: DirectX 9 message pumping and event handling

Postby Kulik » Wed Oct 20, 2010 19:07

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

Fra3ture
Just popping in
Just popping in
Posts: 9
Joined: Wed Oct 13, 2010 14:59

Re: DirectX 9 message pumping and event handling

Postby Fra3ture » Wed Oct 20, 2010 19:53

Ah, ok. Thanks.

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

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: DirectX 9 message pumping and event handling

Postby Kulik » Wed Oct 20, 2010 20:29

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


Return to “Help”

Who is online

Users browsing this forum: No registered users and 11 guests