Commit 125e5685 authored by Sam Lantinga's avatar Sam Lantinga

Switched the SDL 1.2 compatibility to use the window surface, so it's fast...

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.
parent 1fc2b68b
......@@ -273,8 +273,8 @@ struct SDL_SysWMinfo;
#define SDL_AllocSurface SDL_CreateRGBSurface
extern DECLSPEC const SDL_version *SDLCALL SDL_Linked_Version(void);
extern DECLSPEC char *SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen);
extern DECLSPEC char *SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen);
extern DECLSPEC const char *SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen);
extern DECLSPEC const char *SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen);
extern DECLSPEC const SDL_VideoInfo *SDLCALL SDL_GetVideoInfo(void);
extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width,
int height,
......
This diff is collapsed.
......@@ -1391,6 +1391,9 @@ SDL_GetWindowSurface(SDL_Window * window)
if (!window->surface) {
window->surface = SDL_CreateWindowFramebuffer(window);
if (window->surface) {
window->surface->refcount = 0x7FFFFFF;
}
}
return window->surface;
}
......@@ -1472,6 +1475,7 @@ void
SDL_OnWindowResized(SDL_Window * window)
{
if (window->surface) {
window->surface->refcount = 0;
SDL_FreeSurface(window->surface);
window->surface = NULL;
}
......@@ -1552,6 +1556,10 @@ SDL_DestroyWindow(SDL_Window * window)
/* Restore video mode, etc. */
SDL_UpdateFullscreenMode(window, SDL_FALSE);
if (window->surface) {
window->surface->refcount = 0;
SDL_FreeSurface(window->surface);
}
if (_this->DestroyWindowFramebuffer) {
_this->DestroyWindowFramebuffer(_this, window);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment