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
;
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
);
47 ERR("Interface %s not found\n", debugstr_guid(riid
));
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);
69 HeapFree(GetProcessHeap(), 0, This
);
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
);
84 static HRESULT WINAPI
ID3DXLineImpl_Begin(ID3DXLine
* iface
)
86 ID3DXLineImpl
*This
= (ID3DXLineImpl
*)iface
;
88 FIXME("(%p)->(): stub\n", This
);
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
);
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
);
112 static HRESULT WINAPI
ID3DXLineImpl_SetPattern(ID3DXLine
* iface
, DWORD pattern
)
114 ID3DXLineImpl
*This
= (ID3DXLineImpl
*)iface
;
116 FIXME("(%p)->(%#x): stub\n", This
, pattern
);
121 static DWORD WINAPI
ID3DXLineImpl_GetPattern(ID3DXLine
* iface
)
123 ID3DXLineImpl
*This
= (ID3DXLineImpl
*)iface
;
125 FIXME("(%p)->(): stub\n", This
);
130 static HRESULT WINAPI
ID3DXLineImpl_SetPatternScale(ID3DXLine
* iface
, FLOAT scale
)
132 ID3DXLineImpl
*This
= (ID3DXLineImpl
*)iface
;
134 FIXME("(%p)->(%f): stub\n", This
, scale
);
139 static FLOAT WINAPI
ID3DXLineImpl_GetPatternScale(ID3DXLine
* iface
)
141 ID3DXLineImpl
*This
= (ID3DXLineImpl
*)iface
;
143 FIXME("(%p)->(): stub\n", This
);
148 static HRESULT WINAPI
ID3DXLineImpl_SetWidth(ID3DXLine
* iface
, FLOAT width
)
150 ID3DXLineImpl
*This
= (ID3DXLineImpl
*)iface
;
152 FIXME("(%p)->(%f): stub\n", This
, width
);
157 static FLOAT WINAPI
ID3DXLineImpl_GetWidth(ID3DXLine
* iface
)
159 ID3DXLineImpl
*This
= (ID3DXLineImpl
*)iface
;
161 FIXME("(%p)->(): stub\n", This
);
166 static HRESULT WINAPI
ID3DXLineImpl_SetAntialias(ID3DXLine
* iface
, BOOL antialias
)
168 ID3DXLineImpl
*This
= (ID3DXLineImpl
*)iface
;
170 FIXME("(%p)->(%u): stub\n", This
, antialias
);
175 static BOOL WINAPI
ID3DXLineImpl_GetAntialias(ID3DXLine
* iface
)
177 ID3DXLineImpl
*This
= (ID3DXLineImpl
*)iface
;
179 FIXME("(%p)->(): stub\n", This
);
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
);
193 static BOOL WINAPI
ID3DXLineImpl_GetGLLines(ID3DXLine
* iface
)
195 ID3DXLineImpl
*This
= (ID3DXLineImpl
*)iface
;
197 FIXME("(%p)->(): stub\n", This
);
202 static HRESULT WINAPI
ID3DXLineImpl_End(ID3DXLine
* iface
)
204 ID3DXLineImpl
*This
= (ID3DXLineImpl
*)iface
;
206 FIXME("(%p)->(): stub\n", This
);
211 static HRESULT WINAPI
ID3DXLineImpl_OnLostDevice(ID3DXLine
* iface
)
213 ID3DXLineImpl
*This
= (ID3DXLineImpl
*)iface
;
215 FIXME("(%p)->(): stub\n", This
);
219 static HRESULT WINAPI
ID3DXLineImpl_OnResetDevice(ID3DXLine
* iface
)
221 ID3DXLineImpl
*This
= (ID3DXLineImpl
*)iface
;
223 FIXME("(%p)->(): stub\n", This
);
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
,
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
,
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
));
266 ERR("Out of memory\n");
267 return E_OUTOFMEMORY
;
270 object
->lpVtbl
= &ID3DXLine_Vtbl
;
273 *line
= (LPD3DXLINE
)object
;