chronologicaldot wrote:I couldn't find where you set your event receiver to the device's main event receiver ( via setEventReceiver() ), so that could be the issue except that you're getting events, so that's confusing me... unless you're code online isn't complete.
Check 29th line in main.cpp
Code: Select all
device = createDevice(video::EDT_DIRECT3D9, core::dimension2d<u32>(800, 600), 32,
false, false, true, &receiver);
Of course the code is complete in a sense that you can compile it without errors and it does whatever I programmed it for except for selecting the node.
chronologicaldot wrote:You're polling the events every cycle, but you don't need to. Since Irrlicht only sends a single event to the receiver when it happens, you can deal with them as-they-come. It'd be much easier (and more efficient) to handle events immediately in the receiver so then you don't have to worry about update function changing some internal boolean before the intended operation's completion.
Hmm, haven't thought of that since all the tutorials do it the way I did. Maybe it's a good idea to call specific functions from
Action class in
bool MyEventReceiver::OnEvent(const SEvent& event) inside if scopes. I'll try that after I figure out the selection problem.
thanhle wrote:Make sure you disable your camera from being select.
Didn't help
thanhle wrote: There should also be unit selection code, select by window, floating somewhere here in the forum.
chronologicaldot wrote:For a strategy game, e.g. RTS, I recommend implementing your own function - something alot faster than the given collision manager version, which is a recursive-function selection process. Also, you'll want something else if you intend to have multi-select.
Your choice. *shrug*
Yes I was thinking of that I'll search for solution on this forum.