Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com
-- v3: d3drm/tests: Show Clear sets background color
From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- dlls/d3drm/tests/d3drm.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c index 3153f7191f4..f4fff867616 100644 --- a/dlls/d3drm/tests/d3drm.c +++ b/dlls/d3drm/tests/d3drm.c @@ -7121,6 +7121,15 @@ static void test_viewport_clear1(void) ok(compare_color(ret_color, 0x00ffffff, 1), "Got unexpected color 0x%08lx.\n", ret_color); CHECK_REFCOUNT(frame1, 1);
+ hr = IDirect3DRMFrame_SetSceneBackgroundRGB(frame1, 2.0f, 2.0f, 2.0f); + ok(SUCCEEDED(hr), "Cannot set scene background RGB, hr %#lx\n", hr); + + hr = IDirect3DRMViewport_Render(viewport1, frame1); + ok(SUCCEEDED(hr), "Cannot Render, hr %#lx\n", hr); + + ret_color = get_surface_color(surface, 320, 240); + ok(compare_color(ret_color, 0x00ffffff, 1), "Got unexpected color 0x%08lx.\n", ret_color); + hr = IDirect3DRMFrame_SetSceneBackgroundRGB(frame1, 0.0f, 0.0f, 1.0f); ok(SUCCEEDED(hr), "Cannot set scene background RGB, hr %#lx\n", hr); ret_color = IDirect3DRMFrame_GetSceneBackground(frame1); @@ -7326,6 +7335,15 @@ static void test_viewport_clear2(void) ok(compare_color(ret_color, 0x00ffffff, 1), "Got unexpected color 0x%08lx.\n", ret_color); CHECK_REFCOUNT(frame3, 1);
+ hr = IDirect3DRMFrame3_SetSceneBackgroundRGB(frame3, 2.0f, 2.0f, 2.0f); + ok(SUCCEEDED(hr), "Cannot set scene background RGB, hr %#lx\n", hr); + + hr = IDirect3DRMViewport2_Render(viewport2, frame3); + ok(SUCCEEDED(hr), "Cannot Render, hr %#lx\n", hr); + + ret_color = get_surface_color(surface, 320, 240); + ok(compare_color(ret_color, 0x00ffffff, 1), "Got unexpected color 0x%08lx.\n", ret_color); + hr = IDirect3DRMViewport2_GetDirect3DViewport(viewport2, &d3d_viewport); ok(SUCCEEDED(hr), "Cannot get IDirect3DViewport interface, hr %#lx.\n", hr);
Stefan D��singer (@stefan) commented about dlls/d3drm/tests/d3drm.c:
ok(compare_color(ret_color, 0x00ffffff, 1), "Got unexpected color 0x%08lx.\n", ret_color); CHECK_REFCOUNT(frame1, 1);
- hr = IDirect3DRMFrame_SetSceneBackgroundRGB(frame1, 2.0f, 2.0f, 2.0f);
Wouldn't that just do the same as color 1.0, 1.0, 1.0? If I understand d3drm_color_component right the color floats range from 0.0 to 1.0. No such thing as true floating point render targets in ddraw :-)
On Mon Jul 25 13:01:24 2022 +0000, Stefan D��singer wrote:
Wouldn't that just do the same as color 1.0, 1.0, 1.0? If I understand d3drm_color_component right the color floats range from 0.0 to 1.0. No such thing as true floating point render targets in ddraw :-)
Yeah, anything >1.0 gets clamped to 1.0 (full intensity). So this is white, and the surface is already white... a different color needs to be selected for verifying that Render does not clear the surface.