# HG changeset patch # User Sam Lantinga # Date 1059249720 0 # Node ID 73440ac574a21bdbc1ea7eff6f6c9636f0dc605f # Parent e3d0517bf67ea74e0b3277b99e260514dd727087 You can't create a YUV overlay in OpenGL mode diff -r e3d0517bf67e -r 73440ac574a2 src/video/SDL_yuv.c --- a/src/video/SDL_yuv.c Sat Jul 26 19:50:00 2003 +0000 +++ b/src/video/SDL_yuv.c Sat Jul 26 20:02:00 2003 +0000 @@ -32,6 +32,7 @@ #include "SDL_getenv.h" #include "SDL_video.h" +#include "SDL_error.h" #include "SDL_sysvideo.h" #include "SDL_yuvfuncs.h" #include "SDL_yuv_sw_c.h" @@ -45,7 +46,10 @@ const char *yuv_hwaccel; 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 */ if ( getenv("SDL_VIDEO_YUV_DIRECT") ) { @@ -55,6 +59,7 @@ display = SDL_VideoSurface; } } + overlay = NULL; yuv_hwaccel = getenv("SDL_VIDEO_YUV_HWACCEL"); if ( ((display == SDL_VideoSurface) && video->CreateYUVOverlay) && (!yuv_hwaccel || (atoi(yuv_hwaccel) > 0)) ) {