Added support for SDL_PIXELFORMAT_UYVY surfaces on Mac OS X
authorSam Lantinga <slouken@libsdl.org>
Mon, 14 Oct 2013 08:56:37 -0700
changeset 7814 5a057d8d685e
parent 7813 d8fb783475d5
child 7815 a8de34099dec
Added support for SDL_PIXELFORMAT_UYVY surfaces on Mac OS X
src/render/opengl/SDL_render_gl.c
--- a/src/render/opengl/SDL_render_gl.c	Sun Oct 13 19:59:40 2013 -0700
+++ b/src/render/opengl/SDL_render_gl.c	Mon Oct 14 08:56:37 2013 -0700
@@ -514,6 +514,10 @@
         renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_IYUV;
     }
 
+#ifdef __MACOSX__
+    renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_UYVY;
+#endif
+
     if (SDL_GL_ExtensionSupported("GL_EXT_framebuffer_object")) {
         data->GL_EXT_framebuffer_object_supported = SDL_TRUE;
         data->glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)
@@ -582,6 +586,13 @@
         *format = GL_LUMINANCE;
         *type = GL_UNSIGNED_BYTE;
         break;
+#ifdef __MACOSX__
+    case SDL_PIXELFORMAT_UYVY:
+		*internalFormat = GL_RGB8;
+		*format = GL_YCBCR_422_APPLE;
+		*type = GL_UNSIGNED_SHORT_8_8_APPLE;
+		break;
+#endif
     default:
         return SDL_FALSE;
     }