I've tried using extern keyword, but it won't work.
How should I do what I want?
Code: Select all
bool MyEventReceiver::OnEvent (const SEvent& event)
{
float oldMousePos[2];
float newMousePos[] = {event.MouseInput.X, event.MouseInput.Y};
float mouseMove []= {newMousePos[0] - oldMousePos[0], newMousePos[1] - oldMousePos[1]};
if (event.EventType == irr::EET_KEY_INPUT_EVENT)
KeyIsDown[event.KeyInput.Key] = event.KeyInput.PressedDown;
if (event.EventType == EET_MOUSE_INPUT_EVENT)
{
if (event.MouseInput.Event == EMIE_MOUSE_MOVED)
{
camera->setTarget(vector3df(50, 50, 50)); //just a test target. Here is where the error occurs.
}
}
return false;
}