d3dx9: Test number of vertices for D3DXCreateSphere, retrieve vertex buffer.
Misha Koshelev
misha680 at gmail.com
Wed Jul 7 09:59:52 CDT 2010
---
dlls/d3dx9_36/tests/mesh.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c
index f3a629d..b747761 100644
--- a/dlls/d3dx9_36/tests/mesh.c
+++ b/dlls/d3dx9_36/tests/mesh.c
@@ -487,6 +487,9 @@ static void D3DXCreateSphereTest(void)
IDirect3DDevice9* device;
D3DPRESENT_PARAMETERS d3dpp;
ID3DXMesh* sphere = NULL;
+ DWORD number_of_vertices;
+ IDirect3DVertexBuffer9* vertex_buffer = NULL;
+ BYTE* vertex_data = NULL;
hr = D3DXCreateSphere(NULL, 0.0f, 0, 0, NULL, NULL);
todo_wine ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
@@ -533,7 +536,26 @@ static void D3DXCreateSphereTest(void)
todo_wine ok( hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n",hr);
if (sphere)
+ {
+ number_of_vertices = sphere->lpVtbl->GetNumVertices(sphere);
+ todo_wine ok( number_of_vertices == 4, "Got result %u, expected 4\n",number_of_vertices);
+
+ hr = sphere->lpVtbl->GetVertexBuffer(sphere, &vertex_buffer);
+ todo_wine ok( hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n",hr);
+
+ if (vertex_buffer)
+ {
+ /* Specify offset and size to avoid potential overruns */
+ hr = IDirect3DVertexBuffer9_Lock(vertex_buffer, 0, number_of_vertices * sizeof(D3DXVECTOR3) * 2, (LPVOID *)&vertex_data, D3DLOCK_DISCARD);
+ todo_wine ok( hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n",hr);
+
+ IDirect3DVertexBuffer9_Unlock(vertex_buffer);
+
+ IDirect3DVertexBuffer9_Release(vertex_buffer);
+ }
+
sphere->lpVtbl->Release(sphere);
+ }
IDirect3DDevice9_Release(device);
IDirect3D9_Release(d3d);
--
1.7.1
--=-ou1xPQ5wtqgvy0dE3mPu
Content-Type: application/x-trash; name="patch.old"
Content-Disposition: attachment; filename="patch.old"
Content-Transfer-Encoding: 7bit
More information about the wine-devel
mailing list