You can't create a YUV overlay in OpenGL mode
authorSam Lantinga <slouken@libsdl.org>
Sat, 26 Jul 2003 20:02:00 +0000
changeset 66073440ac574a2
parent 659 e3d0517bf67e
child 661 04028d47b1ea
You can't create a YUV overlay in OpenGL mode
src/video/SDL_yuv.c
     1.1 --- a/src/video/SDL_yuv.c	Sat Jul 26 19:50:00 2003 +0000
     1.2 +++ b/src/video/SDL_yuv.c	Sat Jul 26 20:02:00 2003 +0000
     1.3 @@ -32,6 +32,7 @@
     1.4  
     1.5  #include "SDL_getenv.h"
     1.6  #include "SDL_video.h"
     1.7 +#include "SDL_error.h"
     1.8  #include "SDL_sysvideo.h"
     1.9  #include "SDL_yuvfuncs.h"
    1.10  #include "SDL_yuv_sw_c.h"
    1.11 @@ -45,7 +46,10 @@
    1.12  	const char *yuv_hwaccel;
    1.13  	SDL_Overlay *overlay;
    1.14  
    1.15 -	overlay = NULL;
    1.16 +	if ( (SDL_VideoSurface->flags & SDL_OPENGL) == SDL_OPENGL ) {
    1.17 +		SDL_SetError("YUV overlays are not supported in OpenGL mode");
    1.18 +		return NULL;
    1.19 +	}
    1.20  
    1.21  	/* Display directly on video surface, if possible */
    1.22  	if ( getenv("SDL_VIDEO_YUV_DIRECT") ) {
    1.23 @@ -55,6 +59,7 @@
    1.24  			display = SDL_VideoSurface;
    1.25  		}
    1.26  	}
    1.27 +	overlay = NULL;
    1.28          yuv_hwaccel = getenv("SDL_VIDEO_YUV_HWACCEL");
    1.29  	if ( ((display == SDL_VideoSurface) && video->CreateYUVOverlay) &&
    1.30  	     (!yuv_hwaccel || (atoi(yuv_hwaccel) > 0)) ) {