Mercurial > sdl-ios-xcode
comparison src/video/x11/SDL_x11modes.c @ 3521:76f9b76ddf0f
Don't add any renderers if you can't add any displays
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Fri, 04 Dec 2009 09:01:48 +0000 |
parents | 4b594623401b |
children | f7b03b6838cb |
comparison
equal
deleted
inserted
replaced
3520:83518f8fcd61 | 3521:76f9b76ddf0f |
---|---|
116 } | 116 } |
117 | 117 |
118 return SDL_PIXELFORMAT_UNKNOWN; | 118 return SDL_PIXELFORMAT_UNKNOWN; |
119 } | 119 } |
120 | 120 |
121 void | 121 int |
122 X11_InitModes(_THIS) | 122 X11_InitModes(_THIS) |
123 { | 123 { |
124 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; | 124 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; |
125 int screen; | 125 int screen; |
126 | 126 |
166 display.desktop_mode = mode; | 166 display.desktop_mode = mode; |
167 display.current_mode = mode; | 167 display.current_mode = mode; |
168 display.driverdata = displaydata; | 168 display.driverdata = displaydata; |
169 SDL_AddVideoDisplay(&display); | 169 SDL_AddVideoDisplay(&display); |
170 } | 170 } |
171 if (_this->num_displays == 0) { | |
172 SDL_SetError("No available displays"); | |
173 return -1; | |
174 } | |
175 return 0; | |
171 } | 176 } |
172 | 177 |
173 /* Global for the error handler */ | 178 /* Global for the error handler */ |
174 int vm_event, vm_error = -1; | 179 int vm_event, vm_error = -1; |
175 | 180 |