本文整理汇总了C++中SDL_VideoDevice::CreateYUVOverlay方法的典型用法代码示例。如果您正苦于以下问题:C++ SDL_VideoDevice::CreateYUVOverlay方法的具体用法?C++ SDL_VideoDevice::CreateYUVOverlay怎么用?C++ SDL_VideoDevice::CreateYUVOverlay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SDL_VideoDevice
的用法示例。
在下文中一共展示了SDL_VideoDevice::CreateYUVOverlay方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
SDL_Overlay *SDL_CreateYUVOverlay(int w, int h, Uint32 format,
SDL_Surface *display)
{
SDL_VideoDevice *video = current_video;
SDL_VideoDevice *this = current_video;
const char *yuv_hwaccel;
SDL_Overlay *overlay;
if ( (display->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 ( SDL_getenv("SDL_VIDEO_YUV_DIRECT") ) {
if ( (display == SDL_PublicSurface) &&
((SDL_VideoSurface->format->BytesPerPixel == 2) ||
(SDL_VideoSurface->format->BytesPerPixel == 4)) ) {
display = SDL_VideoSurface;
}
}
overlay = NULL;
yuv_hwaccel = SDL_getenv("SDL_VIDEO_YUV_HWACCEL");
if ( ((display == SDL_VideoSurface) && video->CreateYUVOverlay) &&
(!yuv_hwaccel || (SDL_atoi(yuv_hwaccel) > 0)) ) {
overlay = video->CreateYUVOverlay(this, w, h, format, display);
}
/* If hardware YUV overlay failed ... */
if ( overlay == NULL ) {
overlay = SDL_CreateYUV_SW(this, w, h, format, display);
}
return overlay;
}