comparison src/video/SDL_video.c @ 1677:5e4c5e095925 SDL-1.3

Added new style dummy renderer
author Sam Lantinga <slouken@libsdl.org>
date Tue, 13 Jun 2006 04:37:45 +0000
parents e136f3ffdc1b
children 90bf530ced8e
comparison
equal deleted inserted replaced
1676:e136f3ffdc1b 1677:5e4c5e095925
305 SDL_GetVideoDevice() 305 SDL_GetVideoDevice()
306 { 306 {
307 return _this; 307 return _this;
308 } 308 }
309 309
310 void 310 int
311 SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode) 311 SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode)
312 { 312 {
313 SDL_VideoDisplay display; 313 SDL_VideoDisplay display;
314 314
315 SDL_zero(display); 315 SDL_zero(display);
316 if (desktop_mode) { 316 if (desktop_mode) {
317 display.desktop_mode = *desktop_mode; 317 display.desktop_mode = *desktop_mode;
318 } 318 }
319 display.current_mode = display.desktop_mode; 319 display.current_mode = display.desktop_mode;
320 320
321 SDL_AddVideoDisplay(&display); 321 return SDL_AddVideoDisplay(&display);
322 } 322 }
323 323
324 void 324 int
325 SDL_AddVideoDisplay(const SDL_VideoDisplay * display) 325 SDL_AddVideoDisplay(const SDL_VideoDisplay * display)
326 { 326 {
327 SDL_VideoDisplay *displays; 327 SDL_VideoDisplay *displays;
328 int index = -1;
328 329
329 displays = 330 displays =
330 SDL_realloc(_this->displays, 331 SDL_realloc(_this->displays,
331 (_this->num_displays + 1) * sizeof(*displays)); 332 (_this->num_displays + 1) * sizeof(*displays));
332 if (displays) { 333 if (displays) {
333 displays[_this->num_displays] = *display; 334 index = _this->num_displays++;
335 displays[index] = *display;
334 _this->displays = displays; 336 _this->displays = displays;
335 _this->num_displays++; 337 } else {
336 } 338 SDL_OutOfMemory();
339 }
340 return index;
337 } 341 }
338 342
339 int 343 int
340 SDL_GetNumVideoDisplays(void) 344 SDL_GetNumVideoDisplays(void)
341 { 345 {