Release 1.3.7.
[wine/gsoc-2012-control.git] / dlls / d3dx9_36 / tests / line.c
blob56bc7f63f5b8a44db970f1e9de36e649c7fb9588
1 /*
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"
20 #include "d3dx9.h"
22 static void test_create_line(IDirect3DDevice9* device)
24 HRESULT hr;
25 LPD3DXLINE line = NULL;
27 hr = D3DXCreateLine(NULL, &line);
28 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
30 hr = D3DXCreateLine(device, NULL);
31 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
33 hr = D3DXCreateLine(device, &line);
34 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
36 if (line)
37 ID3DXLine_Release(line);
40 START_TEST(line)
42 HWND wnd;
43 IDirect3D9* d3d;
44 IDirect3DDevice9* device;
45 D3DPRESENT_PARAMETERS d3dpp;
46 HRESULT hr;
48 wnd = CreateWindow("static", "d3dx9_test", 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
49 d3d = Direct3DCreate9(D3D_SDK_VERSION);
50 if (!wnd) {
51 skip("Couldn't create application window\n");
52 return;
54 if (!d3d) {
55 skip("Couldn't create IDirect3D9 object\n");
56 DestroyWindow(wnd);
57 return;
60 ZeroMemory(&d3dpp, sizeof(d3dpp));
61 d3dpp.Windowed = TRUE;
62 d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
63 hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &device);
64 if (FAILED(hr)) {
65 skip("Failed to create IDirect3DDevice9 object %#x\n", hr);
66 IDirect3D9_Release(d3d);
67 DestroyWindow(wnd);
68 return;
71 test_create_line(device);
73 IDirect3DDevice9_Release(device);
74 IDirect3D9_Release(d3d);
75 DestroyWindow(wnd);