And here's the top Google hit for that error, which took me all of 30 seconds to find.3DModelerMan wrote: And here's the error that I getThanks .Code: Select all
error: base operand of `->' has non-pointer type `MastEventReceiver'
(C++) Simple to use Event Receiver class for Irrlicht 1.3
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Re: this does'nt work
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
oh
Oh sorry, and thanks for the help.
I thought it was fine to post questions about the projects.
I thought it was fine to post questions about the projects.
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
.h file for mast event receiver
Does this need many modifications to be put in a .h file instead of a .cpp?.
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
-
- Posts: 74
- Joined: Tue Jul 22, 2008 4:28 am
- Location: Los Angeles
Hi,
I just started using this and everything seemed to be going fine, until I let the program run for a minute or two.
I won't press any keys, I'll just let it run, and Visual Studio tells me that I've hit a break point here:
For reference, the test I'm doing with the class is this:
I'm really not sure why this is happening, or if it's a problem with the class or my code, the compiler, etc. Hopefully somebody can help.
EDIT: After some other tests, I don't think it's the class that is causing the issue. It seems to happen even in the Hello World app... I'll check around the forums for help, but if anybody can point me in the right direction I'd really appreciate it.
I just started using this and everything seemed to be going fine, until I let the program run for a minute or two.
I won't press any keys, I'll just let it run, and Visual Studio tells me that I've hit a break point here:
Code: Select all
//! Direct const access operator
const T& operator [](u32 index) const
{
_IRR_DEBUG_BREAK_IF(index>=used) // access violation
return data[index];
}
For reference, the test I'm doing with the class is this:
Code: Select all
if(eventReceiver.keyDown(KEY_RIGHT))
{
a++;
}
else if(eventReceiver.keyDown(KEY_LEFT))
{
a--;
}
else if(eventReceiver.keyPressed(KEY_DOWN))
{
a=0;
}
EDIT: After some other tests, I don't think it's the class that is causing the issue. It seems to happen even in the Hello World app... I'll check around the forums for help, but if anybody can point me in the right direction I'd really appreciate it.
I don't know what I'm doing. I'm trying to figure out how this works, I do this but it crashes:
Obviously I'm not doing it right.
Code: Select all
MastEventReceiver* input;
...
...
...
if(input->keyPressed(KEY_SPACE))
do stuff;
WooT!
Works like a charm after I changed
into
Code: Select all
SEvent event
Code: Select all
const SEvent& event
Just to clarify, the modification is on line 64
into
to make it work with irrlicht 1.4.2.
Thanks for sharing.
Code: Select all
virtual bool OnEvent(SEvent event)
Code: Select all
virtual bool OnEvent(const SEvent& event)
Thanks for sharing.
I've just started using Irrlicht to make a game engine. I've been creating my event handling procedures.
Is this MastEventReceiver designed for a game engine?
I am a newbie, but still I feel that there is so much wrong with this MastEventReceiver. But I'm confused why noone has questioned it.
My biggest problem is that I don't understand what it is trying to achieve.
It seems overly complex (though not complete) and redundant in some ways.
Please enlighten me if I overlook or misunderstand something.
Firstly, why have a Down() and an Up() function? Why not just have:
boolean KeyDown(EKEY_CODE keyCode) or
MouseButtonDown(int mouseButton) ??
With the MouseButtonDown, you could make one function (as above) and pass the mouse button parameter to the function.
Also, what is the Pressed() and Released() for?.. and then you update the actual values in the function startEventProcess().
Why would you want to start the event process at the end of the loop and stop it at the start?
For a game engine, I'd always take events since the user can set their own delays for their game input. The game loop (device->run()) will be calling game specific event handlers HandleKeys(), MouseMove(), MouseButton() and HandleJoystick() etc.
I understand turning off event handling just prior to the actual game specific game cycle, then turn it back on after. It may be required to keep the engine in a whole state so to speak, since the actual event handling in the app(window) is always happening and hence it is updating keystates etc. Even that may not be necessary? (anyone's opinion?)
e.g.
while (device->run())
{
HandleKeys();
evtHandler->Stop();
GameCycle();
evtHandler->Start();
}
Anyway, what is it for? Nowhere can I find explanations for the purpose of Pressed and Released.
Why would you only want to set the state to PRESSED on the first press? Instead of putting it straight to DOWN?
I can't see the benefit.
LOOK BELOW:
//Left Mouse Button Pressed
if (event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN)
{
if (mouseButtonState[0] == UP || mouseButtonState[0] == RELEASED)
{
mouseButtonState[0] = PRESSED;
}
else
{
mouseButtonState[0] = DOWN;
}
}
Please explain?
I'll post my event handler for a game engine when I complete it.
I'd appreciate any constructive comments about my comments or about Mastiff's event handler.
Is this MastEventReceiver designed for a game engine?
I am a newbie, but still I feel that there is so much wrong with this MastEventReceiver. But I'm confused why noone has questioned it.
My biggest problem is that I don't understand what it is trying to achieve.
It seems overly complex (though not complete) and redundant in some ways.
Please enlighten me if I overlook or misunderstand something.
Firstly, why have a Down() and an Up() function? Why not just have:
boolean KeyDown(EKEY_CODE keyCode) or
MouseButtonDown(int mouseButton) ??
With the MouseButtonDown, you could make one function (as above) and pass the mouse button parameter to the function.
Also, what is the Pressed() and Released() for?.. and then you update the actual values in the function startEventProcess().
Why would you want to start the event process at the end of the loop and stop it at the start?
For a game engine, I'd always take events since the user can set their own delays for their game input. The game loop (device->run()) will be calling game specific event handlers HandleKeys(), MouseMove(), MouseButton() and HandleJoystick() etc.
I understand turning off event handling just prior to the actual game specific game cycle, then turn it back on after. It may be required to keep the engine in a whole state so to speak, since the actual event handling in the app(window) is always happening and hence it is updating keystates etc. Even that may not be necessary? (anyone's opinion?)
e.g.
while (device->run())
{
HandleKeys();
evtHandler->Stop();
GameCycle();
evtHandler->Start();
}
Anyway, what is it for? Nowhere can I find explanations for the purpose of Pressed and Released.
Why would you only want to set the state to PRESSED on the first press? Instead of putting it straight to DOWN?
I can't see the benefit.
LOOK BELOW:
//Left Mouse Button Pressed
if (event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN)
{
if (mouseButtonState[0] == UP || mouseButtonState[0] == RELEASED)
{
mouseButtonState[0] = PRESSED;
}
else
{
mouseButtonState[0] = DOWN;
}
}
Please explain?
I'll post my event handler for a game engine when I complete it.
I'd appreciate any constructive comments about my comments or about Mastiff's event handler.
I agree.
The MastEventReceiver is a very ugly piece of C++ code.
If you don't like it, don't use it.
The MastEventReceiver is a very ugly piece of C++ code.
If you don't like it, don't use it.
Generated Documentation for BlindSide's irrNetLite.
"When I heard birds chirping, I knew I didn't have much time left before my mind would go." - clinko
"When I heard birds chirping, I knew I didn't have much time left before my mind would go." - clinko
Birds are chirping
Ok, thanks.
I never was going to use it, but I wanted to know if my idea was right, or if there really was a practical reason for all the confusing PRESSED and RELEASED, and so on..
Noone even asked what it's for. Anyway...
I never was going to use it, but I wanted to know if my idea was right, or if there really was a practical reason for all the confusing PRESSED and RELEASED, and so on..
Noone even asked what it's for. Anyway...