• Advertisement
Sign in to follow this  

Problems with deriving a class

This topic is 4508 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I would ask this on the Irrlicht forum, but then I'd be waiting 2 days for an answer, and the answer would be "search the forum noob". Besides, I highly doubt my problem is with the engine itself(http://irrlicht.sourceforge.net/). I've gotten the engine up and running, and am able to render scenes. So, I know my environment is properly set up. However, when I get to input handling, there's a problem. Here is my EventHandler.h:
#ifndef LX_EVENTRECEIVER_H
#define LX_EVENTRECEIVER_H
#include <irrlicht.h>

class LoriumEventReceiver : public irr::IEventReceiver
{
 public:
    virtual bool OnEvent(SEvent event)
    {
      if (node != 0 && event.EventType == irr::EET_KEY_INPUT_EVENT &&
        !event.KeyInput.PressedDown)
        {return true;}
    }
};
#endif

If I make a source file like this:
#include "EventReceiver.h"
LoriumEventReceiver* pEventReceiver;
I get: C:\projects\lorium\main.cpp In file included from main.cpp C:\projects\lorium\EventReceiver.h expected `;' before '(' token C:\projects\lorium\EventReceiver.h expected `;' before '(' token I feel like 'virtual' shouldn't be there because irr::IEventReceiver declares this as virtual, and I'm supposed to define it. However, Every tutorial and example on irrlicht's site does it this way.

Share this post


Link to post
Share on other sites
Advertisement
What's the line numbers for those errors?
What's the definition of SEvent? Is that perhaps supposed to be irr::SEvent?

Share this post


Link to post
Share on other sites
Quote:
Original post by Telastyn
What's the definition of SEvent? Is that perhaps supposed to be irr::SEvent?


What he said.

Share this post


Link to post
Share on other sites
Thanks guys, you were right :) SEvent is in the irr namespace. I'm noticing a lot of problems with irrlicht tutorials, most of which are small typos - but they are everywhere!

Their documentation needs some serious help. Thanks again :)

Share this post


Link to post
Share on other sites
The documentation admittedly could use some work, but I wouldn't be too harsh; it's developed by one person, whose native language isn't even English.

Share this post


Link to post
Share on other sites
Quote:
Original post by TDragon
The documentation admittedly could use some work, but I wouldn't be too harsh; it's developed by one person, whose native language isn't even English.


Well I'm really impressed by the engine. As much as I love OOP, I just can't get used to OGRE3D. Irrlicht seems to work more like DirectX, which is what I find comfortable :)

If the author's native language isn't English, then I'm impressed with the documentation. Actually, now that I think about it, my only confusion has come from documentation on the wiki by others.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement