comparison 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
comparison
equal deleted inserted replaced
1674:7688a73b25b1 1675:d33dcfc3fde7
77 Uint32 video_mem; 77 Uint32 video_mem;
78 78
79 SDL_PixelFormat *vfmt; 79 SDL_PixelFormat *vfmt;
80 } SDL_VideoInfo; 80 } SDL_VideoInfo;
81 81
82 /* The most common video overlay formats.
83 For an explanation of these pixel formats, see:
84 http://www.webartz.com/fourcc/indexyuv.htm
85
86 For information on the relationship between color spaces, see:
87 http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
88 */
89 #define SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U (3 planes) */
90 #define SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V (3 planes) */
91 #define SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 (1 plane) */
92 #define SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 (1 plane) */
93 #define SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 (1 plane) */
94
95 /* The YUV hardware video overlay */
96 typedef struct SDL_Overlay
97 {
98 Uint32 format; /* Read-only */
99 int w, h; /* Read-only */
100 int planes; /* Read-only */
101 Uint16 *pitches; /* Read-only */
102 Uint8 **pixels; /* Read-write */
103
104 /* Hardware-specific surface info */
105 struct private_yuvhwfuncs *hwfuncs;
106 struct private_yuvhwdata *hwdata;
107
108 /* Special flags */
109 Uint32 hw_overlay:1; /* Flag: This overlay hardware accelerated? */
110 Uint32 UnusedBits:31;
111 } SDL_Overlay;
112
82 typedef enum 113 typedef enum
83 { 114 {
84 SDL_GRAB_QUERY = -1, 115 SDL_GRAB_QUERY = -1,
85 SDL_GRAB_OFF = 0, 116 SDL_GRAB_OFF = 0,
86 SDL_GRAB_ON = 1 117 SDL_GRAB_ON = 1
112 extern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon); 143 extern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon);
113 extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface * icon, Uint8 * mask); 144 extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface * icon, Uint8 * mask);
114 extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void); 145 extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void);
115 extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface * surface); 146 extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface * surface);
116 extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode); 147 extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode);
117 extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void);
118 extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface * surface, int flags, 148 extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface * surface, int flags,
119 SDL_Color * colors, 149 SDL_Color * colors,
120 int firstcolor, int ncolors); 150 int firstcolor, int ncolors);
121 extern DECLSPEC int SDLCALL SDL_SetScreenColors(SDL_Surface * screen, 151 extern DECLSPEC int SDLCALL SDL_SetScreenColors(SDL_Surface * screen,
122 SDL_Color * colors, 152 SDL_Color * colors,
123 int firstcolor, int ncolors); 153 int firstcolor, int ncolors);
124 extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo * info); 154 extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo * info);
155 extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void);
156 extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);
157 extern DECLSPEC SDL_Overlay *SDLCALL SDL_CreateYUVOverlay(int width,
158 int height,
159 Uint32 format,
160 SDL_Surface *
161 display);
162 extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay * overlay);
163 extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay * overlay);
164 extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay * overlay,
165 SDL_Rect * dstrect);
166 extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay * overlay);
125 167
126 /* Ends C function definitions when using C++ */ 168 /* Ends C function definitions when using C++ */
127 #ifdef __cplusplus 169 #ifdef __cplusplus
128 /* *INDENT-OFF* */ 170 /* *INDENT-OFF* */
129 } 171 }
132 #include "close_code.h" 174 #include "close_code.h"
133 175
134 #endif /* _SDL_compat_h */ 176 #endif /* _SDL_compat_h */
135 177
136 /* vi: set ts=4 sw=4 expandtab: */ 178 /* vi: set ts=4 sw=4 expandtab: */
137 extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);