comctl32/tests: Remove variable hwndheader which is not really used from test_items.
[wine.git] / dlls / d3dx9_36 / line.c
blob5ce98e67ad956ccd736862928960a70058229ded
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
20 #include "wine/debug.h"
21 #include "d3dx9_36_private.h"
23 WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
25 static const struct ID3DXLineVtbl ID3DXLine_Vtbl;
27 typedef struct ID3DXLineImpl {
28 const ID3DXLineVtbl *lpVtbl;
29 LONG ref;
30 } ID3DXLineImpl;
32 /*** IUnknown methods ***/
33 static HRESULT WINAPI ID3DXLineImpl_QueryInterface(ID3DXLine* iface, REFIID riid, LPVOID* object)
35 ID3DXLineImpl *This = (ID3DXLineImpl *)iface;
37 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), object);
39 if (IsEqualGUID(riid, &IID_IUnknown) ||
40 IsEqualGUID(riid, &IID_ID3DXLine))
42 ID3DXLine_AddRef(iface);
43 *object = This;
44 return S_OK;
47 ERR("Interface %s not found\n", debugstr_guid(riid));
49 return E_NOINTERFACE;
52 static ULONG WINAPI ID3DXLineImpl_AddRef(ID3DXLine* iface)
54 ID3DXLineImpl *This = (ID3DXLineImpl *)iface;
56 TRACE("(%p)->(): AddRef from %u\n", This, This->ref);
58 return InterlockedIncrement(&This->ref);
61 static ULONG WINAPI ID3DXLineImpl_Release(ID3DXLine* iface)
63 ID3DXLineImpl *This = (ID3DXLineImpl *)iface;
64 ULONG ref = InterlockedDecrement(&This->ref);
66 TRACE("(%p)->(): Release from %u\n", This, ref + 1);
68 if (!ref)
69 HeapFree(GetProcessHeap(), 0, This);
71 return ref;
74 /*** ID3DXLine methods ***/
75 static HRESULT WINAPI ID3DXLineImpl_GetDevice(ID3DXLine* iface, LPDIRECT3DDEVICE9* device)
77 ID3DXLineImpl *This = (ID3DXLineImpl *)iface;
79 FIXME("(%p)->(%p): stub\n", This, device);
81 return E_NOTIMPL;
84 static HRESULT WINAPI ID3DXLineImpl_Begin(ID3DXLine* iface)
86 ID3DXLineImpl *This = (ID3DXLineImpl *)iface;
88 FIXME("(%p)->(): stub\n", This);
90 return E_NOTIMPL;
93 static HRESULT WINAPI ID3DXLineImpl_Draw(ID3DXLine* iface, CONST D3DXVECTOR2* vertexlist, DWORD vertexlistcount, D3DCOLOR color)
95 ID3DXLineImpl *This = (ID3DXLineImpl *)iface;
97 FIXME("(%p)->(%p, %u, %#x): stub\n", This, vertexlist, vertexlistcount, color);
99 return E_NOTIMPL;
102 static HRESULT WINAPI ID3DXLineImpl_DrawTransform(ID3DXLine* iface, CONST D3DXVECTOR3* vertexlist, DWORD vertexlistcount,
103 CONST D3DXMATRIX* transform, D3DCOLOR color)
105 ID3DXLineImpl *This = (ID3DXLineImpl *)iface;
107 FIXME("(%p)->(%p, %u, %p, %#x): stub\n", This, vertexlist, vertexlistcount, transform, color);
109 return E_NOTIMPL;
112 static HRESULT WINAPI ID3DXLineImpl_SetPattern(ID3DXLine* iface, DWORD pattern)
114 ID3DXLineImpl *This = (ID3DXLineImpl *)iface;
116 FIXME("(%p)->(%#x): stub\n", This, pattern);
118 return E_NOTIMPL;
121 static DWORD WINAPI ID3DXLineImpl_GetPattern(ID3DXLine* iface)
123 ID3DXLineImpl *This = (ID3DXLineImpl *)iface;
125 FIXME("(%p)->(): stub\n", This);
127 return 0xFFFFFFFF;
130 static HRESULT WINAPI ID3DXLineImpl_SetPatternScale(ID3DXLine* iface, FLOAT scale)
132 ID3DXLineImpl *This = (ID3DXLineImpl *)iface;
134 FIXME("(%p)->(%f): stub\n", This, scale);
136 return E_NOTIMPL;
139 static FLOAT WINAPI ID3DXLineImpl_GetPatternScale(ID3DXLine* iface)
141 ID3DXLineImpl *This = (ID3DXLineImpl *)iface;
143 FIXME("(%p)->(): stub\n", This);
145 return 1.0f;
148 static HRESULT WINAPI ID3DXLineImpl_SetWidth(ID3DXLine* iface, FLOAT width)
150 ID3DXLineImpl *This = (ID3DXLineImpl *)iface;
152 FIXME("(%p)->(%f): stub\n", This, width);
154 return E_NOTIMPL;
157 static FLOAT WINAPI ID3DXLineImpl_GetWidth(ID3DXLine* iface)
159 ID3DXLineImpl *This = (ID3DXLineImpl *)iface;
161 FIXME("(%p)->(): stub\n", This);
163 return 1.0f;
166 static HRESULT WINAPI ID3DXLineImpl_SetAntialias(ID3DXLine* iface, BOOL antialias)
168 ID3DXLineImpl *This = (ID3DXLineImpl *)iface;
170 FIXME("(%p)->(%u): stub\n", This, antialias);
172 return E_NOTIMPL;
175 static BOOL WINAPI ID3DXLineImpl_GetAntialias(ID3DXLine* iface)
177 ID3DXLineImpl *This = (ID3DXLineImpl *)iface;
179 FIXME("(%p)->(): stub\n", This);
181 return FALSE;
184 static HRESULT WINAPI ID3DXLineImpl_SetGLLines(ID3DXLine* iface, BOOL gl_lines)
186 ID3DXLineImpl *This = (ID3DXLineImpl *)iface;
188 FIXME("(%p)->(%u): stub\n", This, gl_lines);
190 return E_NOTIMPL;
193 static BOOL WINAPI ID3DXLineImpl_GetGLLines(ID3DXLine* iface)
195 ID3DXLineImpl *This = (ID3DXLineImpl *)iface;
197 FIXME("(%p)->(): stub\n", This);
199 return FALSE;
202 static HRESULT WINAPI ID3DXLineImpl_End(ID3DXLine* iface)
204 ID3DXLineImpl *This = (ID3DXLineImpl *)iface;
206 FIXME("(%p)->(): stub\n", This);
208 return E_NOTIMPL;
211 static HRESULT WINAPI ID3DXLineImpl_OnLostDevice(ID3DXLine* iface)
213 ID3DXLineImpl *This = (ID3DXLineImpl *)iface;
215 FIXME("(%p)->(): stub\n", This);
217 return E_NOTIMPL;
219 static HRESULT WINAPI ID3DXLineImpl_OnResetDevice(ID3DXLine* iface)
221 ID3DXLineImpl *This = (ID3DXLineImpl *)iface;
223 FIXME("(%p)->(): stub\n", This);
225 return E_NOTIMPL;
228 static const struct ID3DXLineVtbl ID3DXLine_Vtbl =
230 /*** IUnknown methods ***/
231 ID3DXLineImpl_QueryInterface,
232 ID3DXLineImpl_AddRef,
233 ID3DXLineImpl_Release,
234 /*** ID3DXLine methods ***/
235 ID3DXLineImpl_GetDevice,
236 ID3DXLineImpl_Begin,
237 ID3DXLineImpl_Draw,
238 ID3DXLineImpl_DrawTransform,
239 ID3DXLineImpl_SetPattern,
240 ID3DXLineImpl_GetPattern,
241 ID3DXLineImpl_SetPatternScale,
242 ID3DXLineImpl_GetPatternScale,
243 ID3DXLineImpl_SetWidth,
244 ID3DXLineImpl_GetWidth,
245 ID3DXLineImpl_SetAntialias,
246 ID3DXLineImpl_GetAntialias,
247 ID3DXLineImpl_SetGLLines,
248 ID3DXLineImpl_GetGLLines,
249 ID3DXLineImpl_End,
250 ID3DXLineImpl_OnLostDevice,
251 ID3DXLineImpl_OnResetDevice
254 HRESULT WINAPI D3DXCreateLine(LPDIRECT3DDEVICE9 device, LPD3DXLINE* line)
256 ID3DXLineImpl* object;
258 TRACE("(%p, %p)\n", device, line);
260 if (!device || !line)
261 return D3DERR_INVALIDCALL;
263 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ID3DXLineImpl));
264 if (!object)
266 ERR("Out of memory\n");
267 return E_OUTOFMEMORY;
270 object->lpVtbl = &ID3DXLine_Vtbl;
271 object->ref = 1;
273 *line = (LPD3DXLINE)object;
275 return D3D_OK;