diff include/SDL_compat.h @ 1675:d33dcfc3fde7 SDL-1.3

Overlay functions are being replaced by YUV textures. If the driver doesn't support YUV textures, they can be emulated by backing the texture with an RGB texture and using the software conversion routines. Note that it doesn't make sense to lock a portion of a YV12 texture, since you'd need to return three pixel pointers and pitch values instead of the one that's available through the API. I'm guessing that's one of the reasons DirectX 9 doesn't support this format at all.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 11 Jun 2006 07:30:16 +0000
parents eef792d31de8
children 7ae8018b2e5d
line wrap: on
line diff
--- a/include/SDL_compat.h	Sun Jun 11 05:27:10 2006 +0000
+++ b/include/SDL_compat.h	Sun Jun 11 07:30:16 2006 +0000
@@ -79,6 +79,37 @@
     SDL_PixelFormat *vfmt;
 } SDL_VideoInfo;
 
+/* The most common video overlay formats.
+   For an explanation of these pixel formats, see:
+   http://www.webartz.com/fourcc/indexyuv.htm
+
+   For information on the relationship between color spaces, see:
+   http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
+ */
+#define SDL_YV12_OVERLAY  0x32315659    /* Planar mode: Y + V + U  (3 planes) */
+#define SDL_IYUV_OVERLAY  0x56555949    /* Planar mode: Y + U + V  (3 planes) */
+#define SDL_YUY2_OVERLAY  0x32595559    /* Packed mode: Y0+U0+Y1+V0 (1 plane) */
+#define SDL_UYVY_OVERLAY  0x59565955    /* Packed mode: U0+Y0+V0+Y1 (1 plane) */
+#define SDL_YVYU_OVERLAY  0x55595659    /* Packed mode: Y0+V0+Y1+U0 (1 plane) */
+
+/* The YUV hardware video overlay */
+typedef struct SDL_Overlay
+{
+    Uint32 format;              /* Read-only */
+    int w, h;                   /* Read-only */
+    int planes;                 /* Read-only */
+    Uint16 *pitches;            /* Read-only */
+    Uint8 **pixels;             /* Read-write */
+
+    /* Hardware-specific surface info */
+    struct private_yuvhwfuncs *hwfuncs;
+    struct private_yuvhwdata *hwdata;
+
+    /* Special flags */
+    Uint32 hw_overlay:1;        /* Flag: This overlay hardware accelerated? */
+    Uint32 UnusedBits:31;
+} SDL_Overlay;
+
 typedef enum
 {
     SDL_GRAB_QUERY = -1,
@@ -114,7 +145,6 @@
 extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void);
 extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface * surface);
 extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode);
-extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void);
 extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface * surface, int flags,
                                            SDL_Color * colors,
                                            int firstcolor, int ncolors);
@@ -122,6 +152,18 @@
                                                 SDL_Color * colors,
                                                 int firstcolor, int ncolors);
 extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo * info);
+extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void);
+extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);
+extern DECLSPEC SDL_Overlay *SDLCALL SDL_CreateYUVOverlay(int width,
+                                                          int height,
+                                                          Uint32 format,
+                                                          SDL_Surface *
+                                                          display);
+extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay * overlay);
+extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay * overlay);
+extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay * overlay,
+                                                  SDL_Rect * dstrect);
+extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay * overlay);
 
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
@@ -134,4 +176,3 @@
 #endif /* _SDL_compat_h */
 
 /* vi: set ts=4 sw=4 expandtab: */
-extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);