Commit 99453327 authored by Sam Lantinga's avatar Sam Lantinga

You can't create a YUV overlay in OpenGL mode

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40661
parent 4be1dcdd
...@@ -32,6 +32,7 @@ static char rcsid = ...@@ -32,6 +32,7 @@ static char rcsid =
#include "SDL_getenv.h" #include "SDL_getenv.h"
#include "SDL_video.h" #include "SDL_video.h"
#include "SDL_error.h"
#include "SDL_sysvideo.h" #include "SDL_sysvideo.h"
#include "SDL_yuvfuncs.h" #include "SDL_yuvfuncs.h"
#include "SDL_yuv_sw_c.h" #include "SDL_yuv_sw_c.h"
...@@ -45,7 +46,10 @@ SDL_Overlay *SDL_CreateYUVOverlay(int w, int h, Uint32 format, ...@@ -45,7 +46,10 @@ SDL_Overlay *SDL_CreateYUVOverlay(int w, int h, Uint32 format,
const char *yuv_hwaccel; const char *yuv_hwaccel;
SDL_Overlay *overlay; SDL_Overlay *overlay;
overlay = NULL; if ( (SDL_VideoSurface->flags & SDL_OPENGL) == SDL_OPENGL ) {
SDL_SetError("YUV overlays are not supported in OpenGL mode");
return NULL;
}
/* Display directly on video surface, if possible */ /* Display directly on video surface, if possible */
if ( getenv("SDL_VIDEO_YUV_DIRECT") ) { if ( getenv("SDL_VIDEO_YUV_DIRECT") ) {
...@@ -55,6 +59,7 @@ SDL_Overlay *SDL_CreateYUVOverlay(int w, int h, Uint32 format, ...@@ -55,6 +59,7 @@ SDL_Overlay *SDL_CreateYUVOverlay(int w, int h, Uint32 format,
display = SDL_VideoSurface; display = SDL_VideoSurface;
} }
} }
overlay = NULL;
yuv_hwaccel = getenv("SDL_VIDEO_YUV_HWACCEL"); yuv_hwaccel = getenv("SDL_VIDEO_YUV_HWACCEL");
if ( ((display == SDL_VideoSurface) && video->CreateYUVOverlay) && if ( ((display == SDL_VideoSurface) && video->CreateYUVOverlay) &&
(!yuv_hwaccel || (atoi(yuv_hwaccel) > 0)) ) { (!yuv_hwaccel || (atoi(yuv_hwaccel) > 0)) ) {
......
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