Move Wayland driver above dummy, check for driver availability before creation

This commit is contained in:
Gabriel Jacobo 2014-01-20 20:25:43 -03:00
parent 2ddd0c58c9
commit cf9828a2a6
1 changed files with 7 additions and 5 deletions

View File

@ -83,11 +83,11 @@ static VideoBootStrap *bootstrap[] = {
#if SDL_VIDEO_DRIVER_RPI
&RPI_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_DUMMY
&DUMMY_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_WAYLAND
&Wayland_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_DUMMY
&DUMMY_bootstrap,
#endif
NULL
};
@ -447,10 +447,12 @@ SDL_VideoInit(const char *driver_name)
if (driver_name != NULL) {
for (i = 0; bootstrap[i]; ++i) {
if (SDL_strncasecmp(bootstrap[i]->name, driver_name, SDL_strlen(driver_name)) == 0) {
if (bootstrap[i]->available()) {
video = bootstrap[i]->create(index);
break;
}
}
}
} else {
for (i = 0; bootstrap[i]; ++i) {
if (bootstrap[i]->available()) {