2 * Copyright 2010 Christian Costa
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "wine/test.h"
22 static const char effect_desc[] =
27 static void test_create_effect(IDirect3DDevice9* device)
32 hr = D3DXCreateEffect(NULL, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL, NULL);
33 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
35 hr = D3DXCreateEffect(device, NULL, 0, NULL, NULL, 0, NULL, NULL, NULL);
36 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
38 hr = D3DXCreateEffect(device, effect_desc, 0, NULL, NULL, 0, NULL, NULL, NULL);
39 ok(hr == E_FAIL, "Got result %x, expected %x (D3DXERR_INVALIDDATA)\n", hr, E_FAIL);
41 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL, NULL);
42 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
44 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, &effect, NULL);
45 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
47 effect->lpVtbl->Release(effect);
50 static void test_create_effect_pool(void)
53 ID3DXEffectPool* pool;
55 hr = D3DXCreateEffectPool(NULL);
56 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
58 hr = D3DXCreateEffectPool(&pool);
59 ok(hr == S_OK, "Got result %x, expected 0 (S_OK)\n", hr);
61 pool->lpVtbl->Release(pool);
68 IDirect3DDevice9* device;
69 D3DPRESENT_PARAMETERS d3dpp;
72 wnd = CreateWindow("static", "d3dx9_test", 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
73 d3d = Direct3DCreate9(D3D_SDK_VERSION);
75 skip("Couldn't create application window\n");
79 skip("Couldn't create IDirect3D9 object\n");
84 ZeroMemory(&d3dpp, sizeof(d3dpp));
85 d3dpp.Windowed = TRUE;
86 d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
87 hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &device);
89 skip("Failed to create IDirect3DDevice9 object %#x\n", hr);
90 IDirect3D9_Release(d3d);
95 test_create_effect(device);
96 test_create_effect_pool();
98 IDirect3DDevice9_Release(device);
99 IDirect3D9_Release(d3d);