ReactOS  0.4.15-dev-3177-gd6a0299
line.c File Reference
#include "d3dx9_private.h"
Include dependency graph for line.c:

Go to the source code of this file.

Classes

struct  d3dx9_line
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (d3dx)
 
static struct d3dx9_lineimpl_from_ID3DXLine (ID3DXLine *iface)
 
static HRESULT WINAPI d3dx9_line_QueryInterface (ID3DXLine *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3dx9_line_AddRef (ID3DXLine *iface)
 
static ULONG WINAPI d3dx9_line_Release (ID3DXLine *iface)
 
static HRESULT WINAPI d3dx9_line_GetDevice (struct ID3DXLine *iface, struct IDirect3DDevice9 **device)
 
static HRESULT WINAPI d3dx9_line_Begin (ID3DXLine *iface)
 
static HRESULT WINAPI d3dx9_line_Draw (ID3DXLine *iface, const D3DXVECTOR2 *vertex_list, DWORD vertex_list_count, D3DCOLOR color)
 
static HRESULT WINAPI d3dx9_line_DrawTransform (ID3DXLine *iface, const D3DXVECTOR3 *vertex_list, DWORD vertex_list_count, const D3DXMATRIX *transform, D3DCOLOR color)
 
static HRESULT WINAPI d3dx9_line_SetPattern (ID3DXLine *iface, DWORD pattern)
 
static DWORD WINAPI d3dx9_line_GetPattern (ID3DXLine *iface)
 
static HRESULT WINAPI d3dx9_line_SetPatternScale (ID3DXLine *iface, float scale)
 
static float WINAPI d3dx9_line_GetPatternScale (ID3DXLine *iface)
 
static HRESULT WINAPI d3dx9_line_SetWidth (ID3DXLine *iface, float width)
 
static float WINAPI d3dx9_line_GetWidth (ID3DXLine *iface)
 
static HRESULT WINAPI d3dx9_line_SetAntialias (ID3DXLine *iface, BOOL antialias)
 
static BOOL WINAPI d3dx9_line_GetAntialias (ID3DXLine *iface)
 
static HRESULT WINAPI d3dx9_line_SetGLLines (ID3DXLine *iface, BOOL gl_lines)
 
static BOOL WINAPI d3dx9_line_GetGLLines (ID3DXLine *iface)
 
static HRESULT WINAPI d3dx9_line_End (ID3DXLine *iface)
 
static HRESULT WINAPI d3dx9_line_OnLostDevice (ID3DXLine *iface)
 
static HRESULT WINAPI d3dx9_line_OnResetDevice (ID3DXLine *iface)
 
HRESULT WINAPI D3DXCreateLine (struct IDirect3DDevice9 *device, struct ID3DXLine **line)
 

Variables

static const struct ID3DXLineVtbl d3dx9_line_vtbl
 

Function Documentation

◆ d3dx9_line_AddRef()

static ULONG WINAPI d3dx9_line_AddRef ( ID3DXLine *  iface)
static

Definition at line 61 of file line.c.

62 {
63  struct d3dx9_line *line = impl_from_ID3DXLine(iface);
64  ULONG refcount = InterlockedIncrement(&line->ref);
65 
66  TRACE("%p increasing refcount to %u.\n", line, refcount);
67 
68  return refcount;
69 }
Definition: parser.c:48
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1
static struct d3dx9_line * impl_from_ID3DXLine(ID3DXLine *iface)
Definition: line.c:38

◆ d3dx9_line_Begin()

static HRESULT WINAPI d3dx9_line_Begin ( ID3DXLine *  iface)
static

Definition at line 102 of file line.c.

103 {
104  struct d3dx9_line *line = impl_from_ID3DXLine(iface);
105  D3DXMATRIX identity, projection;
106  D3DVIEWPORT9 vp;
107 
108  TRACE("iface %p.\n", iface);
109 
110  if (line->state)
111  return D3DERR_INVALIDCALL;
112 
114  return D3DXERR_INVALIDDATA;
115 
116  if (FAILED(IDirect3DDevice9_GetViewport(line->device, &vp)))
117  goto failed;
118 
119  D3DXMatrixIdentity(&identity);
120  D3DXMatrixOrthoOffCenterLH(&projection, 0.0, (FLOAT)vp.Width, (FLOAT)vp.Height, 0.0, 0.0, 1.0);
121 
123  goto failed;
125  goto failed;
126  if (FAILED(IDirect3DDevice9_SetTransform(line->device, D3DTS_PROJECTION, &projection)))
127  goto failed;
128 
130  goto failed;
132  goto failed;
134  goto failed;
136  goto failed;
138  goto failed;
140  goto failed;
141 
142  return D3D_OK;
143 
144 failed:
147  line->state = NULL;
148  return D3DXERR_INVALIDDATA;
149 }
#define TRUE
Definition: types.h:120
#define D3DERR_INVALIDCALL
#define IDirect3DStateBlock9_Apply(p)
Definition: d3d9.h:1304
#define FALSE
Definition: types.h:117
Definition: parser.c:48
#define IDirect3DDevice9_GetViewport(p, a)
Definition: d3d9.h:1555
#define TRACE(s)
Definition: solgame.cpp:4
#define IDirect3DDevice9_CreateStateBlock(p, a, b)
Definition: d3d9.h:1566
static const struct d3drm_matrix identity
Definition: frame.c:26
D3DXMATRIX *WINAPI D3DXMatrixOrthoOffCenterLH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf)
Definition: math.c:443
#define IDirect3DDevice9_SetTransform(p, a, b)
Definition: d3d9.h:1551
#define IDirect3DStateBlock9_Release(p)
Definition: d3d9.h:1300
#define IDirect3DDevice9_SetRenderState(p, a, b)
Definition: d3d9.h:1564
#define D3D_OK
Definition: d3d.h:106
#define D3DTS_WORLD
Definition: d3d8types.h:85
#define NULL
Definition: types.h:112
float FLOAT
Definition: typedefs.h:69
static struct d3dx9_line * impl_from_ID3DXLine(ID3DXLine *iface)
Definition: line.c:38

◆ d3dx9_line_Draw()

static HRESULT WINAPI d3dx9_line_Draw ( ID3DXLine *  iface,
const D3DXVECTOR2 vertex_list,
DWORD  vertex_list_count,
D3DCOLOR  color 
)
static

Definition at line 151 of file line.c.

153 {
154  FIXME("iface %p, vertex_list %p, vertex_list_count %u, color 0x%08x stub!\n",
155  iface, vertex_list, vertex_list_count, color);
156 
157  return E_NOTIMPL;
158 }
GLuint color
Definition: glext.h:6243
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3dx9_line_DrawTransform()

static HRESULT WINAPI d3dx9_line_DrawTransform ( ID3DXLine *  iface,
const D3DXVECTOR3 vertex_list,
DWORD  vertex_list_count,
const D3DXMATRIX transform,
D3DCOLOR  color 
)
static

Definition at line 160 of file line.c.

162 {
163  FIXME("iface %p, vertex_list %p, vertex_list_count %u, transform %p, color 0x%08x stub!\n",
164  iface, vertex_list, vertex_list_count, transform, color);
165 
166  return E_NOTIMPL;
167 }
GLuint color
Definition: glext.h:6243
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
GLuint GLenum GLenum transform
Definition: glext.h:9407

◆ d3dx9_line_End()

static HRESULT WINAPI d3dx9_line_End ( ID3DXLine *  iface)
static

Definition at line 239 of file line.c.

240 {
241  struct d3dx9_line *line = impl_from_ID3DXLine(iface);
242 
243  HRESULT hr;
244 
245  TRACE("iface %p.\n", iface);
246 
247  if (!line->state)
248  return D3DERR_INVALIDCALL;
249 
252  line->state = NULL;
253 
254  if (FAILED(hr))
255  return D3DXERR_INVALIDDATA;
256 
257  return D3D_OK;
258 }
HRESULT hr
Definition: shlfolder.c:183
#define D3DERR_INVALIDCALL
#define IDirect3DStateBlock9_Apply(p)
Definition: d3d9.h:1304
Definition: parser.c:48
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
#define IDirect3DStateBlock9_Release(p)
Definition: d3d9.h:1300
#define D3D_OK
Definition: d3d.h:106
#define NULL
Definition: types.h:112
static struct d3dx9_line * impl_from_ID3DXLine(ID3DXLine *iface)
Definition: line.c:38

◆ d3dx9_line_GetAntialias()

static BOOL WINAPI d3dx9_line_GetAntialias ( ID3DXLine *  iface)
static

Definition at line 218 of file line.c.

219 {
220  FIXME("iface %p stub!\n", iface);
221 
222  return FALSE;
223 }
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111

◆ d3dx9_line_GetDevice()

static HRESULT WINAPI d3dx9_line_GetDevice ( struct ID3DXLine *  iface,
struct IDirect3DDevice9 **  device 
)
static

Definition at line 87 of file line.c.

88 {
89  struct d3dx9_line *line = impl_from_ID3DXLine(iface);
90 
91  TRACE("iface %p, device %p.\n", iface, line);
92 
93  if (!device)
94  return D3DERR_INVALIDCALL;
95 
96  *device = line->device;
98 
99  return D3D_OK;
100 }
#define D3DERR_INVALIDCALL
Definition: devices.h:37
Definition: parser.c:48
#define TRACE(s)
Definition: solgame.cpp:4
#define IDirect3DDevice9_AddRef(p)
Definition: d3d9.h:1507
#define D3D_OK
Definition: d3d.h:106
static struct d3dx9_line * impl_from_ID3DXLine(ID3DXLine *iface)
Definition: line.c:38

◆ d3dx9_line_GetGLLines()

static BOOL WINAPI d3dx9_line_GetGLLines ( ID3DXLine *  iface)
static

Definition at line 232 of file line.c.

233 {
234  FIXME("iface %p stub!\n", iface);
235 
236  return FALSE;
237 }
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111

◆ d3dx9_line_GetPattern()

static DWORD WINAPI d3dx9_line_GetPattern ( ID3DXLine *  iface)
static

Definition at line 176 of file line.c.

177 {
178  FIXME("iface %p stub!\n", iface);
179 
180  return 0xffffffff;
181 }
#define FIXME(fmt,...)
Definition: debug.h:111

◆ d3dx9_line_GetPatternScale()

static float WINAPI d3dx9_line_GetPatternScale ( ID3DXLine *  iface)
static

Definition at line 190 of file line.c.

191 {
192  FIXME("iface %p stub!\n", iface);
193 
194  return 1.0f;
195 }
#define FIXME(fmt,...)
Definition: debug.h:111

◆ d3dx9_line_GetWidth()

static float WINAPI d3dx9_line_GetWidth ( ID3DXLine *  iface)
static

Definition at line 204 of file line.c.

205 {
206  FIXME("iface %p stub!\n", iface);
207 
208  return 1.0f;
209 }
#define FIXME(fmt,...)
Definition: debug.h:111

◆ d3dx9_line_OnLostDevice()

static HRESULT WINAPI d3dx9_line_OnLostDevice ( ID3DXLine *  iface)
static

Definition at line 260 of file line.c.

261 {
262  FIXME("iface %p stub!\n", iface);
263 
264  return E_NOTIMPL;
265 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3dx9_line_OnResetDevice()

static HRESULT WINAPI d3dx9_line_OnResetDevice ( ID3DXLine *  iface)
static

Definition at line 266 of file line.c.

267 {
268  FIXME("iface %p stub!\n", iface);
269 
270  return S_OK;
271 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define S_OK
Definition: intsafe.h:52

◆ d3dx9_line_QueryInterface()

static HRESULT WINAPI d3dx9_line_QueryInterface ( ID3DXLine *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 43 of file line.c.

44 {
45  TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
46 
47  if (IsEqualGUID(riid, &IID_ID3DXLine)
49  {
50  ID3DXLine_AddRef(iface);
51  *out = iface;
52  return S_OK;
53  }
54 
55  WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
56 
57  *out = NULL;
58  return E_NOINTERFACE;
59 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:112
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
static FILE * out
Definition: regtests2xml.c:44
#define ID3DXLine_AddRef(p)
Definition: d3dx9core.h:245
#define S_OK
Definition: intsafe.h:52
#define NULL
Definition: types.h:112
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ d3dx9_line_Release()

static ULONG WINAPI d3dx9_line_Release ( ID3DXLine *  iface)
static

Definition at line 71 of file line.c.

72 {
73  struct d3dx9_line *line = impl_from_ID3DXLine(iface);
74  ULONG refcount = InterlockedDecrement(&line->ref);
75 
76  TRACE("%p decreasing refcount to %u.\n", line, refcount);
77 
78  if (!refcount)
79  {
82  }
83 
84  return refcount;
85 }
#define IDirect3DDevice9_Release(p)
Definition: d3d9.h:1508
Definition: parser.c:48
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
static struct d3dx9_line * impl_from_ID3DXLine(ID3DXLine *iface)
Definition: line.c:38
#define HeapFree(x, y, z)
Definition: compat.h:594

◆ d3dx9_line_SetAntialias()

static HRESULT WINAPI d3dx9_line_SetAntialias ( ID3DXLine *  iface,
BOOL  antialias 
)
static

Definition at line 211 of file line.c.

212 {
213  FIXME("iface %p, antialias %#x stub!\n", iface, antialias);
214 
215  return E_NOTIMPL;
216 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3dx9_line_SetGLLines()

static HRESULT WINAPI d3dx9_line_SetGLLines ( ID3DXLine *  iface,
BOOL  gl_lines 
)
static

Definition at line 225 of file line.c.

226 {
227  FIXME("iface %p, gl_lines %#x stub!\n", iface, gl_lines);
228 
229  return E_NOTIMPL;
230 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3dx9_line_SetPattern()

static HRESULT WINAPI d3dx9_line_SetPattern ( ID3DXLine *  iface,
DWORD  pattern 
)
static

Definition at line 169 of file line.c.

170 {
171  FIXME("iface %p, pattern 0x%08x stub!\n", iface, pattern);
172 
173  return E_NOTIMPL;
174 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
GLubyte * pattern
Definition: glext.h:7787

◆ d3dx9_line_SetPatternScale()

static HRESULT WINAPI d3dx9_line_SetPatternScale ( ID3DXLine *  iface,
float  scale 
)
static

Definition at line 183 of file line.c.

184 {
185  FIXME("iface %p, scale %.8e stub!\n", iface, scale);
186 
187  return E_NOTIMPL;
188 }
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3dx9_line_SetWidth()

static HRESULT WINAPI d3dx9_line_SetWidth ( ID3DXLine *  iface,
float  width 
)
static

Definition at line 197 of file line.c.

198 {
199  FIXME("iface %p, width %.8e stub!\n", iface, width);
200 
201  return E_NOTIMPL;
202 }
GLint GLint GLsizei width
Definition: gl.h:1546
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ D3DXCreateLine()

HRESULT WINAPI D3DXCreateLine ( struct IDirect3DDevice9 *  device,
struct ID3DXLine **  line 
)

Definition at line 297 of file line.c.

298 {
299  struct d3dx9_line *object;
300 
301  TRACE("device %p, line %p.\n", device, line);
302 
303  if (!device || !line)
304  return D3DERR_INVALIDCALL;
305 
306  if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
307  return E_OUTOFMEMORY;
308 
309  object->ID3DXLine_iface.lpVtbl = &d3dx9_line_vtbl;
310  object->ref = 1;
311  object->device = device;
313 
314  *line = &object->ID3DXLine_iface;
315 
316  return D3D_OK;
317 }
coclass MSXML2::XSLTemplate40 object
#define D3DERR_INVALIDCALL
FxDevice * device
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
Definition: devices.h:37
Definition: parser.c:48
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static const struct ID3DXLineVtbl d3dx9_line_vtbl
Definition: line.c:273
#define IDirect3DDevice9_AddRef(p)
Definition: d3d9.h:1507
#define D3D_OK
Definition: d3d.h:106
#define HEAP_ZERO_MEMORY
Definition: compat.h:134

Referenced by test_create_line().

◆ impl_from_ID3DXLine()

static struct d3dx9_line* impl_from_ID3DXLine ( ID3DXLine *  iface)
inlinestatic

Definition at line 38 of file line.c.

39 {
40  return CONTAINING_RECORD(iface, struct d3dx9_line, ID3DXLine_iface);
41 }
ID3DXLine ID3DXLine_iface
Definition: line.c:31
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by d3dx9_line_AddRef(), d3dx9_line_Begin(), d3dx9_line_End(), d3dx9_line_GetDevice(), and d3dx9_line_Release().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( d3dx  )

Variable Documentation

◆ d3dx9_line_vtbl

const struct ID3DXLineVtbl d3dx9_line_vtbl
static
Initial value:
=
{
}
static BOOL WINAPI d3dx9_line_GetGLLines(ID3DXLine *iface)
Definition: line.c:232
static float WINAPI d3dx9_line_GetWidth(ID3DXLine *iface)
Definition: line.c:204
static HRESULT WINAPI d3dx9_line_SetWidth(ID3DXLine *iface, float width)
Definition: line.c:197
static HRESULT WINAPI d3dx9_line_OnLostDevice(ID3DXLine *iface)
Definition: line.c:260
static DWORD WINAPI d3dx9_line_GetPattern(ID3DXLine *iface)
Definition: line.c:176
static HRESULT WINAPI d3dx9_line_QueryInterface(ID3DXLine *iface, REFIID riid, void **out)
Definition: line.c:43
static HRESULT WINAPI d3dx9_line_End(ID3DXLine *iface)
Definition: line.c:239
static HRESULT WINAPI d3dx9_line_SetGLLines(ID3DXLine *iface, BOOL gl_lines)
Definition: line.c:225
static HRESULT WINAPI d3dx9_line_DrawTransform(ID3DXLine *iface, const D3DXVECTOR3 *vertex_list, DWORD vertex_list_count, const D3DXMATRIX *transform, D3DCOLOR color)
Definition: line.c:160
static HRESULT WINAPI d3dx9_line_SetPattern(ID3DXLine *iface, DWORD pattern)
Definition: line.c:169
static BOOL WINAPI d3dx9_line_GetAntialias(ID3DXLine *iface)
Definition: line.c:218
static float WINAPI d3dx9_line_GetPatternScale(ID3DXLine *iface)
Definition: line.c:190
static HRESULT WINAPI d3dx9_line_OnResetDevice(ID3DXLine *iface)
Definition: line.c:266
static HRESULT WINAPI d3dx9_line_Draw(ID3DXLine *iface, const D3DXVECTOR2 *vertex_list, DWORD vertex_list_count, D3DCOLOR color)
Definition: line.c:151
static HRESULT WINAPI d3dx9_line_SetAntialias(ID3DXLine *iface, BOOL antialias)
Definition: line.c:211
static HRESULT WINAPI d3dx9_line_GetDevice(struct ID3DXLine *iface, struct IDirect3DDevice9 **device)
Definition: line.c:87
static ULONG WINAPI d3dx9_line_AddRef(ID3DXLine *iface)
Definition: line.c:61
static HRESULT WINAPI d3dx9_line_Begin(ID3DXLine *iface)
Definition: line.c:102
static HRESULT WINAPI d3dx9_line_SetPatternScale(ID3DXLine *iface, float scale)
Definition: line.c:183
static ULONG WINAPI d3dx9_line_Release(ID3DXLine *iface)
Definition: line.c:71

Definition at line 273 of file line.c.

Referenced by D3DXCreateLine().