[PATCH] Test to know whether the top of a matrix stack is ALWAYS i=

=3D?utf-8?q?J=3DC3=3DA9r=3DC3=3DB4me=3D20Gardou?=3D=20 =3D?utf-8?q?J=3DC3=3DA9r=3DC3=3DB4me=3D20Gardou?=3D=20
Fri Oct 31 18:13:53 CDT 2008


dentity

---
 dlls/d3dx8/tests/math.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c
index f38ff26..9f5207a 100644
--- a/dlls/d3dx8/tests/math.c
+++ b/dlls/d3dx8/tests/math.c
@@ -1442,7 +1442,7 @@ static void test_matrix_stack(void)
=20
     hr =3D ID3DXMatrixStack_LoadMatrix(stack, NULL);
     ok(hr =3D=3D D3DERR_INVALIDCALL, "LoadMatrix returned %#x, expected D3=
DERR_INVALIDCALL\n", hr);
-
+   =20
     hr =3D ID3DXMatrixStack_LoadMatrix(stack, &mat1);
     ok(SUCCEEDED(hr), "LoadMatrix failed, hr %#x\n", hr);
     expect_mat(&mat1, ID3DXMatrixStack_GetTop(stack));
@@ -1479,6 +1479,19 @@ static void test_matrix_stack(void)
     ok(SUCCEEDED(hr), "Pop failed, hr %#x\n", hr);
     ok(D3DXMatrixIsIdentity(ID3DXMatrixStack_GetTop(stack)), "The top shou=
ld be an identity matrix\n");
=20
+    hr =3D ID3DXMatrixStack_MultMatrix(stack, &mat2) ;
+    ok(SUCCEEDED(hr), "Multiplication failed");
+    /* Identity * mat2 =3D mat2 */
+    expect_mat(&mat2, ID3DXMatrixStack_GetTop(stack)) ;
+   =20
+    hr =3D ID3DXMatrixStack_Push(stack);
+    ok(SUCCEEDED(hr), "Push failed, hr %#x\n", hr);
+   =20
+    hr =3D ID3DXMatrixStack_Pop(stack);
+    ok(SUCCEEDED(hr), "Pop failed, hr %#x\n", hr);
+    /* here we are on the bottom of the stack... is it always identity? */
+    ok(D3DXMatrixIsIdentity(ID3DXMatrixStack_GetTop(stack)), "The top shou=
ld be an identity matrix\n");
+
     refcount =3D ID3DXMatrixStack_Release(stack);
     ok(!refcount, "Matrix stack has %u references left.\n", refcount);
 }
--=20
1.5.4.3

=0A=0A=0A      
--0-59247195-1225560586=:75634
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<table cellspacing=3D"0" cellpadding=3D"0" border=3D"0" ><tr><td valign=3D"=
top" style=3D"font: inherit;">If you have a windows license, you can use a =
native d3dx8.dll to check your test. That is I do ;)<br>&nbsp;And as said h=
enri said, the result matix will be the previous. I had a test to prove it<=
br>David<br><br>--- En date de&nbsp;: <b>Sam 1.11.08, J=E9r=F4me Gardou <i>=
&lt;jerome.gardou at gmail.com&gt;</i></b> a =E9crit&nbsp;:<br><blockquote sty=
le=3D"border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-le=
ft: 5px;">De: J=E9r=F4me Gardou &lt;jerome.gardou at gmail.com&gt;<br>Objet: R=
e: D3DXMatrixstack: where to go....<br>=C0: "Henri Verbeet" &lt;hverbeet at gm=
ail.com&gt;<br>Cc: "wine-devel" &lt;wine-devel at winehq.org&gt;<br>Date: Same=
di 1 Novembre 2008, 0h17<br><br><pre>Henri Verbeet a =E9crit :<br>&gt; 2008=
/10/31 J=E9r=F4me Gardou &lt;jerome.gardou at gmail.com&gt;:<br>&gt;   <br>&gt=
;&gt; OK, patches will be sent soon. By the way, what if I call multiply on=
<br>a
 new<br>&gt;&gt; stack, the push, then pop ? Will the top matrix be identit=
y, or the<br>one with<br>&gt;&gt; which I multiplied the first time ?<br>&g=
t;&gt;<br>&gt;&gt; I guess this calls a testcase ...<br>&gt;&gt;<br>&gt;&gt=
;     <br>&gt; I think it should return the result of the multiplication, b=
ut tests<br>&gt; wouldn't hurt, of course.<br>&gt;<br>&gt;   <br>I think th=
is should return identity...<br>Anyway, could someone try this one on a nat=
ive installation ?<br></pre>From b4c72e5e0737d6fa98f352765298bbc5f86d390a M=
on Sep 17 00:00:00 2001
From: =3D?utf-8?q?J=3DC3=3DA9r=3DC3=3DB4me=3D20Gardou?=3D <jerome.gardou at la=
poste.net>
Date: Sat, 1 Nov 2008 00:13:53 +0100
Subject: [PATCH] Test to know whether the top of a matrix stack is ALWAYS i=
dentity

---
 dlls/d3dx8/tests/math.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c
index f38ff26..9f5207a 100644
--- a/dlls/d3dx8/tests/math.c
+++ b/dlls/d3dx8/tests/math.c
@@ -1442,7 +1442,7 @@ static void test_matrix_stack(void)
=20
     hr =3D ID3DXMatrixStack_LoadMatrix(stack, NULL);
     ok(hr =3D=3D D3DERR_INVALIDCALL, "LoadMatrix returned %#x, expected D3=
DERR_INVALIDCALL\n", hr);
-
+   =20
     hr =3D ID3DXMatrixStack_LoadMatrix(stack, &amp;mat1);
     ok(SUCCEEDED(hr), "LoadMatrix failed, hr %#x\n", hr);
     expect_mat(&amp;mat1, ID3DXMatrixStack_GetTop(stack));
@@ -1479,6 +1479,19 @@ static void test_matrix_stack(void)
     ok(SUCCEEDED(hr), "Pop failed, hr %#x\n", hr);
     ok(D3DXMatrixIsIdentity(ID3DXMatrixStack_GetTop(stack)), "The top shou=
ld be an identity matrix\n");
=20
+    hr =3D ID3DXMatrixStack_MultMatrix(stack, &amp;mat2) ;
+    ok(SUCCEEDED(hr), "Multiplication failed");
+    /* Identity * mat2 =3D mat2 */
+    expect_mat(&amp;mat2, ID3DXMatrixStack_GetTop(stack)) ;
+   =20
+    hr =3D ID3DXMatrixStack_Push(stack);
+    ok(SUCCEEDED(hr), "Push failed, hr %#x\n", hr);
+   =20
+    hr =3D ID3DXMatrixStack_Pop(stack);
+    ok(SUCCEEDED(hr), "Pop failed, hr %#x\n", hr);
+    /* here we are on the bottom of the stack... is it always identity? */
+    ok(D3DXMatrixIsIdentity(ID3DXMatrixStack_GetTop(stack)), "The top shou=
ld be an identity matrix\n");
+
     refcount =3D ID3DXMatrixStack_Release(stack);
     ok(!refcount, "Matrix stack has %u references left.\n", refcount);
 }
--=20
1.5.4.3

<pre></pre></jerome.gardou at laposte.net></blockquote></td></tr></table><br>=
=0A=0A=0A=0A      
--0-59247195-1225560586=:75634--



More information about the wine-devel mailing list