(no bug) Prob. when IRRlicht is used with wxWidget
Posted: Thu Mar 24, 2011 7:56 pm
Hi, I think thoses problems could affect Irrlicht response and perhaps could NOT be bugs, I'm just asking because I've had weird behaviors coming from the IRRlicht window. This as all been experimented with Irrlicht 1.7.2 and MSVC on Windows Vista.
I was able to use IRRlicht inside a WxWidget application. wxWidget recommend that we use their "event loop" and refresh our application.
I tried to use their recommendation when I started implementing wxWidget for the IRR Rpg Builder project:
http://irrrpgbuilder.sourceforge.net/fo ... p=291#p291
-- When wxWidget drive the main loop:
Using their recommendation, the main loop is done inside WxWidget and I'm intercepting events and forwarding them to IRRlicht (mouse and keyboard events), Irrlicht is refreshed by a timer event.
But I had this problems: (my biggest problem so far)
- animated meshes don't animate, they only move to their first frame. (they still move on the screen but their animation is not playing)
- The Irrlicht scroller GUI is working but the slider GUI element is not receiving the mouse events and is not working, but the button arrows are still functionnal.
Theses problems are related to how IRRlicht received the events from wxWidget and "might" not be bugs. (If someone have an idea how to set the events to be received properly by IRRlicht it would be great)
- I had weird issues with the way the keyboard event were received by IRRlicht, all the letters are received as capital letters. (perhaps I need to process them further before sending them to IRRlicht?)
- Mouse events seem to work, but a combined mouse+keyboard event is not received properly (keyboard event is not received)
--When IRRlicht is using it's own game loop and "refresh" wxWidget:
I found out by some tests that IRRlicht seem to work properly, if instead I run the application in a game loop (inside IRRlicht). It look like IRRlicht magically is getting the proper events, the animations plays, the GUI slider is working also. I checked further by disabling the forwarding of events from wxWidget and IRRlicht was still receiving mouse and keyboard events...
Look like IRRlicht for some reasons is connecting directly to the OS? I don't know, but it work better, and I've set up the application this way. To have wxWidget receive events for it's own GUI, I've added the wxYield() inside my Irrlicht game loop. The only problem is that is considered "bad" by wxWidget.
-- Other problems caused when IRRlicht is used in a window:
There is also one problem when IRRlicht is used inside wxWidget (could also be inside a window application or other types I suppose)
- The returned device screen size is wrong. It should return the window size IRRlicht is placed.
And caused thoses problems:
- IRRlicht GUI positions based on the screen are placed incorrectly
- IRRlicht GUI that are trying to use "absolute" clipping rectangle position are returning wrong values. (I found out that using the "clientrect" seem to return a more coherent value.
- IRRlicht cameras don't have the proper aspect ratio (I think its because of the wrong information about the display size)
I was able to use IRRlicht inside a WxWidget application. wxWidget recommend that we use their "event loop" and refresh our application.
I tried to use their recommendation when I started implementing wxWidget for the IRR Rpg Builder project:
http://irrrpgbuilder.sourceforge.net/fo ... p=291#p291
-- When wxWidget drive the main loop:
Using their recommendation, the main loop is done inside WxWidget and I'm intercepting events and forwarding them to IRRlicht (mouse and keyboard events), Irrlicht is refreshed by a timer event.
But I had this problems: (my biggest problem so far)
- animated meshes don't animate, they only move to their first frame. (they still move on the screen but their animation is not playing)
- The Irrlicht scroller GUI is working but the slider GUI element is not receiving the mouse events and is not working, but the button arrows are still functionnal.
Theses problems are related to how IRRlicht received the events from wxWidget and "might" not be bugs. (If someone have an idea how to set the events to be received properly by IRRlicht it would be great)
- I had weird issues with the way the keyboard event were received by IRRlicht, all the letters are received as capital letters. (perhaps I need to process them further before sending them to IRRlicht?)
- Mouse events seem to work, but a combined mouse+keyboard event is not received properly (keyboard event is not received)
--When IRRlicht is using it's own game loop and "refresh" wxWidget:
I found out by some tests that IRRlicht seem to work properly, if instead I run the application in a game loop (inside IRRlicht). It look like IRRlicht magically is getting the proper events, the animations plays, the GUI slider is working also. I checked further by disabling the forwarding of events from wxWidget and IRRlicht was still receiving mouse and keyboard events...
Look like IRRlicht for some reasons is connecting directly to the OS? I don't know, but it work better, and I've set up the application this way. To have wxWidget receive events for it's own GUI, I've added the wxYield() inside my Irrlicht game loop. The only problem is that is considered "bad" by wxWidget.
-- Other problems caused when IRRlicht is used in a window:
There is also one problem when IRRlicht is used inside wxWidget (could also be inside a window application or other types I suppose)
- The returned device screen size is wrong. It should return the window size IRRlicht is placed.
And caused thoses problems:
- IRRlicht GUI positions based on the screen are placed incorrectly
- IRRlicht GUI that are trying to use "absolute" clipping rectangle position are returning wrong values. (I found out that using the "clientrect" seem to return a more coherent value.
- IRRlicht cameras don't have the proper aspect ratio (I think its because of the wrong information about the display size)