Is it possible to have a EventReceiver that creates an Irrlicht Device and passes itself as EventReceiver?
I tried it with createDevice( ..., this, ...) and with IrrlichtDevice->setEventReceiver( this). Both doesn't work.
I just browsed the web and the forums and didn't find anything about that.
Any idea or must I have two classes?
Thanks, Dark Logan
P.S.: I use it for GameState Managment. Virtual GameState derives from IEventReceiver. And the actual State from Virtual GameState. Is the problem within this?
Simple Event Receiver Question
-
Dark Logan
- Posts: 11
- Joined: Thu Dec 15, 2005 3:43 pm
- Location: Hessen, Germany
- Contact:
Simple Event Receiver Question
Last edited by Dark Logan on Sun Feb 05, 2006 9:48 am, edited 1 time in total.
-
Dark Logan
- Posts: 11
- Joined: Thu Dec 15, 2005 3:43 pm
- Location: Hessen, Germany
- Contact:
Code: Select all
#ifndef INTRO_H
#define INTRO_H
#include <irrlicht.h>
#include "GameManager.h"
#include "GameState.h"
class Intro : public GameState {
public:
Intro();
~Intro();
bool OnEvent( SEvent Event);
bool run();
protected:
IrrlichtDevice* Device;
IVideoDriver* VideoDriver;
ITexture* IntroPicture;
};
#endif
In constructor `Intro::Intro()':
`irr::IEventReceiver' is an inaccessible base of `Intro'
The constructor looks like this:
Code: Select all
Intro::Intro() {
Device = createDevice( EDT_SOFTWARE,
dimension2d<s32>(800,600),
16,
true,
false,
false,
0,
IRRLICHT_SDK_VERSION);
VideoDriver = Device->getVideoDriver();
// load IntroPicture
IntroPicture = VideoDriver->getTexture("./media/startup.bmp");
if( IntroPicture == NULL) {
GameManager::getInstance()->changeState( NULL);
}
Device->setEventReceiver( this);
}
This is just a simple C++ question/lesson
Usually when you get a compile error it includes a line number. Look at what you are doing on that line and think about the error message carefully... In constructor `Intro::Intro()': `irr::IEventReceiver' is an inaccessible base of `Intro'. Now why would the base class IEventReceiver be inaccessible to a derived class Intro? Ponder that for a while.
For those that are reading this, don't just blurt out the answer. I'm hoping to help Logan.
Usually when you get a compile error it includes a line number. Look at what you are doing on that line and think about the error message carefully... In constructor `Intro::Intro()': `irr::IEventReceiver' is an inaccessible base of `Intro'. Now why would the base class IEventReceiver be inaccessible to a derived class Intro? Ponder that for a while.
For those that are reading this, don't just blurt out the answer. I'm hoping to help Logan.
-
Dark Logan
- Posts: 11
- Joined: Thu Dec 15, 2005 3:43 pm
- Location: Hessen, Germany
- Contact: