Create input_driver_init

This commit is contained in:
twinaphex 2015-03-23 07:07:28 +01:00
parent b21c3c460a
commit 95664b038e
3 changed files with 14 additions and 1 deletions

View File

@ -372,7 +372,7 @@ static void init_video_input(const input_driver_t *tmp)
rarch_fail(1, "init_video_input()");
}
driver->input_data = driver->input->init();
driver->input_data = input_driver_init();
if (driver->input_data)
return;

View File

@ -272,3 +272,14 @@ bool input_driver_grab_mouse(bool state)
driver->input->grab_mouse(driver->input_data, state);
return true;
}
void *input_driver_init(void)
{
driver_t *driver = driver_get_ptr();
if (!driver)
return NULL;
if (!driver->input)
return NULL;
return driver->input->init();
}

View File

@ -150,6 +150,8 @@ const rarch_joypad_driver_t * input_driver_get_joypad_driver(void);
bool input_driver_grab_mouse(bool state);
void *input_driver_init(void);
#ifdef __cplusplus
}
#endif