d3drm: Implement IDirect3DRMTextureX_GetClassName.

This commit is contained in:
André Hentschel 2012-06-17 15:39:36 +02:00 committed by Alexandre Julliard
parent b2de41308e
commit e5de199289
2 changed files with 54 additions and 4 deletions

View File

@ -1041,6 +1041,45 @@ static void test_Material2(void)
IDirect3DRM_Release(pD3DRM);
}
static void test_Texture(void)
{
HRESULT hr;
LPDIRECT3DRM pD3DRM;
LPDIRECT3DRMTEXTURE pTexture;
D3DRMIMAGE initimg = {
2, 2, 1, 1, 32,
TRUE, 2 * sizeof(DWORD), NULL, NULL,
0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000, 0, NULL
};
DWORD pixel[4] = { 20000, 30000, 10000, 0 };
DWORD size;
CHAR cname[64] = {0};
hr = pDirect3DRMCreate(&pD3DRM);
ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr);
initimg.buffer1 = &pixel;
hr = IDirect3DRM_CreateTexture(pD3DRM, &initimg, &pTexture);
ok(hr == D3DRM_OK, "Cannot get IDirect3DRMTexture interface (hr = %x)\n", hr);
hr = IDirect3DRMTexture_GetClassName(pTexture, NULL, cname);
ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr);
hr = IDirect3DRMTexture_GetClassName(pTexture, NULL, NULL);
ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr);
size = 1;
hr = IDirect3DRMTexture_GetClassName(pTexture, &size, cname);
ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr);
size = sizeof(cname);
hr = IDirect3DRMTexture_GetClassName(pTexture, &size, cname);
ok(hr == D3DRM_OK, "Cannot get classname (hr = %x)\n", hr);
ok(size == sizeof("Texture"), "wrong size: %u\n", size);
ok(!strcmp(cname, "Texture"), "Expected cname to be \"Texture\", but got \"%s\"\n", cname);
IDirect3DRMTexture_Release(pTexture);
IDirect3DRM_Release(pD3DRM);
}
static void test_frame_transform(void)
{
HRESULT hr;
@ -1108,6 +1147,7 @@ START_TEST(d3drm)
test_Frame();
test_Light();
test_Material2();
test_Texture();
test_frame_transform();
test_d3drm_load();

View File

@ -160,9 +160,11 @@ static HRESULT WINAPI IDirect3DRMTexture2Impl_GetName(IDirect3DRMTexture2* iface
static HRESULT WINAPI IDirect3DRMTexture2Impl_GetClassName(IDirect3DRMTexture2* iface,
LPDWORD size, LPSTR name)
{
FIXME("(%p)->(%p, %p): stub\n", iface, size, name);
IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
return E_NOTIMPL;
TRACE("(%p/%p)->(%p, %p)\n", iface, This, size, name);
return IDirect3DRMTexture3_GetClassName(&This->IDirect3DRMTexture3_iface, size, name);
}
/*** IDirect3DRMTexture3 methods ***/
@ -522,9 +524,17 @@ static HRESULT WINAPI IDirect3DRMTexture3Impl_GetName(IDirect3DRMTexture3* iface
static HRESULT WINAPI IDirect3DRMTexture3Impl_GetClassName(IDirect3DRMTexture3* iface,
LPDWORD size, LPSTR name)
{
FIXME("(%p)->(%p, %p): stub\n", iface, size, name);
IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
return E_NOTIMPL;
TRACE("(%p/%p)->(%p, %p)\n", iface, This, size, name);
if (!size || *size < strlen("Texture") || !name)
return E_INVALIDARG;
strcpy(name, "Texture");
*size = sizeof("Texture");
return D3DRM_OK;
}
/*** IDirect3DRMTexture3 methods ***/