I've got a problem concerning the IEventReceiver
Here's a bit of my code
Code: Select all
// In "EventReceiver.h"
class CEventReceiver : public IEventReceiver
{
public:
void test(void)
{
printf("This text is shown\n");
};
virtual bool OnEvent(SEvent event)
{
printf("This text not :(\n");
return false;
};
};
Code: Select all
// In "Game.cpp"
void CGame::init_grafic(EDriverType edtDriverType)
{
printf("Start:\n");
this->svGameVar = (SGameVar*)malloc(sizeof(SGameVar));
printf("1\n");
this->svGameVar->receiver = (CEventReceiver*)malloc(sizeof(CEventReceiver));
printf("2\n");
this->svGameVar->receiver->test();
printf("2.1\n");
this->svGameVar->device = createDevice(edtDriverType, dimension2d<s32>(300,300), 32, false, false, this->svGameVar->receiver);
printf("3\n");
this->svGameVar->driver = this->svGameVar->device->getVideoDriver();
printf("4\n");
this->svGameVar->env = this->svGameVar->device->getGUIEnvironment();
printf("5\n");
this->svGameVar->smgr = this->svGameVar->device->getSceneManager();
printf("6\n");
};
This is shown in the console:
Code: Select all
Start:
1
2
This text is shown
2.1
If I take
Code: Select all
this->svSpielVar->device = createDevice(edtDriverType, dimension2d<s32>(300,300), 32, false, false);
Code: Select all
this->svSpielVar->device = createDevice(edtDriverType, dimension2d<s32>(300,300), 32, false, false, this->svGameVar->receiver);
I really hope, someone can help me, please