Problems with deriving a class

Started by
4 comments, last by Rhaal 18 years, 6 months ago
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.
- A momentary maniac with casual delusions.
Advertisement
What's the line numbers for those errors?
What's the definition of SEvent? Is that perhaps supposed to be irr::SEvent?
Quote:Original post by Telastyn
What's the definition of SEvent? Is that perhaps supposed to be irr::SEvent?


What he said.
{[JohnE, Chief Architect and Senior Programmer, Twilight Dragon Media{[+++{GCC/MinGW}+++{Code::Blocks IDE}+++{wxWidgets Cross-Platform Native UI Framework}+++
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 :)
- A momentary maniac with casual delusions.
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.
{[JohnE, Chief Architect and Senior Programmer, Twilight Dragon Media{[+++{GCC/MinGW}+++{Code::Blocks IDE}+++{wxWidgets Cross-Platform Native UI Framework}+++
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.
- A momentary maniac with casual delusions.

This topic is closed to new replies.

Advertisement