Problem Updating project to v1.4

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Warren
Posts: 60
Joined: Fri Jul 07, 2006 11:41 pm
Location: Santiago De Compostela, Spain

Problem Updating project to v1.4

Post by Warren »

Hi there,

as i say, i have a problem when i updating a previous project to v1.4.
As in many irrlicht examples arround the web, i maked a class from IEventReciever to manage the input events:

Code: Select all

class MiEventReceiver : public IEventReceiver
{
public:
   virtual bool OnEvent(SEvent event)
   {

          keys[irr::KEY_LBUTTON]=false;

          //onEvent
          if(event.EventType == irr::EET_KEY_INPUT_EVENT){
             keys[event.KeyInput.Key] = event.KeyInput.PressedDown;

          }

          if (event.EventType == irr::EET_MOUSE_INPUT_EVENT)
          {
          switch( event.MouseInput.Event )
                  {
                  case irr::EMIE_LMOUSE_LEFT_UP:
                  keys[irr::KEY_LBUTTON]= true;
                  break;

                  default:
                  keys[irr::KEY_LBUTTON]=false;
                  break;
                   }
          }



       return false;
   }

};
then i declare a class to manage all irrlitch inicializations and stuff, with a private MiEventReciever member:

Code: Select all

class Dispositivo {
      public:
             Dispositivo(ISceneManager** smgr
                         , IrrlichtDevice** device
                         , IVideoDriver** driver);
      private:
             MiEventReceiver receiver;

};
On the previus version of irrlicht i´ve used there is no problem, but compiling with v1.4 stops on that error:
error: cannot declare field `Dispositivo::receiver' to be of type `MiEventReceiver'
error: because the following virtual functions are abstract:

D:\irrlicht-1.4\include\IEventReceiver.h:256: error: virtual bool irr::IEventReceiver::OnEvent(const irr::SEvent&)

:: === Build finished: 3 errors, 4 warnings ===
It seems that its not enough to define the abstract method OnEvent() as i did. But i dont know what i supossed to do.

I hope that anybody can help me.
sorry if this topic was talked anytime, i was looking for but didnt find anything.

Thx in advance
Greetings
------------------------------------------------
Irrlicht Ussers Map
Join now!!
http://www.frappr.com/irrlichtusers
pelonzudo
Posts: 20
Joined: Wed May 07, 2008 11:14 am

Post by pelonzudo »

The definition change for 1.4, try

Code: Select all

virtual bool OnEvent (const SEvent& event)
Warren
Posts: 60
Joined: Fri Jul 07, 2006 11:41 pm
Location: Santiago De Compostela, Spain

Post by Warren »

oh
Tnx
it works, now i can compile....
...but i get an execution time error,
at the first condition:

Code: Select all

if(event.EventType == irr::EET_KEY_INPUT_EVENT){
i dont understand, but now that its a contant type, its possible to work with his value as before i used???
------------------------------------------------
Irrlicht Ussers Map
Join now!!
http://www.frappr.com/irrlichtusers
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Yes. That line is fine. I find it... inconceivable that it's causing a failure.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Post Reply