25#define _USE_MATH_DEFINES
34#define CHECK_REFCOUNT(obj,rc) \
37 int count = get_refcount( (IUnknown *)obj ); \
38 ok(count == rc_new, "Invalid refcount. Expected %d got %d\n", rc_new, count); \
43 IUnknown_AddRef(
object );
44 return IUnknown_Release(
object );
63#define expect_matrix(m, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44, u) \
64 expect_matrix_(__LINE__, m, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44, u)
80 "Got unexpected matrix {%.8e, %.8e, %.8e, %.8e, %.8e, %.8e, %.8e, %.8e, "
81 "%.8e, %.8e, %.8e, %.8e, %.8e, %.8e, %.8e, %.8e}, "
82 "expected {%.8e, %.8e, %.8e, %.8e, %.8e, %.8e, %.8e, %.8e, "
83 "%.8e, %.8e, %.8e, %.8e, %.8e, %.8e, %.8e, %.8e}.\n",
84 m[0][0],
m[0][1],
m[0][2],
m[0][3],
m[1][0],
m[1][1],
m[1][2],
m[1][3],
85 m[2][0],
m[2][1],
m[2][2],
m[2][3],
m[3][0],
m[3][1],
m[3][2],
m[3][3],
86 m11,
m12,
m13,
m14,
m21,
m22,
m23,
m24,
m31,
m32,
m33,
m34,
m41,
m42,
m43,
m44);
89#define expect_vector(v, x, y, z, u) expect_vector_(__LINE__, v, x, y, z, u)
96 ok_(__FILE__,
line)(
equal,
"Got unexpected vector {%.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e}.\n",
100#define vector_eq(a, b) vector_eq_(__LINE__, a, b)
107 { 1.0f, 0.0f, 0.0f, 0.0f },
108 { 0.0f, 1.0f, 0.0f, 0.0f },
109 { 0.0f, 0.0f, 1.0f, 0.0f },
110 { 0.0f, 0.0f, 0.0f, 1.0f }
139 for (
i = 0;
i < 4; ++
i)
141 for (
j = 0;
j < 4; ++
j)
143 if (
m[
i][
j] > -1e-7f &&
m[
i][
j] < 1e-7f)
151 RECT r = {0, 0, 640, 480};
159#define test_class_name(a, b) test_class_name_(__LINE__, a, b)
162 char cname[64] = {0};
181 size =
sizeof(cname);
185 ok_(__FILE__,
line)(!
strcmp(cname,
name),
"Expected cname to be \"%s\", but got \"%s\".\n",
name, cname);
191 ok_(__FILE__,
line)(!
strcmp(cname,
name),
"Expected cname to be \"%s\", but got \"%s\".\n",
name, cname);
198 ok_(__FILE__,
line)(!
strcmp(cname,
"XXX"),
"Expected unchanged buffer, but got \"%s\".\n", cname);
201#define test_object_name(a) test_object_name_(__LINE__, a)
214 ok_(__FILE__,
line)(
name[0] == 0x1f,
"Unexpected buffer contents, %#x.\n",
name[0]);
234 ok_(__FILE__,
line)(
name[0] == 0x1f,
"Unexpected name \"%s\".\n",
name);
258 ok_(__FILE__,
line)(
name[0] == 0x1f,
"Got unexpected name \"%s\".\n",
name);
273 ok_(__FILE__,
line)(
name[0] == 0,
"Got unexpected name \"%s\".\n",
name);
311"Header { 1; 0; 1; }\n"
319" MeshMaterialList {\n"
322" 0.0; 1.0; 0.0; 1.0;;\n"
326" TextureFileName {\n"
339" MeshTextureCoords {\n"
374" 0.1, 0.2, 0.3, 0.4;;\n"
382"Header { 1; 0; 1; }\n"
398" MeshMaterialList {\n"
399" 3; 6; 0, 1, 1, 2, 2, 2;\n"
401" 1.0; 0.0; 0.0; 0.1;;\n"
403" 0.11; 0.12; 0.13;;\n"
404" 0.14; 0.15; 0.16;;\n"
407" 0.0; 1.0; 0.0; 0.2;;\n"
409" 0.21; 0.22; 0.23;;\n"
410" 0.24; 0.25; 0.26;;\n"
413" 0.0; 0.0; 1.0; 0.3;;\n"
415" 0.31; 0.32; 0.33;;\n"
416" 0.34; 0.35; 0.36;;\n"
426 IDirect3DRMMeshBuilder *pMeshBuilder;
427 IDirect3DRMMeshBuilder3 *meshbuilder3;
428 IDirect3DRMMesh *
mesh;
431 DWORD val1, val2, val3;
442 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRM interface (hr = %x)\n",
hr);
445 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRMMeshBuilder interface (hr = %x)\n",
hr);
449 ok(unk == (
IUnknown *)pMeshBuilder,
"Unexpected interface pointer.\n");
450 IUnknown_Release(unk);
454 ok(unk == (
IUnknown *)pMeshBuilder,
"Unexpected interface pointer.\n");
455 IUnknown_Release(unk);
458 ok(
SUCCEEDED(
hr),
"Failed to get IDirect3DRMMeshBuilder3, %#x.\n",
hr);
462 ok(unk == (
IUnknown *)pMeshBuilder,
"Unexpected interface pointer.\n");
463 IUnknown_Release(unk);
467 ok(unk == (
IUnknown *)pMeshBuilder,
"Unexpected interface pointer.\n");
468 IUnknown_Release(unk);
492 ok(
hr ==
D3DRM_OK,
"IDirect3DRMMeshBuilder_GetName returned hr = %x\n",
hr);
493 ok(!
strcmp(
name,
"Object"),
"Retrieved name '%s' instead of 'Object'\n",
name);
498 ok(
hr ==
D3DRM_OK,
"IDirect3DRMMeshBuilder_SetName returned hr = %x\n",
hr);
501 ok(
hr ==
D3DRM_OK,
"IDirect3DRMMeshBuilder_GetName returned hr = %x\n",
hr);
502 ok(
size == 0,
"Size should be 0 instead of %u\n",
size);
504 ok(
hr ==
D3DRM_OK,
"IDirect3DRMMeshBuilder_SetName returned hr = %x\n",
hr);
507 ok(
hr ==
D3DRM_OK,
"IDirect3DRMMeshBuilder_GetName returned hr = %x\n",
hr);
511 ok(
val == 4,
"Wrong number of vertices %d (must be 4)\n",
val);
514 ok(
val == 3,
"Wrong number of faces %d (must be 3)\n",
val);
517 ok(
hr ==
D3DRM_OK,
"Cannot get vertices information (hr = %x)\n",
hr);
518 ok(val1 == 4,
"Wrong number of vertices %d (must be 4)\n", val1);
519 ok(val2 == 4,
"Wrong number of normals %d (must be 4)\n", val2);
520 ok(val3 == 22,
"Wrong number of face data bytes %d (must be 22)\n", val3);
524 ok(
hr ==
D3DRM_OK,
"Cannot get vertices information (hr = %x)\n",
hr);
534 ok(
hr ==
D3DRM_OK,
"Cannot get texture coordinates (hr = %x)\n",
hr);
535 ok(valu == 0.0f,
"Wrong coordinate %f (must be 0.0)\n", valu);
536 ok(valv == 0.0f,
"Wrong coordinate %f (must be 0.0)\n", valv);
540 ok(
hr ==
D3DRM_OK,
"Cannot get texture coordinates (hr = %x)\n",
hr);
541 ok(valu == 0.0f,
"Wrong coordinate %f (must be 0.0)\n", valu);
542 ok(valv == 0.0f,
"Wrong coordinate %f (must be 0.0)\n", valv);
546 ok(
hr ==
D3DRM_OK,
"Cannot get texture coordinates (hr = %x)\n",
hr);
547 ok(valu == 0.0f,
"Wrong coordinate %f (must be 0.0)\n", valu);
548 ok(valv == 0.0f,
"Wrong coordinate %f (must be 0.0)\n", valv);
552 ok(
hr ==
D3DRM_OK,
"Cannot get texture coordinates (hr = %x)\n",
hr);
553 ok(valu == 0.0f,
"Wrong coordinate %f (must be 0.0)\n", valu);
554 ok(valv == 0.0f,
"Wrong coordinate %f (must be 0.0)\n", valv);
561 ok(
hr ==
D3DRM_OK,
"Cannot set texture coordinates (hr = %x)\n",
hr);
568 ok(
hr ==
D3DRM_OK,
"Cannot get texture coordinates (hr = %x)\n",
hr);
569 ok(valu == 1.23f,
"Wrong coordinate %f (must be 1.23)\n", valu);
570 ok(valv == 3.21f,
"Wrong coordinate %f (must be 3.21)\n", valv);
575 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRMMeshBuilder interface (hr = %x)\n",
hr);
585 ok(nb_groups == 0,
"GetCroupCount returned %u\n", nb_groups);
596 ok(
val == 3,
"Wrong number of vertices %d (must be 3)\n",
val);
599 ok(
val == 1,
"Wrong number of faces %d (must be 1)\n",
val);
602 val1 = 1; val2 = 3; val3 = 8;
607 val1 = 3; val2 = 1; val3 = 8;
612 val1 = 3; val2 = 3; val3 = 1;
618 val1 = 3; val2 = 3; val3 = 8;
620 ok(
hr ==
D3DRM_OK,
"Cannot get vertices information (hr = %x)\n",
hr);
621 ok(val1 == 3,
"Wrong number of vertices %d (must be 3)\n", val1);
622 ok(val2 == 3,
"Wrong number of normals %d (must be 3)\n", val2);
623 ok(val3 == 8,
"Wrong number of face data bytes %d (must be 8)\n", val3);
630 ok(
f[0] == 3 ,
"Wrong component f[0] = %d (expected 3)\n",
f[0]);
631 ok(
f[1] == 0 ,
"Wrong component f[1] = %d (expected 0)\n",
f[1]);
632 ok(
f[2] == 0 ,
"Wrong component f[2] = %d (expected 0)\n",
f[2]);
633 ok(
f[3] == 1 ,
"Wrong component f[3] = %d (expected 1)\n",
f[3]);
634 ok(
f[4] == 1 ,
"Wrong component f[4] = %d (expected 1)\n",
f[4]);
635 ok(
f[5] == 2 ,
"Wrong component f[5] = %d (expected 2)\n",
f[5]);
636 ok(
f[6] == 2 ,
"Wrong component f[6] = %d (expected 2)\n",
f[6]);
637 ok(
f[7] == 0 ,
"Wrong component f[7] = %d (expected 0)\n",
f[7]);
644 unsigned nb_vertices, nb_faces, nb_face_vertices;
646 IDirect3DRMMaterial *material = (IDirect3DRMMaterial *)0xdeadbeef;
647 IDirect3DRMTexture *
texture = (IDirect3DRMTexture *)0xdeadbeef;
651 ok(nb_groups == 1,
"GetCroupCount returned %u\n", nb_groups);
656 ok(nb_vertices == 3,
"Wrong number of vertices %u (must be 3)\n", nb_vertices);
657 ok(nb_faces == 1,
"Wrong number of faces %u (must be 1)\n", nb_faces);
658 ok(nb_face_vertices == 3,
"Wrong number of vertices per face %u (must be 3)\n", nb_face_vertices);
659 ok(data_size == 3,
"Wrong number of face data bytes %u (must be 3)\n", data_size);
661 ok(
color == 0xff00ff00,
"Wrong color returned %#x instead of %#x\n",
color, 0xff00ff00);
663 ok(
hr ==
D3DRM_OK,
"GetCroupTexture failed returning hr = %x\n",
hr);
666 ok(
hr ==
D3DRM_OK,
"GetCroupMaterial failed returning hr = %x\n",
hr);
667 ok(material !=
NULL,
"No material present\n");
669 ok(
hr ==
D3DRM_OK,
"Failed to get emissive color, hr %#x.\n",
hr);
670 ok(
values[0] == 0.5f,
"Got unexpected red component %.8e.\n",
values[0]);
671 ok(
values[1] == 0.5f,
"Got unexpected green component %.8e.\n",
values[1]);
672 ok(
values[2] == 0.5f,
"Got unexpected blue component %.8e.\n",
values[2]);
674 ok(
hr ==
D3DRM_OK,
"Failed to get specular color, hr %#x.\n",
hr);
675 ok(
values[0] == 1.0f,
"Got unexpected red component %.8e.\n",
values[0]);
676 ok(
values[1] == 0.0f,
"Got unexpected green component %.8e.\n",
values[1]);
677 ok(
values[2] == 0.0f,
"Got unexpected blue component %.8e.\n",
values[2]);
679 ok(
values[0] == 30.0f,
"Got unexpected power value %.8e.\n",
values[0]);
689 ok(
hr ==
D3DRM_OK,
"Cannot get vertices information (hr = %x)\n",
hr);
690 ok(val2 == 3,
"Wrong number of normals %d (must be 3)\n", val2);
691 ok(val1 == 3,
"Wrong number of vertices %d (must be 3)\n", val1);
710 IDirect3DRM3 *d3drm3;
711 IDirect3DRMMeshBuilder3 *pMeshBuilder3;
718 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRM interface (hr = %x)\n",
hr);
722 win_skip(
"Cannot get IDirect3DRM3 interface (hr = %x), skipping tests\n",
hr);
728 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRMMeshBuilder3 interface (hr = %x)\n",
hr);
749 ok(
val == 4,
"Wrong number of vertices %d (must be 4)\n",
val);
752 ok(
val == 3,
"Wrong number of faces %d (must be 3)\n",
val);
755 ok(
hr ==
D3DRM_OK,
"Cannot get vertices information (hr = %x)\n",
hr);
756 ok(val1 == 4,
"Wrong number of vertices %d (must be 4)\n", val1);
762 ok(
hr ==
D3DRM_OK,
"Cannot get texture coordinates (hr = %x)\n",
hr);
763 ok(valu == 0.0f,
"Wrong coordinate %f (must be 0.0)\n", valu);
764 ok(valv == 0.0f,
"Wrong coordinate %f (must be 0.0)\n", valv);
768 ok(
hr ==
D3DRM_OK,
"Cannot get texture coordinates (hr = %x)\n",
hr);
769 ok(valu == 0.0f,
"Wrong coordinate %f (must be 0.0)\n", valu);
770 ok(valv == 0.0f,
"Wrong coordinate %f (must be 0.0)\n", valv);
774 ok(
hr ==
D3DRM_OK,
"Cannot get texture coordinates (hr = %x)\n",
hr);
775 ok(valu == 0.0f,
"Wrong coordinate %f (must be 0.0)\n", valu);
776 ok(valv == 0.0f,
"Wrong coordinate %f (must be 0.0)\n", valv);
780 ok(
hr ==
D3DRM_OK,
"Cannot get texture coordinates (hr = %x)\n",
hr);
781 ok(valu == 0.0f,
"Wrong coordinate %f (must be 0.0)\n", valu);
782 ok(valv == 0.0f,
"Wrong coordinate %f (must be 0.0)\n", valv);
789 ok(
hr ==
D3DRM_OK,
"Cannot set texture coordinates (hr = %x)\n",
hr);
796 ok(
hr ==
D3DRM_OK,
"Cannot get texture coordinates (hr = %x)\n",
hr);
797 ok(valu == 1.23f,
"Wrong coordinate %f (must be 1.23)\n", valu);
798 ok(valv == 3.21f,
"Wrong coordinate %f (must be 3.21)\n", valv);
809 IDirect3DRMMesh *
mesh;
813 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRM interface (hr = %x)\n",
hr);
816 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRMMesh interface (hr = %x)\n",
hr);
823 IUnknown_Release(unk);
827 IUnknown_Release(unk);
838 IDirect3DRM2 *d3drm2;
839 IDirect3DRM3 *d3drm3;
840 IDirect3DRMMeshBuilder2 *MeshBuilder2;
841 IDirect3DRMMeshBuilder3 *MeshBuilder3;
842 IDirect3DRMFace *face1;
843 IDirect3DRMObject *
obj;
844 IDirect3DRMFace2 *face2;
845 IDirect3DRMFaceArray *array1;
853 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRM interface (hr = %x)\n",
hr);
856 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRMFace interface (hr = %x)\n",
hr);
859 skip(
"Cannot get IDirect3DRMFace interface (hr = %x), skipping tests\n",
hr);
866 ok(
obj == (IDirect3DRMObject *)face1,
"Unexpected interface pointer.\n");
873 ok(!icount,
"wrong VertexCount: %i\n", icount);
879 win_skip(
"Cannot get IDirect3DRM2 interface (hr = %x), skipping tests\n",
hr);
885 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRMMeshBuilder2 interface (hr = %x)\n",
hr);
888 ok(!icount,
"wrong FaceCount: %i\n", icount);
896 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRMFace interface (hr = %x)\n",
hr);
900 ok(icount == 1,
"wrong FaceCount: %i\n", icount);
907 ok(array1 !=
NULL,
"pArray = %p\n", array1);
910 IDirect3DRMFace *
face;
920 ok(!icount,
"wrong VertexCount: %i\n", icount);
927 win_skip(
"Cannot get IDirect3DRM3 interface (hr = %x), skipping tests\n",
hr);
933 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRMMeshBuilder3 interface (hr = %x)\n",
hr);
936 ok(!icount,
"wrong FaceCount: %i\n", icount);
939 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRMFace2 interface (hr = %x)\n",
hr);
946 ok(
obj == (IDirect3DRMObject *)face1,
"Unexpected interface pointer.\n");
956 ok(icount == 1,
"wrong FaceCount: %i\n", icount);
963 ok(array1 !=
NULL,
"pArray = %p\n", array1);
966 IDirect3DRMFace *
face;
976 ok(!icount,
"wrong VertexCount: %i\n", icount);
984 ok(icount == 4,
"Wrong number of vertices %d (must be 4)\n", icount);
987 ok(icount == 4,
"Wrong number of normals %d (must be 4)\n", icount);
991 ok(icount == 4,
"Wrong number of faces %d (must be 4)\n", icount);
995 ok(
hr ==
D3DRM_OK,
"Cannot get vertices information (hr = %x)\n",
hr);
996 ok(
count == 4,
"Wrong number of vertices %d (must be 4)\n",
count);
999 ok(
hr ==
D3DRM_OK,
"Cannot get normals information (hr = %x)\n",
hr);
1000 ok(
count == 4,
"Wrong number of normals %d (must be 4)\n",
count);
1007 ok(array1 !=
NULL,
"pArray = %p\n", array1);
1010 IDirect3DRMFace *
face;
1016 ok(
hr ==
D3DRM_OK,
"Cannot get vertices information (hr = %x)\n",
hr);
1017 ok(
count == 3,
"Wrong number of vertices %d (must be 3)\n",
count);
1035 ok(
color == 0x1f180587,
"Unexpected color %8x.\n",
color);
1040 ok(
color == 0xff7f7f7f,
"Unexpected color %8x.\n",
color);
1053 IDirect3DRMFrame *pFrameC;
1054 IDirect3DRMFrame *pFrameP1;
1055 IDirect3DRMFrame *pFrameP2;
1056 IDirect3DRMFrame *pFrameTmp;
1057 IDirect3DRMFrame *scene_frame;
1058 IDirect3DRMFrameArray *frame_array;
1060 IDirect3DRMVisual *visual1;
1061 IDirect3DRMVisual *visual_tmp;
1062 IDirect3DRMVisualArray *visual_array;
1063 IDirect3DRMLight *light1;
1064 IDirect3DRMLight *light_tmp;
1065 IDirect3DRMLightArray *light_array;
1066 IDirect3DRMFrame3 *frame3;
1072 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRM interface (hr = %x)\n",
hr);
1076 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRMFrame interface (hr = %x)\n",
hr);
1079 ok(ref2 >
ref,
"Expected d3drm object to be referenced.\n");
1086 pFrameTmp = (
void*)0xdeadbeef;
1089 ok(pFrameTmp ==
NULL,
"pFrameTmp = %p\n", pFrameTmp);
1095 ok(!!frame_array,
"frame_array = %p\n", frame_array);
1102 ok(pFrameTmp ==
NULL,
"pFrameTmp = %p\n", pFrameTmp);
1107 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRMFrame interface (hr = %x)\n",
hr);
1124 pFrameTmp = (
void*)0xdeadbeef;
1127 ok(pFrameTmp ==
NULL,
"pFrameTmp = %p\n", pFrameTmp);
1138 ok(scene_frame == pFrameP1,
"Expected scene frame == %p, got %p.\n", pFrameP1, scene_frame);
1143 ok(scene_frame == pFrameP1,
"Expected scene frame == %p, got %p.\n", pFrameP1, scene_frame);
1159 ok(pFrameTmp == pFrameC,
"pFrameTmp = %p\n", pFrameTmp);
1169 pFrameTmp = (
void*)0xdeadbeef;
1172 ok(pFrameTmp == pFrameP1,
"pFrameTmp = %p\n", pFrameTmp);
1179 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRMFrame interface (hr = %x)\n",
hr);
1194 ok(pFrameTmp == pFrameC,
"pFrameTmp = %p\n", pFrameTmp);
1206 pFrameTmp = (
void*)0xdeadbeef;
1209 ok(pFrameTmp ==
NULL,
"pFrameTmp = %p\n", pFrameTmp);
1214 ok(scene_frame == pFrameP2,
"Expected scene frame == %p, got %p.\n", pFrameP2, scene_frame);
1219 ok(scene_frame == pFrameP2,
"Expected scene frame == %p, got %p.\n", pFrameP2, scene_frame);
1223 pFrameTmp = (
void*)0xdeadbeef;
1226 ok(pFrameTmp == pFrameP2,
"pFrameTmp = %p\n", pFrameTmp);
1246 ok(pFrameTmp == pFrameC,
"pFrameTmp = %p\n", pFrameTmp);
1263 pFrameTmp = (
void*)0xdeadbeef;
1266 ok(pFrameTmp ==
NULL,
"pFrameTmp = %p\n", pFrameTmp);
1270 pFrameTmp = (
void*)0xdeadbeef;
1273 ok(pFrameTmp ==
NULL,
"pFrameTmp = %p\n", pFrameTmp);
1293 ok(pFrameTmp == pFrameC,
"pFrameTmp = %p\n", pFrameTmp);
1297 ok(pFrameTmp == pFrameP1,
"pFrameTmp = %p\n", pFrameTmp);
1313 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRMMeshBuilder interface (hr = %x)\n",
hr);
1322 visual_array =
NULL;
1331 ok(visual_tmp == visual1,
"visual_tmp = %p\n", visual_tmp);
1353 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRMLight interface (hr = %x)\n",
hr);
1370 ok(light_tmp == light1,
"light_tmp = %p\n", light_tmp);
1397 ok(
SUCCEEDED(
hr),
"Failed to get IDirect3DRMFrame3 interface, hr %#x.\n",
hr);
1459 ok(
obj == ctxt->
obj,
"called with %p, expected %p\n",
obj, ctxt->
obj);
1468 ok(
obj == ctxt->
obj,
"called with %p, expected %p\n",
obj, ctxt->
obj);
1476 IDirect3DRMObject *
obj;
1487 hr = IUnknown_QueryInterface(
unknown, &IID_IDirect3DRMObject, (
void**)&
obj);
1531 "Expected callback = %p, context = %p. Got callback = %p, context = %p.\n",
d3drm_corder[
i].
callback,
1538 hr = IUnknown_QueryInterface(
unknown, &IID_IDirect3DRMObject, (
void**)&
obj);
1568 "Expected callback = %p, context = %p. Got callback = %p, context = %p.\n",
d3drm_corder[
i].
callback,
1581 BOOL takes_d3drm_ref;
1585 { &CLSID_CDirect3DRMDevice, &IID_IDirect3DRMDevice },
1586 { &CLSID_CDirect3DRMDevice, &IID_IDirect3DRMDevice2 },
1587 { &CLSID_CDirect3DRMDevice, &IID_IDirect3DRMDevice3 },
1588 { &CLSID_CDirect3DRMDevice, &IID_IDirect3DRMWinDevice },
1589 { &CLSID_CDirect3DRMTexture, &IID_IDirect3DRMTexture },
1590 { &CLSID_CDirect3DRMTexture, &IID_IDirect3DRMTexture2 },
1591 { &CLSID_CDirect3DRMTexture, &IID_IDirect3DRMTexture3 },
1592 { &CLSID_CDirect3DRMViewport, &IID_IDirect3DRMViewport },
1593 { &CLSID_CDirect3DRMViewport, &IID_IDirect3DRMViewport2 },
1594 { &CLSID_CDirect3DRMFace, &IID_IDirect3DRMFace },
1595 { &CLSID_CDirect3DRMFace, &IID_IDirect3DRMFace2 },
1596 { &CLSID_CDirect3DRMMeshBuilder, &IID_IDirect3DRMMeshBuilder,
TRUE },
1597 { &CLSID_CDirect3DRMMeshBuilder, &IID_IDirect3DRMMeshBuilder2,
TRUE },
1598 { &CLSID_CDirect3DRMMeshBuilder, &IID_IDirect3DRMMeshBuilder3,
TRUE },
1599 { &CLSID_CDirect3DRMFrame, &IID_IDirect3DRMFrame,
TRUE },
1600 { &CLSID_CDirect3DRMFrame, &IID_IDirect3DRMFrame2,
TRUE },
1601 { &CLSID_CDirect3DRMFrame, &IID_IDirect3DRMFrame3,
TRUE },
1602 { &CLSID_CDirect3DRMLight, &IID_IDirect3DRMLight,
TRUE },
1603 { &CLSID_CDirect3DRMMaterial, &IID_IDirect3DRMMaterial,
TRUE },
1604 { &CLSID_CDirect3DRMMaterial, &IID_IDirect3DRMMaterial2,
TRUE },
1605 { &CLSID_CDirect3DRMMesh, &IID_IDirect3DRMMesh,
TRUE },
1606 { &CLSID_CDirect3DRMAnimation, &IID_IDirect3DRMAnimation,
TRUE },
1607 { &CLSID_CDirect3DRMAnimation, &IID_IDirect3DRMAnimation2,
TRUE },
1608 { &CLSID_CDirect3DRMWrap, &IID_IDirect3DRMWrap },
1610 IDirect3DRM *d3drm1;
1611 IDirect3DRM2 *d3drm2;
1612 IDirect3DRM3 *d3drm3;
1615 ULONG ref1, ref2, ref3, ref4;
1619 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRM interface (hr = %#x).\n",
hr);
1622 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRM2 interface (hr = %#x).\n",
hr);
1624 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRM3 interface (hr = %#x).\n",
hr);
1648 if (
tests[
i].takes_d3drm_ref)
1649 ok(ref2 > ref1,
"Test %u: expected ref2 > ref1, got ref1 = %u, ref2 = %u.\n",
i, ref1, ref2);
1651 ok(ref2 == ref1,
"Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n",
i, ref1, ref2);
1654 ok(ref3 == ref1,
"Test %u: expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n",
i, ref1, ref3);
1656 ok(ref4 == ref1,
"Test %u: expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n",
i, ref1, ref4);
1659 ok(ref2 == ref1,
"Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n",
i, ref1, ref2);
1661 ok(ref3 == ref1,
"Test %u: expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n",
i, ref1, ref3);
1663 ok(ref4 == ref1,
"Test %u: expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n",
i, ref1, ref4);
1671 if (
tests[
i].takes_d3drm_ref)
1672 ok(ref2 > ref1,
"Test %u: expected ref2 > ref1, got ref1 = %u, ref2 = %u.\n",
i, ref1, ref2);
1674 ok(ref2 == ref1,
"Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n",
i, ref1, ref2);
1676 ok(ref3 == ref1,
"Test %u: expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n",
i, ref1, ref3);
1678 ok(ref4 == ref1,
"Test %u: expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n",
i, ref1, ref4);
1681 ok(ref2 == ref1,
"Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n",
i, ref1, ref2);
1683 ok(ref3 == ref1,
"Test %u: expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n",
i, ref1, ref3);
1685 ok(ref4 == ref1,
"Test %u: expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n",
i, ref1, ref4);
1690 if (
tests[
i].takes_d3drm_ref)
1691 ok(ref2 > ref1,
"Test %u: expected ref2 > ref1, got ref1 = %u, ref2 = %u.\n",
i, ref1, ref2);
1693 ok(ref2 == ref1,
"Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n",
i, ref1, ref2);
1695 ok(ref3 == ref1,
"Test %u: expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n",
i, ref1, ref3);
1697 ok(ref4 == ref1,
"Test %u: expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n",
i, ref1, ref4);
1700 ok(ref2 == ref1,
"Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n",
i, ref1, ref2);
1702 ok(ref3 == ref1,
"Test %u: expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n",
i, ref1, ref3);
1704 ok(ref4 == ref1,
"Test %u: expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n",
i, ref1, ref4);
1715 IDirect3DRMFrame3 *frame3, *d3drm_frame3, *tmp_frame3;
1716 IDirect3DRMFrame *frame, *
d3drm_frame, *tmp_frame1;
1718 IDirectDrawClipper *clipper;
1720 IDirect3DRM *d3drm1;
1721 IDirect3DRM2 *d3drm2;
1722 IDirect3DRM3 *d3drm3;
1723 IDirect3DRMDevice *device1, *d3drm_device1;
1724 IDirect3DRMDevice3 *device3, *d3drm_device3;
1725 IDirect3DRMViewport *viewport;
1726 IDirect3DRMViewport2 *viewport2;
1730 IDirect3DRMObject *
obj, *obj2;
1735 DWORD initial_ref1, initial_ref2, initial_ref3, device_ref, frame_ref, frame_ref2, viewport_ref;
1741 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRM interface (hr = %x)\n",
hr);
1743 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRM2 interface (hr = %#x).\n",
hr);
1745 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRM3 interface (hr = %#x).\n",
hr);
1751 ok(
hr ==
DD_OK,
"Cannot get IDirectDrawClipper interface (hr = %x)\n",
hr);
1753 hr = IDirectDrawClipper_SetHWnd(clipper, 0,
window);
1754 ok(
hr ==
DD_OK,
"Cannot set HWnd to Clipper (hr = %x)\n",
hr);
1758 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRMDevice interface (hr = %x)\n",
hr);
1760 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMDevice interface (hr = %#x).\n",
hr);
1763 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRMFrame interface (hr = %x)\n",
hr);
1767 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMFrame3 interface (hr = %x).\n",
hr);
1778 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMViewport interface (hr = %#x)\n",
hr);
1780 ok(ref4 > ref1,
"Expected ref4 > ref1, got ref1 = %u, ref4 = %u.\n", ref1, ref4);
1782 ok(ref4 == ref2,
"Expected ref4 == ref2, got ref2 = %u, ref4 = %u.\n", ref2, ref4);
1784 ok(ref4 == ref3,
"Expected ref4 == ref3, got ref3 = %u, ref4 = %u.\n", ref3, ref4);
1786 ok(ref4 == device_ref,
"Expected ref4 == device_ref, got device_ref = %u, ref4 = %u.\n", device_ref, ref4);
1788 ok(ref4 > frame_ref,
"Expected ref4 > frame_ref, got frame_ref = %u, ref4 = %u.\n", frame_ref, ref4);
1791 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMDevice interface (hr = %x)\n",
hr);
1792 ok(device1 == d3drm_device1,
"Expected device returned = %p, got %p.\n", device1, d3drm_device1);
1811 ok(ref4 == ref1,
"Expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", ref1, ref4);
1813 ok(ref4 == ref2,
"Expected ref4 == ref2, got ref2 = %u, ref4 = %u.\n", ref2, ref4);
1815 ok(ref4 == ref3,
"Expected ref4 == ref3, got ref3 = %u, ref4 = %u.\n", ref3, ref4);
1817 ok(ref4 == device_ref,
"Expected ref4 == device_ref, got device_ref = %u, ref4 = %u.\n", device_ref, ref4);
1819 ok(ref4 == frame_ref,
"Expected ref4 == frame_ref, got frame_ref = %u, ref4 = %u.\n", frame_ref, ref4);
1822 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMViewport interface (hr = %#x)\n",
hr);
1824 ok(ref4 > ref1,
"Expected ref4 > ref1, got ref1 = %u, ref4 = %u.\n", ref1, ref4);
1826 ok(ref4 == ref2,
"Expected ref4 == ref2, got ref2 = %u, ref4 = %u.\n", ref2, ref4);
1828 ok(ref4 == ref3,
"Expected ref4 == ref3, got ref3 = %u, ref4 = %u.\n", ref3, ref4);
1830 ok(ref4 == device_ref,
"Expected ref4 == device_ref, got device_ref = %u, ref4 = %u.\n", device_ref, ref4);
1832 ok(ref4 > frame_ref,
"Expected ref4 > frame_ref, got frame_ref = %u, ref4 = %u.\n", frame_ref, ref4);
1835 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMDevice interface (hr = %x)\n",
hr);
1836 ok(device1 == d3drm_device1,
"Expected device returned = %p, got %p.\n", device1, d3drm_device1);
1855 ok(ref4 == ref1,
"Expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", ref1, ref4);
1857 ok(ref4 == ref2,
"Expected ref4 == ref2, got ref2 = %u, ref4 = %u.\n", ref2, ref4);
1859 ok(ref4 == ref3,
"Expected ref4 == ref3, got ref3 = %u, ref4 = %u.\n", ref3, ref4);
1861 ok(ref4 == device_ref,
"Expected ref4 == device_ref, got device_ref = %u, ref4 = %u.\n", device_ref, ref4);
1863 ok(ref4 == frame_ref,
"Expected ref4 == frame_ref, got frame_ref = %u, ref4 = %u.\n", frame_ref, ref4);
1869 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMViewport2 interface (hr = %#x)\n",
hr);
1871 ok(ref4 > ref1,
"Expected ref4 > ref1, got ref1 = %u, ref4 = %u.\n", ref1, ref4);
1873 ok(ref4 == ref2,
"Expected ref4 == ref2, got ref2 = %u, ref4 = %u.\n", ref2, ref4);
1875 ok(ref4 == ref3,
"Expected ref4 == ref3, got ref3 = %u, ref4 = %u.\n", ref3, ref4);
1877 ok(ref4 == device_ref,
"Expected ref4 == device_ref, got device_ref = %u, ref4 = %u.\n", device_ref, ref4);
1879 ok(ref4 > frame_ref2,
"Expected ref4 > frame_ref2, got frame_ref2 = %u, ref4 = %u.\n", frame_ref2, ref4);
1882 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMDevice3 interface (hr = %x)\n",
hr);
1883 ok(device3 == d3drm_device3,
"Expected device returned = %p, got %p.\n", device3, d3drm_device3);
1890 ok(frame3 == d3drm_frame3,
"Expected frame returned = %p, got %p.\n", frame3, d3drm_frame3);
1897 ok(d3drm_frame3 == tmp_frame3,
"Got unexpected frame %p, expected %p.\n", d3drm_frame3, tmp_frame3);
1902 ok(ref4 == ref1,
"Expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", ref1, ref4);
1904 ok(ref4 == ref2,
"Expected ref4 == ref2, got ref2 = %u, ref4 = %u.\n", ref2, ref4);
1906 ok(ref4 == ref3,
"Expected ref4 == ref3, got ref3 = %u, ref4 = %u.\n", ref3, ref4);
1908 ok(ref4 == device_ref,
"Expected ref4 == device_ref, got device_ref = %u, ref4 = %u.\n", device_ref, ref4);
1910 ok(ref4 == frame_ref2,
"Expected ref4 == frame_ref2, got frame_ref2 = %u, ref4 = %u.\n", frame_ref2, ref4);
1913 viewport = (IDirect3DRMViewport *)0xdeadbeef;
1916 ok(!viewport,
"Expected viewport returned == NULL, got %p.\n", viewport);
1917 viewport = (IDirect3DRMViewport *)0xdeadbeef;
1920 ok(!viewport,
"Expected viewport returned == NULL, got %p.\n", viewport);
1921 viewport = (IDirect3DRMViewport *)0xdeadbeef;
1924 ok(!viewport,
"Expected viewport returned == NULL, got %p.\n", viewport);
1925 viewport = (IDirect3DRMViewport *)0xdeadbeef;
1928 ok(!viewport,
"Expected viewport returned == NULL, got %p.\n", viewport);
1929 viewport = (IDirect3DRMViewport *)0xdeadbeef;
1932 ok(!viewport,
"Expected viewport returned == NULL, got %p.\n", viewport);
1936 viewport = (IDirect3DRMViewport *)0xdeadbeef;
1939 ok(!viewport,
"Expected viewport returned == NULL, got %p.\n", viewport);
1940 viewport = (IDirect3DRMViewport *)0xdeadbeef;
1943 ok(!viewport,
"Expected viewport returned == NULL, got %p.\n", viewport);
1944 viewport = (IDirect3DRMViewport *)0xdeadbeef;
1947 ok(!viewport,
"Expected viewport returned == NULL, got %p.\n", viewport);
1948 viewport = (IDirect3DRMViewport *)0xdeadbeef;
1951 ok(!viewport,
"Expected viewport returned == NULL, got %p.\n", viewport);
1952 viewport = (IDirect3DRMViewport *)0xdeadbeef;
1955 ok(!viewport,
"Expected viewport returned == NULL, got %p.\n", viewport);
1959 viewport2 = (IDirect3DRMViewport2 *)0xdeadbeef;
1962 ok(!viewport2,
"Expected viewport returned == NULL, got %p.\n", viewport2);
1963 viewport2 = (IDirect3DRMViewport2 *)0xdeadbeef;
1966 ok(!viewport2,
"Expected viewport returned == NULL, got %p.\n", viewport2);
1967 viewport2 = (IDirect3DRMViewport2 *)0xdeadbeef;
1970 ok(!viewport2,
"Expected viewport returned == NULL, got %p.\n", viewport2);
1971 viewport2 = (IDirect3DRMViewport2 *)0xdeadbeef;
1974 ok(!viewport2,
"Expected viewport returned == NULL, got %p.\n", viewport2);
1975 viewport2 = (IDirect3DRMViewport2 *)0xdeadbeef;
1978 ok(!viewport2,
"Expected viewport returned == NULL, got %p.\n", viewport2);
1983 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRMViewport interface (hr = %#x)\n",
hr);
1985 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DViewport interface (hr = %#x).\n",
hr);
1988 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DViewport interface (hr = %#x).\n",
hr);
1990 ok(ref4 > viewport_ref,
"Expected ref4 > viewport_ref, got ref4 = %u, viewport_ref = %u.\n", ref4, viewport_ref);
1993 ok(ref4 == viewport_ref,
"Expected ref4 == viewport_ref, got ref4 = %u, viewport_ref = %u.\n", ref4, viewport_ref);
1997 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DViewport interface (hr = %#x).\n",
hr);
2003 ok(vp.
dwX == rc.
left,
"Expected viewport X position = %u, got %u.\n", rc.
left, vp.
dwX);
2004 ok(vp.
dwY == rc.
top,
"Expected viewport Y position = %u, got %u.\n", rc.
top, vp.
dwY);
2006 ok(vp.
dvScaleX == expected_val,
"Expected dvScaleX = %f, got %f.\n", expected_val, vp.
dvScaleX);
2007 ok(vp.
dvScaleY == expected_val,
"Expected dvScaleY = %f, got %f.\n", expected_val, vp.
dvScaleY);
2009 ok(vp.
dvMaxX == expected_val,
"Expected dvMaxX = %f, got %f.\n", expected_val, vp.
dvMaxX);
2011 ok(vp.
dvMaxY == expected_val,
"Expected dvMaxY = %f, got %f.\n", expected_val, vp.
dvMaxY);
2016 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRMViewport2 interface (hr = %#x)\n",
hr);
2018 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DViewport interface (hr = %#x).\n",
hr);
2021 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DViewport interface (hr = %#x).\n",
hr);
2023 ok(ref4 > viewport_ref,
"Expected ref4 > viewport_ref, got ref4 = %u, viewport_ref = %u.\n", ref4, viewport_ref);
2026 ok(ref4 == viewport_ref,
"Expected ref4 == viewport_ref, got ref4 = %u, viewport_ref = %u.\n", ref4, viewport_ref);
2030 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DViewport interface (hr = %#x).\n",
hr);
2036 ok(vp.
dwX == rc.
left,
"Expected viewport X position = %u, got %u.\n", rc.
left, vp.
dwX);
2037 ok(vp.
dwY == rc.
top,
"Expected viewport Y position = %u, got %u.\n", rc.
top, vp.
dwY);
2039 ok(vp.
dvScaleX == expected_val,
"Expected dvScaleX = %f, got %f.\n", expected_val, vp.
dvScaleX);
2040 ok(vp.
dvScaleY == expected_val,
"Expected dvScaleY = %f, got %f.\n", expected_val, vp.
dvScaleY);
2042 ok(vp.
dvMaxX == expected_val,
"Expected dvMaxX = %f, got %f.\n", expected_val, vp.
dvMaxX);
2044 ok(vp.
dvMaxY == expected_val,
"Expected dvMaxY = %f, got %f.\n", expected_val, vp.
dvMaxY);
2049 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRMViewport interface (hr = %x)\n",
hr);
2051 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DViewport interface (hr = %#x).\n",
hr);
2054 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DViewport interface (hr = %#x).\n",
hr);
2056 ok(ref4 > viewport_ref,
"Expected ref4 > viewport_ref, got ref4 = %u, viewport_ref = %u.\n", ref4, viewport_ref);
2059 ok(ref4 == viewport_ref,
"Expected ref4 == viewport_ref, got ref4 = %u, viewport_ref = %u.\n", ref4, viewport_ref);
2063 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DViewport interface (hr = %#x).\n",
hr);
2069 ok(vp.
dwX == rc.
left,
"Expected viewport X position = %u, got %u.\n", rc.
left, vp.
dwX);
2070 ok(vp.
dwY == rc.
top,
"Expected viewport Y position = %u, got %u.\n", rc.
top, vp.
dwY);
2072 ok(vp.
dvScaleX == expected_val,
"Expected dvScaleX = %f, got %f.\n", expected_val, vp.
dvScaleX);
2073 ok(vp.
dvScaleY == expected_val,
"Expected dvScaleY = %f, got %f.\n", expected_val, vp.
dvScaleY);
2075 ok(vp.
dvMaxX == expected_val,
"Expected dvMaxX = %f, got %f.\n", expected_val, vp.
dvMaxX);
2077 ok(vp.
dvMaxY == expected_val,
"Expected dvMaxY = %f, got %f.\n", expected_val, vp.
dvMaxY);
2082 ok((IDirect3DRMObject*)viewport ==
obj,
"got object pointer %p, expected %p\n",
obj, viewport);
2089 ok(
obj == obj2,
"got object pointer %p, expected %p\n", obj2,
obj);
2090 ok((
IUnknown*)viewport != (
IUnknown*)viewport2,
"got viewport1 %p, viewport2 %p\n", viewport, viewport2);
2125 (
void **)&viewport);
2126 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMViewport interface (hr = %#x).\n",
hr);
2128 ok(ref4 == ref1,
"Expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", ref1, ref4);
2130 ok(ref4 == ref2,
"Expected ref4 == ref2, got ref2 = %u, ref4 = %u.\n", ref2, ref4);
2132 ok(ref4 == ref3,
"Expected ref4 == ref3, got ref3 = %u, ref4 = %u.\n", ref3, ref4);
2141 ok(
field == -1.0f,
"Got unexpected field %.8e.\n",
field);
2145 ok(
left == 10.0f,
"Got unexpected left %.8e.\n",
left);
2146 ok(
right == 10.0f,
"Got unexpected right %.8e.\n",
right);
2148 ok(
top == 10.0f,
"Got unexpected top %.8e.\n",
top);
2150 ok(
front == -1.0f,
"Got unexpected front %.8e\n",
front);
2152 ok(back == -1.0f,
"Got unexpected back %.8e\n", back);
2180 ok(
SUCCEEDED(
hr),
"Cannot initialize IDirect3DRMViewport interface (hr = %#x).\n",
hr);
2182 ok(ref4 > ref1,
"Expected ref4 > ref1, got ref1 = %u, ref4 = %u.\n", ref1, ref4);
2184 ok(ref4 == ref2,
"Expected ref4 == ref2, got ref2 = %u, ref4 = %u.\n", ref2, ref4);
2186 ok(ref4 == ref3,
"Expected ref4 == ref3, got ref3 = %u, ref4 = %u.\n", ref3, ref4);
2188 ok(ref4 == device_ref,
"Expected ref4 == device_ref, got device_ref = %u, ref4 = %u.\n", device_ref, ref4);
2190 ok(ref4 > frame_ref,
"Expected ref4 > frame_ref, got frame_ref = %u, ref4 = %u.\n", frame_ref, ref4);
2193 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMDevice3 interface (hr = %x)\n",
hr);
2194 ok(device1 == d3drm_device1,
"Expected device returned = %p, got %p.\n", device3, d3drm_device3);
2198 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DViewport interface (hr = %#x).\n",
hr);
2201 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DViewport interface (hr = %#x).\n",
hr);
2203 ok(ref4 > viewport_ref,
"Expected ref4 > viewport_ref, got ref4 = %u, viewport_ref = %u.\n", ref4, viewport_ref);
2206 ok(ref4 == viewport_ref,
"Expected ref4 == viewport_ref, got ref4 = %u, viewport_ref = %u.\n", ref4, viewport_ref);
2210 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DViewport interface (hr = %#x).\n",
hr);
2216 ok(vp.
dwX == rc.
left,
"Expected viewport X position = %u, got %u.\n", rc.
left, vp.
dwX);
2217 ok(vp.
dwY == rc.
top,
"Expected viewport Y position = %u, got %u.\n", rc.
top, vp.
dwY);
2219 ok(vp.
dvScaleX == expected_val,
"Expected dvScaleX = %f, got %f.\n", expected_val, vp.
dvScaleX);
2220 ok(vp.
dvScaleY == expected_val,
"Expected dvScaleY = %f, got %f.\n", expected_val, vp.
dvScaleY);
2222 ok(vp.
dvMaxX == expected_val,
"Expected dvMaxX = %f, got %f.\n", expected_val, vp.
dvMaxX);
2224 ok(vp.
dvMaxY == expected_val,
"Expected dvMaxY = %f, got %f.\n", expected_val, vp.
dvMaxY);
2228 ok(
field == 0.5f,
"Got unexpected field %.8e.\n",
field);
2231 ok(
left == -0.5f,
"Got unexpected left %.8e.\n",
left);
2232 ok(
right == 0.5f,
"Got unexpected right %.8e.\n",
right);
2234 ok(
top == 0.5f,
"Got unexpected top %.8e.\n",
top);
2236 ok(
front == 1.0f,
"Got unexpected front %.8e.\n",
front);
2238 ok(back == 100.0f,
"Got unexpected back %.8e.\n", back);
2243 ok(
field == 1.0f,
"Got unexpected field %.8e.\n",
field);
2246 ok(
left == -1.0f,
"Got unexpected left %.8e.\n",
left);
2247 ok(
right == 1.0f,
"Got unexpected right %.8e.\n",
right);
2249 ok(
top == 1.0f,
"Got unexpected top %.8e.\n",
top);
2254 ok(
field == -1.0f,
"Got unexpected field %.8e.\n",
field);
2257 ok(
left == 5.0f,
"Got unexpected left %.8e.\n",
left);
2258 ok(
right == 3.0f,
"Got unexpected right %.8e.\n",
right);
2260 ok(
top == 0.0f,
"Got unexpected top %.8e.\n",
top);
2264 ok(
front == 2.0f,
"Got unexpected front %.8e.\n",
front);
2268 ok(back == 200.0f,
"Got unexpected back %.8e.\n", back);
2294 todo_wine ok(ref4 > ref1,
"Expected ref4 > ref1, got ref1 = %u, ref4 = %u.\n", ref1, ref4);
2296 ok(ref4 == ref2,
"Expected ref4 == ref2, got ref2 = %u, ref4 = %u.\n", ref2, ref4);
2298 ok(ref4 == ref3,
"Expected ref4 == ref3, got ref3 = %u, ref4 = %u.\n", ref3, ref4);
2300 ok(ref4 == device_ref,
"Expected ref4 == device_ref, got device_ref = %u, ref4 = %u.\n", device_ref, ref4);
2302 todo_wine ok(ref4 > frame_ref,
"Expected ref4 > frame_ref, got frame_ref = %u, ref4 = %u.\n", frame_ref, ref4);
2308 (
void **)&viewport2);
2309 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMViewport2 interface (hr = %#x).\n",
hr);
2311 ok(ref4 == ref1,
"Expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", ref1, ref4);
2313 ok(ref4 == ref2,
"Expected ref4 == ref2, got ref2 = %u, ref4 = %u.\n", ref2, ref4);
2315 ok(ref4 == ref3,
"Expected ref4 == ref3, got ref3 = %u, ref4 = %u.\n", ref3, ref4);
2324 ok(
field == -1.0f,
"Got unexpected field %.8e.\n",
field);
2328 ok(
left == 10.0f,
"Got unexpected left %.8e.\n",
left);
2329 ok(
right == 10.0f,
"Got unexpected right %.8e.\n",
right);
2331 ok(
top == 10.0f,
"Got unexpected top %.8e.\n",
top);
2333 ok(
front == -1.0f,
"Got unexpected front %.8e\n",
front);
2335 ok(back == -1.0f,
"Got unexpected back %.8e\n", back);
2362 ok(
SUCCEEDED(
hr),
"Cannot initialize IDirect3DRMViewport2 interface (hr = %#x).\n",
hr);
2364 ok(ref4 == device_ref,
"Expected ref4 == device_ref, got device_ref = %u, ref4 = %u.\n", device_ref, ref4);
2366 ok(ref4 > frame_ref2,
"Expected ref4 > frame_ref2, got frame_ref2 = %u, ref4 = %u.\n", frame_ref2, ref4);
2369 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMDevice3 interface (hr = %x)\n",
hr);
2370 ok(device3 == d3drm_device3,
"Expected device returned = %p, got %p.\n", device3, d3drm_device3);
2374 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DViewport interface (hr = %#x).\n",
hr);
2377 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DViewport interface (hr = %#x).\n",
hr);
2379 ok(ref4 > viewport_ref,
"Expected ref4 > viewport_ref, got ref4 = %u, viewport_ref = %u.\n", ref4, viewport_ref);
2382 ok(ref4 == viewport_ref,
"Expected ref4 == viewport_ref, got ref4 = %u, viewport_ref = %u.\n", ref4, viewport_ref);
2386 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DViewport interface (hr = %#x).\n",
hr);
2392 ok(vp.
dwX == rc.
left,
"Expected viewport X position = %u, got %u.\n", rc.
left, vp.
dwX);
2393 ok(vp.
dwY == rc.
top,
"Expected viewport Y position = %u, got %u.\n", rc.
top, vp.
dwY);
2395 ok(vp.
dvScaleX == expected_val,
"Expected dvScaleX = %f, got %f.\n", expected_val, vp.
dvScaleX);
2396 ok(vp.
dvScaleY == expected_val,
"Expected dvScaleY = %f, got %f.\n", expected_val, vp.
dvScaleY);
2398 ok(vp.
dvMaxX == expected_val,
"Expected dvMaxX = %f, got %f.\n", expected_val, vp.
dvMaxX);
2400 ok(vp.
dvMaxY == expected_val,
"Expected dvMaxY = %f, got %f.\n", expected_val, vp.
dvMaxY);
2404 ok(
field == 0.5f,
"Got unexpected field %.8e.\n",
field);
2407 ok(
left == -0.5f,
"Got unexpected left %.8e.\n",
left);
2408 ok(
right == 0.5f,
"Got unexpected right %.8e.\n",
right);
2410 ok(
top == 0.5f,
"Got unexpected top %.8e.\n",
top);
2412 ok(
front == 1.0f,
"Got unexpected front %.8e.\n",
front);
2414 ok(back == 100.0f,
"Got unexpected back %.8e.\n", back);
2419 ok(
field == 1.0f,
"Got unexpected field %.8e.\n",
field);
2422 ok(
left == -1.0f,
"Got unexpected left %.8e.\n",
left);
2423 ok(
right == 1.0f,
"Got unexpected right %.8e.\n",
right);
2425 ok(
top == 1.0f,
"Got unexpected top %.8e.\n",
top);
2430 ok(
field == -1.0f,
"Got unexpected field %.8e.\n",
field);
2433 ok(
left == 5.0f,
"Got unexpected left %.8e.\n",
left);
2434 ok(
right == 3.0f,
"Got unexpected right %.8e.\n",
right);
2436 ok(
top == 0.0f,
"Got unexpected top %.8e.\n",
top);
2440 ok(
front == 2.0f,
"Got unexpected front %.8e.\n",
front);
2444 ok(back == 200.0f,
"Got unexpected back %.8e.\n", back);
2470 todo_wine ok(ref4 > ref1,
"Expected ref4 > ref1, got ref1 = %u, ref4 = %u.\n", ref1, ref4);
2472 ok(ref4 == ref2,
"Expected ref4 == ref2, got ref2 = %u, ref4 = %u.\n", ref2, ref4);
2474 ok(ref4 == ref3,
"Expected ref4 == ref3, got ref3 = %u, ref4 = %u.\n", ref3, ref4);
2476 ok(ref4 == device_ref,
"Expected ref4 == device_ref, got device_ref = %u, ref4 = %u.\n", device_ref, ref4);
2478 todo_wine ok(ref4 > frame_ref2,
"Expected ref4 > frame_ref2, got frame_ref2 = %u, ref4 = %u.\n", frame_ref2, ref4);
2483 ok(ref4 > initial_ref1,
"Expected ref4 > initial_ref1, got initial_ref1 = %u, ref4 = %u.\n", initial_ref1, ref4);
2485 ok(ref4 == initial_ref2,
"Expected ref4 == initial_ref2, got initial_ref2 = %u, ref4 = %u.\n", initial_ref2, ref4);
2487 ok(ref4 == initial_ref3,
"Expected ref4 == initial_ref3, got initial_ref3 = %u, ref4 = %u.\n", initial_ref3, ref4);
2489 ok(ref4 == frame_ref,
"Expected ref4 == frame_ref, got frame_ref = %u, ref4 = %u.\n", frame_ref, ref4);
2491 ok(ref4 == frame_ref2,
"Expected ref4 == frame_ref2, got frame_ref2 = %u, ref4 = %u.\n", frame_ref2, ref4);
2496 ok(ref4 > initial_ref1,
"Expected ref4 > initial_ref1, got initial_ref1 = %u, ref4 = %u.\n", initial_ref1, ref4);
2498 ok(ref4 == initial_ref2,
"Expected ref4 == initial_ref2, got initial_ref2 = %u, ref4 = %u.\n", initial_ref2, ref4);
2500 ok(ref4 == initial_ref3,
"Expected ref4 == initial_ref3, got initial_ref3 = %u, ref4 = %u.\n", initial_ref3, ref4);
2505 ok(ref4 == initial_ref1,
"Expected ref4 == initial_ref1, got initial_ref1 = %u, ref4 = %u.\n", initial_ref1, ref4);
2507 ok(ref4 == initial_ref2,
"Expected ref4 == initial_ref2, got initial_ref2 = %u, ref4 = %u.\n", initial_ref2, ref4);
2509 ok(ref4 == initial_ref3,
"Expected ref4 == initial_ref3, got initial_ref3 = %u, ref4 = %u.\n", initial_ref3, ref4);
2510 IDirectDrawClipper_Release(clipper);
2520 IDirect3DRMObject *
object;
2523 IDirect3DRMLight *
light;
2528 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRM interface (hr = %x)\n",
hr);
2531 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRMLight interface (hr = %x)\n",
hr);
2570 IDirect3DRM3 *d3drm3;
2571 IDirect3DRMMaterial2 *material2;
2575 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRM interface (hr = %x)\n",
hr);
2579 win_skip(
"Cannot get IDirect3DRM3 interface (hr = %x), skipping tests\n",
hr);
2585 ok(
hr ==
D3DRM_OK,
"Cannot get IDirect3DRMMaterial2 interface (hr = %x)\n",
hr);
2591 ok(
r == 18.5f,
"wrong power (%f)\n",
r);
2595 ok(
r == 0.0f &&
g == 0.0f &&
b == 0.0f,
"wrong emissive r=%f g=%f b=%f, expected r=0.0 g=0.0 b=0.0\n",
r,
g,
b);
2599 ok(
r == 1.0f &&
g == 1.0f &&
b == 1.0f,
"wrong specular r=%f g=%f b=%f, expected r=1.0 g=1.0 b=1.0\n",
r,
g,
b);
2603 ok(
r == 0.0f &&
g == 0.0f &&
b == 0.0f,
"wrong ambient r=%f g=%f b=%f, expected r=0.0 g=0.0 b=0.0\n",
r,
g,
b);
2608 ok(
r == 5.87f,
"wrong power (%f)\n",
r);
2614 ok(
r == 0.5f &&
g == 0.5f &&
b == 0.5f,
"wrong emissive r=%f g=%f b=%f, expected r=0.5 g=0.5 b=0.5\n",
r,
g,
b);
2620 ok(
r == 0.6f &&
g == 0.6f &&
b == 0.6f,
"wrong specular r=%f g=%f b=%f, expected r=0.6 g=0.6 b=0.6\n",
r,
g,
b);
2626 ok(
r == 0.7f &&
g == 0.7f &&
b == 0.7f,
"wrong ambient r=%f g=%f b=%f, expected r=0.7 g=0.7 b=0.7\n",
r,
g,
b);
2637 IDirect3DRM *d3drm1;
2638 IDirect3DRM2 *d3drm2;
2639 IDirect3DRM3 *d3drm3;
2640 IDirect3DRMTexture *texture1;
2641 IDirect3DRMTexture2 *texture2;
2642 IDirect3DRMTexture3 *texture3;
2643 IDirectDrawSurface *surface;
2649 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000, 0,
NULL
2655 0x000000ff, 0x0000ff00, 0x00ff0000, 0, 0,
NULL
2659 DWORD pixel[4] = { 20000, 30000, 10000, 0 };
2660 ULONG ref1, ref2, ref3, ref4;
2663 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRM interface (hr = %x)\n",
hr);
2667 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRM2 interface (hr = %x).\n",
hr);
2670 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRM3 interface (hr = %x).\n",
hr);
2673 texture1 = (IDirect3DRMTexture *)0xdeadbeef;
2676 ok(!texture1,
"Expected texture returned == NULL, got %p.\n", texture1);
2680 texture2 = (IDirect3DRMTexture2 *)0xdeadbeef;
2683 ok(!texture2,
"Expected texture returned == NULL, got %p.\n", texture2);
2687 texture3 = (IDirect3DRMTexture3 *)0xdeadbeef;
2690 ok(!texture3,
"Expected texture returned == NULL, got %p.\n", texture3);
2696 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMTexture interface (hr = %#x)\n",
hr);
2698 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMTexture2 interface (hr = %#x)\n",
hr);
2700 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMTexture3 interface (hr = %#x)\n",
hr);
2706 testimg.palette = (
void *)0xdeadbeef;
2707 testimg.palette_size = 0x39;
2709 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMTexture interface (hr = %#x)\n",
hr);
2711 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMTexture2 interface (hr = %#x)\n",
hr);
2713 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMTexture3 interface (hr = %#x)\n",
hr);
2719 texture1 = (IDirect3DRMTexture *)0xdeadbeef;
2722 ok(!texture1,
"Expected texture == NULL, got %p.\n", texture1);
2723 texture2 = (IDirect3DRMTexture2 *)0xdeadbeef;
2726 ok(!texture2,
"Expected texture == NULL, got %p.\n", texture2);
2727 texture3 = (IDirect3DRMTexture3 *)0xdeadbeef;
2730 ok(!texture3,
"Expected texture == NULL, got %p.\n", texture3);
2766 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMTexture interface (hr = %#x)\n",
hr);
2768 ok(ref2 > ref1,
"expected ref2 > ref1, got ref1 = %u , ref2 = %u.\n", ref1, ref2);
2770 ok(ref3 == ref1,
"expected ref3 == ref1, got ref1 = %u , ref3 = %u.\n", ref1, ref3);
2772 ok(ref4 == ref1,
"expected ref4 == ref1, got ref1 = %u , ref4 = %u.\n", ref1, ref4);
2774 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMTexture2 interface (hr = %#x)\n",
hr);
2776 ok(ref2 > ref1 + 1,
"expected ref2 > (ref1 + 1), got ref1 = %u , ref2 = %u.\n", ref1, ref2);
2778 ok(ref3 == ref1,
"expected ref3 == ref1, got ref1 = %u , ref3 = %u.\n", ref1, ref3);
2780 ok(ref4 == ref1,
"expected ref4 == ref1, got ref1 = %u , ref4 = %u.\n", ref1, ref4);
2782 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMTexture3 interface (hr = %#x)\n",
hr);
2784 ok(ref2 > ref1 + 2,
"expected ref2 > (ref1 + 2), got ref1 = %u , ref2 = %u.\n", ref1, ref2);
2786 ok(ref3 == ref1,
"expected ref3 == ref1, got ref1 = %u , ref3 = %u.\n", ref1, ref3);
2788 ok(ref4 == ref1,
"expected ref4 == ref1, got ref1 = %u , ref4 = %u.\n", ref1, ref4);
2806 ok(!!d3drm_img,
"Failed to get image.\n");
2807 ok(d3drm_img == &initimg,
"Expected image returned == %p, got %p.\n", &initimg, d3drm_img);
2811 ok(ref2 - 2 == ref1,
"expected (ref2 - 2) == ref1, got ref1 = %u, ref2 = %u.\n", ref1, ref2);
2813 ok(ref3 == ref1,
"expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n", ref1, ref3);
2815 ok(ref4 == ref1,
"expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", ref1, ref4);
2819 ok(!!d3drm_img,
"Failed to get image.\n");
2820 ok(d3drm_img == &initimg,
"Expected image returned == %p, got %p.\n", &initimg, d3drm_img);
2824 ok(ref2 - 1 == ref1,
"expected (ref2 - 1) == ref1, got ref1 = %u, ref2 = %u.\n", ref1, ref2);
2826 ok(ref3 == ref1,
"expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n", ref1, ref3);
2828 ok(ref4 == ref1,
"expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", ref1, ref4);
2832 ok(!!d3drm_img,
"Failed to get image.\n");
2833 ok(d3drm_img == &initimg,
"Expected image returned == %p, got %p.\n", &initimg, d3drm_img);
2837 ok(ref2 == ref1,
"expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", ref1, ref2);
2839 ok(ref3 == ref1,
"expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n", ref1, ref3);
2841 ok(ref4 == ref1,
"expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", ref1, ref4);
2846 testimg.palette =
NULL;
2847 testimg.palette_size = 0;
2849 (
void **)&texture2);
2850 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMTexture2 interface (hr = %#x).\n",
hr);
2852 (
void **)&texture3);
2853 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMTexture3 interface (hr = %#x).\n",
hr);
2855 ok(
SUCCEEDED(
hr),
"Cannot initialize IDirect3DRMTexture2 interface (hr = %#x)\n",
hr);
2857 ok(
SUCCEEDED(
hr),
"Cannot initialize IDirect3DRMTexture3 interface (hr = %#x)\n",
hr);
2862 testimg.palette = (
void *)0xdeadbeef;
2863 testimg.palette_size = 0x39;
2865 (
void **)&texture2);
2866 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMTexture2 interface (hr = %#x).\n",
hr);
2868 (
void **)&texture3);
2869 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMTexture3 interface (hr = %#x).\n",
hr);
2871 ok(
SUCCEEDED(
hr),
"Cannot initialize IDirect3DRMTexture2 interface (hr = %#x)\n",
hr);
2873 ok(
SUCCEEDED(
hr),
"Cannot initialize IDirect3DRMTexture3 interface (hr = %#x)\n",
hr);
2878 (
void **)&texture2);
2879 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMTexture2 interface (hr = %#x).\n",
hr);
2884 ok(ref3 == ref2,
"expected ref3 == ref2, got ref2 = %u , ref3 = %u.\n", ref2, ref3);
2887 (
void **)&texture3);
2888 ok(
SUCCEEDED(
hr),
"Cannot get IDirect3DRMTexture3 interface (hr = %#x).\n",
hr);
2893 ok(ref3 == ref2,
"expected ref3 == ref2, got ref2 = %u , ref3 = %u.\n", ref2, ref3);