Mercurial > sdl-ios-xcode
comparison src/video/SDL_video.c @ 5172:ededa1ccf91c
Switched the SDL 1.2 compatibility to use the window surface, so it's fast even when there's no hardware acceleration available.
This means that the YUV overlay now uses software, but that's okay since fast YUV code should be using the textures now anyway.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 03 Feb 2011 21:13:55 -0800 |
parents | db487f28419e |
children | 51b4cfdf7ebb |
comparison
equal
deleted
inserted
replaced
5171:db487f28419e | 5172:ededa1ccf91c |
---|---|
1389 { | 1389 { |
1390 CHECK_WINDOW_MAGIC(window, NULL); | 1390 CHECK_WINDOW_MAGIC(window, NULL); |
1391 | 1391 |
1392 if (!window->surface) { | 1392 if (!window->surface) { |
1393 window->surface = SDL_CreateWindowFramebuffer(window); | 1393 window->surface = SDL_CreateWindowFramebuffer(window); |
1394 if (window->surface) { | |
1395 window->surface->refcount = 0x7FFFFFF; | |
1396 } | |
1394 } | 1397 } |
1395 return window->surface; | 1398 return window->surface; |
1396 } | 1399 } |
1397 | 1400 |
1398 int | 1401 int |
1470 | 1473 |
1471 void | 1474 void |
1472 SDL_OnWindowResized(SDL_Window * window) | 1475 SDL_OnWindowResized(SDL_Window * window) |
1473 { | 1476 { |
1474 if (window->surface) { | 1477 if (window->surface) { |
1478 window->surface->refcount = 0; | |
1475 SDL_FreeSurface(window->surface); | 1479 SDL_FreeSurface(window->surface); |
1476 window->surface = NULL; | 1480 window->surface = NULL; |
1477 } | 1481 } |
1478 } | 1482 } |
1479 | 1483 |
1550 CHECK_WINDOW_MAGIC(window, ); | 1554 CHECK_WINDOW_MAGIC(window, ); |
1551 | 1555 |
1552 /* Restore video mode, etc. */ | 1556 /* Restore video mode, etc. */ |
1553 SDL_UpdateFullscreenMode(window, SDL_FALSE); | 1557 SDL_UpdateFullscreenMode(window, SDL_FALSE); |
1554 | 1558 |
1559 if (window->surface) { | |
1560 window->surface->refcount = 0; | |
1561 SDL_FreeSurface(window->surface); | |
1562 } | |
1555 if (_this->DestroyWindowFramebuffer) { | 1563 if (_this->DestroyWindowFramebuffer) { |
1556 _this->DestroyWindowFramebuffer(_this, window); | 1564 _this->DestroyWindowFramebuffer(_this, window); |
1557 } | 1565 } |
1558 if (_this->DestroyWindow) { | 1566 if (_this->DestroyWindow) { |
1559 _this->DestroyWindow(_this, window); | 1567 _this->DestroyWindow(_this, window); |