27 #define check_release(obj, exp) _check_release(__LINE__, obj, exp) 30 int ref = IUnknown_Release(
obj);
36 0x42,0x4d,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x28,0x00,
37 0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,
38 0x00,0x00,0x04,0x00,0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x02,0x00,
39 0x00,0x00,0x02,0x00,0x00,0x00,0xf1,0xf2,0xf3,0x80,0xf4,0xf5,0xf6,0x81,0x00,0x00,
45 0x42,0x4d,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x28,0x00,
46 0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x02,0x00,0x00,0x00,
47 0x00,0x00,0x04,0x00,0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x02,0x00,
48 0x00,0x00,0x02,0x00,0x00,0x00,0xf1,0xf2,0xf3,0x80,0xf4,0xf5,0xf6,0x81,0x00,0x00,
54 0x42,0x4d,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x28,0x00,
55 0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x04,0x00,0x00,0x00,
56 0x00,0x00,0x04,0x00,0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x02,0x00,
57 0x00,0x00,0x02,0x00,0x00,0x00,0xf1,0xf2,0xf3,0x80,0xf4,0xf5,0xf6,0x81,0x00,0x00,
63 0x42,0x4d,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x28,0x00,
64 0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x08,0x00,0x00,0x00,
65 0x00,0x00,0x04,0x00,0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x02,0x00,
66 0x00,0x00,0x02,0x00,0x00,0x00,0xf1,0xf2,0xf3,0x80,0xf4,0xf5,0xf6,0x81,0x00,0x00,
72 0x42,0x4d,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x00,0x00,0x00,0x28,0x00,
73 0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x20,0x00,0x00,0x00,
74 0x00,0x00,0x10,0x00,0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x00,0x00,
75 0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0xb0,0xc0,0x00,0xa1,0xb1,0xc1,0x00,0xa2,0xb2,
76 0xc2,0x00,0xa3,0xb3,0xc3,0x00
81 0x42,0x4d,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x00,0x00,0x00,0x28,0x00,
82 0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x20,0x00,0x00,0x00,
83 0x00,0x00,0x10,0x00,0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x00,0x00,
84 0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0xb0,0xc0,0x00,0xa1,0xb1,0xc1,0x00,0xa2,0xb2,
85 0xc2,0x00,0xa3,0xb3,0xc3,0x01
90 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49,
91 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00,
92 0x00, 0x00, 0x00, 0x3a, 0x7e, 0x9b, 0x55, 0x00, 0x00, 0x00, 0x0a, 0x49, 0x44,
93 0x41, 0x54, 0x08, 0xd7, 0x63, 0xf8, 0x0f, 0x00, 0x01, 0x01, 0x01, 0x00, 0x1b,
94 0xb6, 0xee, 0x56, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42,
100 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
110 0x44,0x44,0x53,0x20,0x7c,0x00,0x00,0x00,0x07,0x10,0x0a,0x00,0x02,0x00,0x00,0x00,
111 0x02,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
112 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
113 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
114 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,
115 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0xff,0x00,
116 0x00,0xff,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x40,0x00,
117 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
118 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
123 0x44,0x44,0x53,0x20,0x7c,0x00,0x00,0x00,0x07,0x10,0x08,0x00,0x02,0x00,0x00,0x00,
124 0x02,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
125 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
126 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
127 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,
128 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,
129 0xe0,0x03,0x00,0x00,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,
130 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
131 0xff,0x7f,0xff,0x7f,0xff,0x7f,0xff,0x7f
136 0x44,0x44,0x53,0x20,0x7c,0x00,0x00,0x00,0x07,0x10,0x08,0x00,0x04,0x00,0x00,0x00,
137 0x04,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
138 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
139 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
140 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,
141 0x04,0x00,0x00,0x00,0x44,0x58,0x54,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
142 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x00,0x00,
143 0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
144 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xef,0x87,0x0f,0x78,0x05,0x05,0x50,0x50,
145 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xef,0x87,0x0f,0x78,0x05,0x05,0x50,0x50,
146 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xef,0x87,0x0f,0x78,0x05,0x05,0x50,0x50,
147 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xef,0x87,0x0f,0x78,0x05,0x05,0x50,0x50,
148 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xef,0x87,0x0f,0x78,0x05,0x05,0x50,0x50,
149 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xef,0x87,0x0f,0x78,0x05,0x05,0x50,0x50
154 0x44,0x44,0x53,0x20,0x7c,0x00,0x00,0x00,0x07,0x10,0x8a,0x00,0x04,0x00,0x00,0x00,
155 0x04,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
156 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
157 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
158 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,
159 0x04,0x00,0x00,0x00,0x44,0x58,0x54,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
160 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x40,0x00,
161 0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
162 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xef,0x87,0x0f,0x78,0x05,0x05,0x50,0x50,
163 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xef,0x87,0x0f,0x78,0x05,0x05,0x50,0x50,
164 0xff,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x2f,0x7e,0xcf,0x79,0x01,0x54,0x5c,0x5c,
165 0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x84,0xef,0x7b,0xaa,0xab,0xab,0xab
187 #define DDS_CAPS 0x00000001 188 #define DDS_HEIGHT 0x00000002 189 #define DDS_WIDTH 0x00000004 190 #define DDS_PITCH 0x00000008 191 #define DDS_PIXELFORMAT 0x00001000 192 #define DDS_MIPMAPCOUNT 0x00020000 193 #define DDS_LINEARSIZE 0x00080000 196 #define DDSCAPS_ALPHA 0x00000002 197 #define DDS_CAPS_TEXTURE 0x00001000 200 #define DDS_PF_ALPHA 0x00000001 201 #define DDS_PF_ALPHA_ONLY 0x00000002 202 #define DDS_PF_FOURCC 0x00000004 203 #define DDS_PF_RGB 0x00000040 204 #define DDS_PF_LUMINANCE 0x00020000 205 #define DDS_PF_BUMPDUDV 0x00080000 242 header->size =
sizeof(*header);
246 header->pixel_format.size =
sizeof(
header->pixel_format);
249 header->pixel_format.fourcc = 0;
250 header->pixel_format.bpp = 32;
251 header->pixel_format.rmask = 0xff0000;
252 header->pixel_format.gmask = 0x00ff00;
253 header->pixel_format.bmask = 0x0000ff;
254 header->pixel_format.amask = 0;
258 #define check_dds_pixel_format(flags, fourcc, bpp, rmask, gmask, bmask, amask, format) \ 259 check_dds_pixel_format_(__LINE__, flags, fourcc, bpp, rmask, gmask, bmask, amask, format) 276 dds.header.pixel_format.flags =
flags;
277 dds.header.pixel_format.fourcc = fourcc;
278 dds.header.pixel_format.bpp =
bpp;
279 dds.header.pixel_format.rmask =
rmask;
280 dds.header.pixel_format.gmask =
gmask;
281 dds.header.pixel_format.bmask =
bmask;
282 dds.header.pixel_format.amask =
amask;
283 memset(dds.data, 0,
sizeof(dds.data));
286 ok_(__FILE__,
line)(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#x for pixel format %#x, expected %#x\n",
290 ok_(__FILE__,
line)(
info.Format == expected_format,
"D3DXGetImageInfoFromFileInMemory returned format %#x, expected %#x\n",
291 info.Format, expected_format);
315 DWORD pixel_data_size;
324 { { 32,
DDS_PF_RGB |
DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, 0, 4, 4, 0, 0,
326 { { 32,
DDS_PF_RGB |
DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 },
DDS_PITCH, 4, 4, 0 , 0,
328 { { 32,
DDS_PF_RGB |
DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 },
DDS_PITCH, 4, 4, 1 , 0,
330 { { 32,
DDS_PF_RGB |
DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 },
DDS_PITCH, 4, 4, 2 , 0,
332 { { 32,
DDS_PF_RGB |
DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 },
DDS_PITCH, 4, 4, 3 , 0,
334 { { 32,
DDS_PF_RGB |
DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 },
DDS_PITCH, 4, 4, 4 , 0,
336 { { 32,
DDS_PF_RGB |
DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 },
DDS_PITCH, 4, 4, 16 , 0,
338 { { 32,
DDS_PF_RGB |
DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 },
DDS_PITCH, 4, 4, 1024 , 0,
340 { { 32,
DDS_PF_RGB |
DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 },
DDS_PITCH, 4, 4, -1 , 0,
343 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 }, 0, 4, 4, 0, 0,
345 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDS_LINEARSIZE, 4, 4, 0 , 0,
347 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDS_LINEARSIZE, 4, 4, 1 , 0,
349 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDS_LINEARSIZE, 4, 4, 2 , 0,
351 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDS_LINEARSIZE, 4, 4, 9 , 0,
353 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDS_LINEARSIZE, 4, 4, 16 , 0,
355 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDS_LINEARSIZE, 4, 4, -1 , 0,
358 { { 32,
DDS_PF_RGB, 0, 32, 0xff0000, 0x00ff00, 0x0000ff, 0 }, 0, 0x80000000, 0x80000000 , 0, 0,
360 { { 32,
DDS_PF_RGB, 0, 32, 0xff0000, 0x00ff00, 0x0000ff, 0 }, 0, 0x8000100, 0x800100 , 0, 0,
362 { { 32,
DDS_PF_RGB, 0, 32, 0xff0000, 0x00ff00, 0x0000ff, 0 }, 0, 0x80000001, 0x80000001 , 0, 0,
364 { { 32,
DDS_PF_RGB, 0, 32, 0xff0000, 0x00ff00, 0x0000ff, 0 }, 0, 0x80000001, 0x80000001 , 0, 0,
367 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 64, 0, 0, 49151, {
D3DXERR_INVALIDDATA, 0 } },
368 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 64, 0, 0, 49152, {
D3D_OK, 1 } },
369 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDS_MIPMAPCOUNT, 256, 64, 0, 4, 65279, {
D3DXERR_INVALIDDATA, 0 } },
370 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDS_MIPMAPCOUNT, 256, 64, 0, 4, 65280, {
D3D_OK, 4 } },
371 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDS_MIPMAPCOUNT, 256, 64, 0, 9, 65540, {
D3DXERR_INVALIDDATA, 0 } },
372 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDS_MIPMAPCOUNT, 256, 64, 0, 9, 65541, {
D3D_OK, 9 } },
373 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 256, 0, 0, 196607, {
D3DXERR_INVALIDDATA, 0 } },
374 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 256, 0, 0, 196608, {
D3D_OK, 1 } },
375 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 256, 0, 0, 196609, {
D3D_OK, 1 } },
376 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDS_MIPMAPCOUNT, 256, 256, 0, 1, 196607, {
D3DXERR_INVALIDDATA, 0 } },
377 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDS_MIPMAPCOUNT, 256, 256, 0, 1, 196608, {
D3D_OK, 1 } },
378 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDS_MIPMAPCOUNT, 256, 256, 0, 0, 196607, {
D3DXERR_INVALIDDATA, 0 } },
379 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDS_MIPMAPCOUNT, 256, 256, 0, 0, 196608, {
D3D_OK, 1 } },
380 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDS_MIPMAPCOUNT, 256, 256, 0, 0, 400000, {
D3D_OK, 1 } },
381 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDS_MIPMAPCOUNT, 256, 256, 0, 9, 262142, {
D3DXERR_INVALIDDATA, 0 } },
382 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDS_MIPMAPCOUNT, 256, 256, 0, 9, 262143, {
D3D_OK, 9 } },
383 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDS_MIPMAPCOUNT, 256, 256, 0, 10, 262145, {
D3DXERR_INVALIDDATA, 0 } },
384 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDS_MIPMAPCOUNT, 256, 256, 0, 10, 262146, {
D3D_OK, 10 } },
385 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDS_MIPMAPCOUNT, 256, 256, 0, 20, 262175, {
D3DXERR_INVALIDDATA, 0 } },
386 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 },
DDS_MIPMAPCOUNT, 256, 256, 0, 20, 262176, {
D3D_OK, 20 } },
387 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 }, 0, 256, 256, 0, 0, 32767, {
D3DXERR_INVALIDDATA, 0 } },
388 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 }, 0, 256, 256, 0, 0, 32768, {
D3D_OK, 1 } },
389 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDS_MIPMAPCOUNT, 256, 256, 0, 0, 32767, {
D3DXERR_INVALIDDATA, 0 } },
390 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDS_MIPMAPCOUNT, 256, 256, 0, 0, 32768, {
D3D_OK, 1 } },
391 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDS_MIPMAPCOUNT, 256, 256, 0, 9, 43703, {
D3DXERR_INVALIDDATA, 0 } },
392 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDS_MIPMAPCOUNT, 256, 256, 0, 9, 43704, {
D3D_OK, 9 } },
393 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDS_MIPMAPCOUNT, 256, 256, 0, 20, 43791, {
D3DXERR_INVALIDDATA, 0 } },
394 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT1, 0, 0, 0, 0, 0 },
DDS_MIPMAPCOUNT, 256, 256, 0, 20, 43792, {
D3D_OK, 20 } },
395 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT4, 0, 0, 0, 0, 0 }, 0, 256, 256, 0, 0, 65535, {
D3DXERR_INVALIDDATA, 0 } },
396 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT4, 0, 0, 0, 0, 0 }, 0, 256, 256, 0, 0, 65536, {
D3D_OK, 1 } },
397 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT4, 0, 0, 0, 0, 0 },
DDS_MIPMAPCOUNT, 256, 256, 0, 0, 65535, {
D3DXERR_INVALIDDATA, 0 } },
398 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT4, 0, 0, 0, 0, 0 },
DDS_MIPMAPCOUNT, 256, 256, 0, 0, 65536, {
D3D_OK, 1 } },
399 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT4, 0, 0, 0, 0, 0 },
DDS_MIPMAPCOUNT, 256, 256, 0, 9, 87407, {
D3DXERR_INVALIDDATA, 0 } },
400 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT4, 0, 0, 0, 0, 0 },
DDS_MIPMAPCOUNT, 256, 256, 0, 9, 87408, {
D3D_OK, 9 } },
401 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT4, 0, 0, 0, 0, 0 },
DDS_MIPMAPCOUNT, 256, 256, 0, 20, 87583, {
D3DXERR_INVALIDDATA, 0 } },
402 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT4, 0, 0, 0, 0, 0 },
DDS_MIPMAPCOUNT, 256, 256, 0, 20, 87584, {
D3D_OK, 20 } },
403 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT4, 0, 0, 0, 0, 0 },
DDS_MIPMAPCOUNT, 256, 64, 0, 4, 21759, {
D3DXERR_INVALIDDATA, 0 } },
404 { { 32,
DDS_PF_FOURCC,
D3DFMT_DXT4, 0, 0, 0, 0, 0 },
DDS_MIPMAPCOUNT, 256, 64, 0, 4, 21760, {
D3D_OK, 4 } },
406 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 256, 0, 0, 262146, {
D3D_OK, 1 } },
407 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 256, 0, 2, 262146, {
D3D_OK, 2 } },
408 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 256, 0, 9, 262146, {
D3D_OK, 9 } },
409 { { 32,
DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 256, 0, 10, 262146, {
D3D_OK, 10 } },
415 skip(
"Failed to allocate memory.\n");
426 dds->header.flags |=
tests[
i].flags;
427 dds->header.width =
tests[
i].width;
428 dds->header.height =
tests[
i].height;
429 dds->header.pitch_or_linear_size =
tests[
i].pitch;
430 dds->header.miplevels =
tests[
i].miplevels;
431 dds->header.pixel_format =
tests[
i].pixel_format;
434 ok(
hr ==
tests[
i].
expected.hr,
"%d: D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n",
438 ok(
info.MipLevels ==
tests[
i].expected.miplevels,
"%d: Got MipLevels %u, expected %u\n",
450 BOOL testdummy_ok, testbitmap_ok;
461 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFile returned %#x, expected %#x\n",
hr,
D3D_OK);
464 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFile returned %#x, expected %#x\n",
hr,
D3D_OK);
465 }
else skip(
"Couldn't create \"testbitmap.bmp\"\n");
469 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFile returned %#x, expected %#x\n",
hr,
D3D_OK);
473 }
else skip(
"Couldn't create \"testdummy.bmp\"\n");
493 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromResource returned %#x, expected %#x\n",
hr,
D3D_OK);
496 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromResource returned %#x, expected %#x\n",
hr,
D3D_OK);
499 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromResource returned %#x, expected %#x\n",
hr,
D3D_OK);
519 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
522 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
525 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
528 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromResource returned %#x, expected %#x\n",
hr,
D3D_OK);
567 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
568 ok(
info.Depth == 1,
"Got depth %u, expected 1\n",
info.Depth);
573 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
574 ok(
info.Depth == 1,
"Got depth %u, expected 1\n",
info.Depth);
577 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
578 ok(
info.Depth == 1,
"Got depth %u, expected 1\n",
info.Depth);
581 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
582 ok(
info.Depth == 1,
"Got depth %u, expected 1\n",
info.Depth);
585 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
586 ok(
info.Depth == 1,
"Got depth %u, expected 1\n",
info.Depth);
591 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
592 ok(
info.Depth == 1,
"Got depth %u, expected 1\n",
info.Depth);
597 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
599 ok(
info.Width == 2,
"Got width %u, expected 2\n",
info.Width);
600 ok(
info.Height == 2,
"Got height %u, expected 2\n",
info.Height);
601 ok(
info.Depth == 1,
"Got depth %u, expected 1\n",
info.Depth);
602 ok(
info.MipLevels == 2,
"Got miplevels %u, expected 2\n",
info.MipLevels);
606 }
else skip(
"Couldn't get image info from 24-bit DDS file in memory\n");
609 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
611 ok(
info.Width == 2,
"Got width %u, expected 2\n",
info.Width);
612 ok(
info.Height == 2,
"Got height %u, expected 2\n",
info.Height);
613 ok(
info.Depth == 1,
"Got depth %u, expected 1\n",
info.Depth);
614 ok(
info.MipLevels == 1,
"Got miplevels %u, expected 1\n",
info.MipLevels);
618 }
else skip(
"Couldn't get image info from 16-bit DDS file in memory\n");
621 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
623 ok(
info.Width == 4,
"Got width %u, expected 4\n",
info.Width);
624 ok(
info.Height == 4,
"Got height %u, expected 4\n",
info.Height);
625 ok(
info.Depth == 1,
"Got depth %u, expected 1\n",
info.Depth);
626 ok(
info.MipLevels == 1,
"Got miplevels %u, expected 1\n",
info.MipLevels);
630 }
else skip(
"Couldn't get image info from cube map in memory\n");
633 ok(
hr ==
D3D_OK,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
635 ok(
info.Width == 4,
"Got width %u, expected 4\n",
info.Width);
636 ok(
info.Height == 4,
"Got height %u, expected 4\n",
info.Height);
637 ok(
info.Depth == 2,
"Got depth %u, expected 2\n",
info.Depth);
638 ok(
info.MipLevels == 3,
"Got miplevels %u, expected 3\n",
info.MipLevels);
642 }
else skip(
"Couldn't get image info from volume map in memory\n");
695 #define check_pixel_2bpp(lockrect, x, y, color) _check_pixel_2bpp(__LINE__, lockrect, x, y, color) 699 ok_(__FILE__,
line)(
color == expected_color,
"Got color 0x%04x, expected 0x%04x\n",
color, expected_color);
702 #define check_pixel_4bpp(lockrect, x, y, color) _check_pixel_4bpp(__LINE__, lockrect, x, y, color) 706 ok_(__FILE__,
line)(
color == expected_color,
"Got color 0x%08x, expected 0x%08x\n",
color, expected_color);
712 BOOL testdummy_ok, testbitmap_ok;
713 IDirect3DTexture9 *tex;
714 IDirect3DSurface9 *surf, *newsurf;
717 const WORD pixdata_a8r3g3b2[] = { 0x57df, 0x98fc, 0xacdd, 0xc891 };
718 const WORD pixdata_a1r5g5b5[] = { 0x46b5, 0x99c8, 0x06a2, 0x9431 };
719 const WORD pixdata_r5g6b5[] = { 0x9ef6, 0x658d, 0x0aee, 0x42ee };
720 const WORD pixdata_a8l8[] = { 0xff00, 0x00ff, 0xff30, 0x7f7f };
721 const DWORD pixdata_g16r16[] = { 0x07d23fbe, 0xdc7f44a4, 0xe4d8976b, 0x9a84fe89 };
722 const DWORD pixdata_a8b8g8r8[] = { 0xc3394cf0, 0x235ae892, 0x09b197fd, 0x8dc32bf6 };
723 const DWORD pixdata_a2r10g10b10[] = { 0x57395aff, 0x5b7668fd, 0xb0d856b5, 0xff2c61d6 };
733 skip(
"Failed to create a surface (%#x)\n",
hr);
746 }
else skip(
"Couldn't create \"testbitmap.bmp\"\n");
751 }
else skip(
"Couldn't create \"testdummy.bmp\"\n");
763 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromResource returned %#x, expected %#x\n",
hr,
D3D_OK);
767 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromResource returned %#x, expected %#x\n",
hr,
D3D_OK);
783 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
808 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
811 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
823 ok(
hr ==
E_FAIL,
"D3DXLoadSurfaceFromMemory returned %#x, expected %#x\n",
hr,
E_FAIL);
825 SetRect(&destrect, -1, -1, 1, 1);
829 SetRect(&destrect, 255, 255, 257, 257);
833 SetRect(&destrect, 1, 1, 0, 0);
837 SetRect(&destrect, 1, 2, 1, 2);
842 SetRect(&destrect, 257, 257, 257, 257);
851 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromSurface returned %#x, expected %#x\n",
hr,
D3D_OK);
860 }
else skip(
"Failed to create a second surface\n");
868 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromSurface returned %#x, expected %#x\n",
hr,
D3D_OK);
872 }
else skip(
"Failed to create texture\n");
892 skip(
"Failed to create multisampled render target.\n");
896 ok(
hr ==
D3D_OK,
"IDirect3DDevice9_GetRenderTarget returned %#x, expected %#x.\n",
hr,
D3D_OK);
899 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromSurface returned %#x, expected %#x.\n",
hr,
D3D_OK);
901 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromSurface returned %#x, expected %#x.\n",
hr,
D3D_OK);
903 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromSurface returned %#x, expected %#x.\n",
hr,
D3D_OK);
905 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromSurface returned %#x, expected %#x.\n",
hr,
D3D_OK);
907 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromSurface returned %#x, expected %#x.\n",
hr,
D3D_OK);
922 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
931 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
940 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
949 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
960 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
969 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
1001 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
1004 ok(*(
DWORD*)lockrect.
pBits == 0x80f3f2f1,
"Pixel color mismatch: got %#x, expected 0x80f3f2f1\n", *(
DWORD*)lockrect.
pBits);
1011 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromFileInMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
1014 ok(*(
DWORD*)lockrect.
pBits == 0xfff3f2f1,
"Pixel color mismatch: got %#x, expected 0xfff3f2f1\n", *(
DWORD*)lockrect.
pBits);
1026 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
1035 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
1044 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
1053 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
1064 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
1075 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
1103 skip(
"Failed to create A8L8 texture, hr %#x.\n",
hr);
1123 ok(
hr ==
D3D_OK,
"D3DXLoadSurfaceFromMemory returned %#x, expected %#x\n",
hr,
D3D_OK);
1200 skip(
"Failed to create R8G8B8 surface, hr %#x.\n",
hr);
1208 skip(
"Failed to create DXT2 texture, hr %#x.\n",
hr);
1221 skip(
"Failed to create DXT3 texture, hr %#x.\n",
hr);
1227 ok(
SUCCEEDED(
hr),
"Failed to convert pixels to DXT3 format.\n");
1234 skip(
"Failed to create DXT4 texture, hr %#x.\n",
hr);
1247 skip(
"Failed to create DXT5 texture, hr %#x.\n",
hr);
1253 ok(
SUCCEEDED(
hr),
"Failed to convert pixels to DXT5 format.\n");
1260 skip(
"Failed to create DXT1 texture, hr %#x.\n",
hr);
1266 ok(
SUCCEEDED(
hr),
"Failed to convert pixels to DXT1 format.\n");
1269 ok(
SUCCEEDED(
hr),
"Failed to convert pixels from DXT1 format.\n");
1290 test_access_types[] =
1303 IDirect3DSurface9 *surface;
1312 skip(
"Couldn't create surface\n");
1322 ok(
size > 0,
"ID3DXBuffer_GetBufferSize returned %u, expected > 0\n",
size);
1333 ok(dds->magic ==
MAKEFOURCC(
'D',
'D',
'S',
' '),
"Got unexpected DDS signature %#x.\n", dds->magic);
1334 ok(dds->header.size ==
sizeof(dds->header),
"Got unexpected DDS size %u.\n", dds->header.size);
1335 ok(!dds->header.height,
"Got unexpected height %u.\n", dds->header.height);
1336 ok(!dds->header.width,
"Got unexpected width %u.\n", dds->header.width);
1337 ok(!dds->header.depth,
"Got unexpected depth %u.\n", dds->header.depth);
1338 ok(!dds->header.miplevels,
"Got unexpected miplevels %u.\n", dds->header.miplevels);
1339 ok(!dds->header.pitch_or_linear_size,
"Got unexpected pitch_or_linear_size %u.\n", dds->header.pitch_or_linear_size);
1342 "Got unexpected flags %#x.\n", dds->header.flags);
1350 ok(dds->magic ==
MAKEFOURCC(
'D',
'D',
'S',
' '),
"Got unexpected DDS signature %#x.\n", dds->magic);
1351 ok(dds->header.size ==
sizeof(dds->header),
"Got unexpected DDS size %u.\n", dds->header.size);
1352 ok(dds->header.height == 4,
"Got unexpected height %u.\n", dds->header.height);
1353 ok(dds->header.width == 4,
"Got unexpected width %u.\n", dds->header.width);
1354 ok(!dds->header.depth,
"Got unexpected depth %u.\n", dds->header.depth);
1355 ok(!dds->header.miplevels,
"Got unexpected miplevels %u.\n", dds->header.miplevels);
1356 ok(!dds->header.pitch_or_linear_size,
"Got unexpected pitch_or_linear_size %u.\n", dds->header.pitch_or_linear_size);
1359 "Got unexpected flags %#x.\n", dds->header.flags);
1389 IDirect3DSurface9 *surface;
1393 const BYTE pixels[] = { 0xff, 0x00, 0x00, 0x00, 0xff, 0x00,
1394 0x00, 0x00, 0xff, 0x00, 0x00, 0xff };
1399 skip(
"Couldn't create surface\n");
1410 ok(
hr ==
D3D_OK,
"Couldn't load saved surface %#x\n",
hr);
1413 ok(image_info.
Width == 2,
"Wrong width %u\n", image_info.
Width);
1414 ok(image_info.
Height == 2,
"Wrong height %u\n", image_info.
Height);
1426 }
else skip(
"Couldn't fill surface\n");
1444 ok(
hr ==
D3D_OK,
"Couldn't load saved surface %#x\n",
hr);
1447 ok(image_info.
Width == 2,
"Wrong width %u\n", image_info.
Width);
1459 }
else skip(
"Couldn't save surface\n");
1493 IDirect3DDevice9 *
device;
1500 skip(
"Couldn't create application window\n");
1505 skip(
"Couldn't create IDirect3D9 object\n");
1515 skip(
"Failed to create IDirect3DDevice9 object %#x\n",
hr);
#define IDirect3D9_CreateDevice(p, a, b, c, d, e, f)
#define D3DADAPTER_DEFAULT
#define IDirect3DSurface9_Release(p)
#define DDS_PF_ALPHA_ONLY
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
GLint GLint GLsizei width
static void _check_pixel_4bpp(unsigned int line, const D3DLOCKED_RECT *lockrect, int x, int y, DWORD expected_color)
#define D3DCREATE_SOFTWARE_VERTEXPROCESSING
#define HRESULT_FROM_WIN32(x)
#define check_pixel_2bpp(lockrect, x, y, color)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define check_dds_pixel_format(flags, fourcc, bpp, rmask, gmask, bmask, amask, format)
static void test_D3DXGetImageInfo(void)
HRESULT WINAPI D3DXLoadSurfaceFromSurface(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette, const RECT *dst_rect, IDirect3DSurface9 *src_surface, const PALETTEENTRY *src_palette, const RECT *src_rect, DWORD filter, D3DCOLOR color_key)
static const unsigned char bmp_4bpp[]
static const unsigned char noimage[4]
#define IDirect3DTexture9_GetSurfaceLevel(p, a, b)
static struct test_info tests[]
#define D3DX_FILTER_MIRROR
static const unsigned char bmp_1bpp[]
#define IDirect3DTexture9_Release(p)
#define D3DERR_INVALIDCALL
static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
#define INVALID_HANDLE_VALUE
#define D3DX_FILTER_LINEAR
DWORD WINAPI GetLastError(VOID)
GLint GLint GLint GLint GLint x
#define MAKEINTRESOURCEA(i)
HRESULT WINAPI D3DXLoadSurfaceFromFileA(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette, const RECT *dst_rect, const char *src_file, const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info)
#define IDirect3DDevice9_CreateRenderTarget(p, a, b, c, d, e, f, g, h)
BOOL WINAPI DestroyWindow(_In_ HWND)
IDirect3D9 *WINAPI Direct3DCreate9(UINT SDKVersion)
static const unsigned char bmp_32bpp_argb[]
#define IDirect3DDevice9_CreateOffscreenPlainSurface(p, a, b, c, d, e, f)
#define IDirect3D9_Release(p)
static const unsigned char dds_16bit[]
static void fill_dds_header(struct dds_header *header)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
HRESULT WINAPI D3DXLoadSurfaceFromResourceA(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette, const RECT *dst_rect, HMODULE src_module, const char *resource, const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info)
#define D3DX_FILTER_TRIANGLE
static const unsigned char bmp_32bpp_xrgb[]
#define check_pixel_4bpp(lockrect, x, y, color)
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
struct ID3DXBuffer ID3DXBuffer
enum _D3DFORMAT D3DFORMAT
#define IDirect3DDevice9_GetRenderTarget(p, a, b)
static void test_dds_header_handling(void)
static void check_dds_pixel_format_(unsigned int line, DWORD flags, DWORD fourcc, DWORD bpp, DWORD rmask, DWORD gmask, DWORD bmask, DWORD amask, D3DFORMAT expected_format)
D3DXIMAGE_FILEFORMAT ImageFileFormat
#define ID3DXBuffer_GetBufferSize(p)
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static const unsigned char bmp_2bpp[]
#define D3DUSAGE_RENDERTARGET
static void test_D3DXSaveSurfaceToFile(IDirect3DDevice9 *device)
HRESULT WINAPI D3DXGetImageInfoFromFileA(const char *file, D3DXIMAGE_INFO *info)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
static void _check_release(unsigned int line, IUnknown *obj, int exp)
#define FILE_ATTRIBUTE_NORMAL
HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE_FILEFORMAT file_format, IDirect3DSurface9 *src_surface, const PALETTEENTRY *src_palette, const RECT *src_rect)
static const unsigned char dds_volume_map[]
GLsizeiptr const GLvoid GLenum usage
static const unsigned char png_grayscale[]
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
GLint GLint GLsizei GLsizei height
static const unsigned char dds_cube_map[]
static void test_D3DXSaveSurfaceToFileInMemory(IDirect3DDevice9 *device)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette, const RECT *dst_rect, const void *src_memory, D3DFORMAT src_format, UINT src_pitch, const PALETTEENTRY *src_palette, const RECT *src_rect, DWORD filter, D3DCOLOR color_key)
HRESULT WINAPI D3DXSaveSurfaceToFileA(const char *dst_filename, D3DXIMAGE_FILEFORMAT file_format, IDirect3DSurface9 *src_surface, const PALETTEENTRY *src_palette, const RECT *src_rect)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define IDirect3DDevice9_CreateTexture(p, a, b, c, d, e, f, g, h)
static void _check_pixel_2bpp(unsigned int line, const D3DLOCKED_RECT *lockrect, int x, int y, WORD expected_color)
#define ID3DXBuffer_Release(p)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
static const unsigned char bmp_8bpp[]
static const unsigned char dds_24bit[]
GLint GLint GLint GLint GLint GLint y
#define IDD_BITMAPDATA_1x1
HRESULT WINAPI D3DXGetImageInfoFromResourceA(HMODULE module, const char *resource, D3DXIMAGE_INFO *info)
#define IDirect3DSurface9_UnlockRect(p)
static HRESULT create_file(const char *filename, const unsigned char *data, const unsigned int size)
#define WS_OVERLAPPEDWINDOW
HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(const void *data, UINT datasize, D3DXIMAGE_INFO *info)
#define check_release(obj, exp)
#define CreateFileA(a, b, c, d, e, f, g)
#define IDirect3DSurface9_LockRect(p, a, b, c)
#define MAKEFOURCC(ch0, ch1, ch2, ch3)
static const unsigned char pixdata[]
#define HeapFree(x, y, z)
#define ID3DXBuffer_GetBufferPointer(p)
HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(IDirect3DSurface9 *pDestSurface, const PALETTEENTRY *pDestPalette, const RECT *pDestRect, const void *pSrcData, UINT SrcDataSize, const RECT *pSrcRect, DWORD dwFilter, D3DCOLOR Colorkey, D3DXIMAGE_INFO *pSrcInfo)