ReactOS  0.4.14-dev-323-g6fe6a88
line.c File Reference
#include "config.h"
#include "wine/port.h"
#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 59 of file line.c.

60 {
61  struct d3dx9_line *line = impl_from_ID3DXLine(iface);
62  ULONG refcount = InterlockedIncrement(&line->ref);
63 
64  TRACE("%p increasing refcount to %u.\n", line, refcount);
65 
66  return refcount;
67 }
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:36

◆ d3dx9_line_Begin()

static HRESULT WINAPI d3dx9_line_Begin ( ID3DXLine *  iface)
static

Definition at line 100 of file line.c.

101 {
102  struct d3dx9_line *line = impl_from_ID3DXLine(iface);
103  D3DXMATRIX identity, projection;
104  D3DVIEWPORT9 vp;
105 
106  TRACE("iface %p.\n", iface);
107 
108  if (line->state)
109  return D3DERR_INVALIDCALL;
110 
112  return D3DXERR_INVALIDDATA;
113 
114  if (FAILED(IDirect3DDevice9_GetViewport(line->device, &vp)))
115  goto failed;
116 
117  D3DXMatrixIdentity(&identity);
118  D3DXMatrixOrthoOffCenterLH(&projection, 0.0, (FLOAT)vp.Width, (FLOAT)vp.Height, 0.0, 0.0, 1.0);
119 
121  goto failed;
123  goto failed;
124  if (FAILED(IDirect3DDevice9_SetTransform(line->device, D3DTS_PROJECTION, &projection)))
125  goto failed;
126 
128  goto failed;
130  goto failed;
132  goto failed;
134  goto failed;
136  goto failed;
138  goto failed;
139 
140  return D3D_OK;
141 
142 failed:
145  line->state = NULL;
146  return D3DXERR_INVALIDDATA;
147 }
#define TRUE
Definition: types.h:120
#define D3DERR_INVALIDCALL
#define IDirect3DStateBlock9_Apply(p)
Definition: d3d9.h:1304
smooth NULL
Definition: ftsmooth.c:416
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:439
#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
float FLOAT
Definition: typedefs.h:67
static struct d3dx9_line * impl_from_ID3DXLine(ID3DXLine *iface)
Definition: line.c:36

◆ 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 149 of file line.c.

151 {
152  FIXME("iface %p, vertex_list %p, vertex_list_count %u, color 0x%08x stub!\n",
153  iface, vertex_list, vertex_list_count, color);
154 
155  return E_NOTIMPL;
156 }
GLuint color
Definition: glext.h:6243
#define FIXME(fmt,...)
Definition: debug.h:110
#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 158 of file line.c.

160 {
161  FIXME("iface %p, vertex_list %p, vertex_list_count %u, transform %p, color 0x%08x stub!\n",
162  iface, vertex_list, vertex_list_count, transform, color);
163 
164  return E_NOTIMPL;
165 }
GLuint color
Definition: glext.h:6243
#define FIXME(fmt,...)
Definition: debug.h:110
#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 237 of file line.c.

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

◆ d3dx9_line_GetAntialias()

static BOOL WINAPI d3dx9_line_GetAntialias ( ID3DXLine *  iface)
static

Definition at line 216 of file line.c.

217 {
218  FIXME("iface %p stub!\n", iface);
219 
220  return FALSE;
221 }
#define FIXME(fmt,...)
Definition: debug.h:110

◆ d3dx9_line_GetDevice()

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

Definition at line 85 of file line.c.

86 {
87  struct d3dx9_line *line = impl_from_ID3DXLine(iface);
88 
89  TRACE("iface %p, device %p.\n", iface, line);
90 
91  if (!device)
92  return D3DERR_INVALIDCALL;
93 
94  *device = line->device;
96 
97  return D3D_OK;
98 }
#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:36

◆ d3dx9_line_GetGLLines()

static BOOL WINAPI d3dx9_line_GetGLLines ( ID3DXLine *  iface)
static

Definition at line 230 of file line.c.

231 {
232  FIXME("iface %p stub!\n", iface);
233 
234  return FALSE;
235 }
#define FIXME(fmt,...)
Definition: debug.h:110

◆ d3dx9_line_GetPattern()

static DWORD WINAPI d3dx9_line_GetPattern ( ID3DXLine *  iface)
static

Definition at line 174 of file line.c.

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

◆ d3dx9_line_GetPatternScale()

static float WINAPI d3dx9_line_GetPatternScale ( ID3DXLine *  iface)
static

Definition at line 188 of file line.c.

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

◆ d3dx9_line_GetWidth()

static float WINAPI d3dx9_line_GetWidth ( ID3DXLine *  iface)
static

Definition at line 202 of file line.c.

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

◆ d3dx9_line_OnLostDevice()

static HRESULT WINAPI d3dx9_line_OnLostDevice ( ID3DXLine *  iface)
static

Definition at line 258 of file line.c.

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

◆ d3dx9_line_OnResetDevice()

static HRESULT WINAPI d3dx9_line_OnResetDevice ( ID3DXLine *  iface)
static

Definition at line 264 of file line.c.

265 {
266  FIXME("iface %p stub!\n", iface);
267 
268  return E_NOTIMPL;
269 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3dx9_line_QueryInterface()

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

Definition at line 41 of file line.c.

42 {
43  TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
44 
45  if (IsEqualGUID(riid, &IID_ID3DXLine)
47  {
48  ID3DXLine_AddRef(iface);
49  *out = iface;
50  return S_OK;
51  }
52 
53  WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
54 
55  *out = NULL;
56  return E_NOINTERFACE;
57 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
#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:59
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 69 of file line.c.

70 {
71  struct d3dx9_line *line = impl_from_ID3DXLine(iface);
72  ULONG refcount = InterlockedDecrement(&line->ref);
73 
74  TRACE("%p decreasing refcount to %u.\n", line, refcount);
75 
76  if (!refcount)
77  {
80  }
81 
82  return refcount;
83 }
#define IDirect3DDevice9_Release(p)
Definition: d3d9.h:1508
Definition: parser.c:48
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
#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:36
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ d3dx9_line_SetAntialias()

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

Definition at line 209 of file line.c.

210 {
211  FIXME("iface %p, antialias %#x stub!\n", iface, antialias);
212 
213  return E_NOTIMPL;
214 }
#define FIXME(fmt,...)
Definition: debug.h:110
#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 223 of file line.c.

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

◆ d3dx9_line_SetPattern()

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

Definition at line 167 of file line.c.

168 {
169  FIXME("iface %p, pattern 0x%08x stub!\n", iface, pattern);
170 
171  return E_NOTIMPL;
172 }
#define FIXME(fmt,...)
Definition: debug.h:110
#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 181 of file line.c.

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

◆ d3dx9_line_SetWidth()

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

Definition at line 195 of file line.c.

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

◆ D3DXCreateLine()

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

Definition at line 295 of file line.c.

296 {
297  struct d3dx9_line *object;
298 
299  TRACE("device %p, line %p.\n", device, line);
300 
301  if (!device || !line)
302  return D3DERR_INVALIDCALL;
303 
304  if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
305  return E_OUTOFMEMORY;
306 
307  object->ID3DXLine_iface.lpVtbl = &d3dx9_line_vtbl;
308  object->ref = 1;
309  object->device = device;
311 
312  *line = &object->ID3DXLine_iface;
313 
314  return D3D_OK;
315 }
#define D3DERR_INVALIDCALL
#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:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static const struct ID3DXLineVtbl d3dx9_line_vtbl
Definition: line.c:271
#define IDirect3DDevice9_AddRef(p)
Definition: d3d9.h:1507
#define D3D_OK
Definition: d3d.h:106
IDirect3DDevice9 * device
Definition: line.c:32
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
void * object
Definition: jmemsys.h:48

◆ impl_from_ID3DXLine()

static struct d3dx9_line* impl_from_ID3DXLine ( ID3DXLine *  iface)
inlinestatic

Definition at line 36 of file line.c.

37 {
38  return CONTAINING_RECORD(iface, struct d3dx9_line, ID3DXLine_iface);
39 }
ID3DXLine ID3DXLine_iface
Definition: line.c:29
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:230
static float WINAPI d3dx9_line_GetWidth(ID3DXLine *iface)
Definition: line.c:202
static HRESULT WINAPI d3dx9_line_SetWidth(ID3DXLine *iface, float width)
Definition: line.c:195
static HRESULT WINAPI d3dx9_line_OnLostDevice(ID3DXLine *iface)
Definition: line.c:258
static DWORD WINAPI d3dx9_line_GetPattern(ID3DXLine *iface)
Definition: line.c:174
static HRESULT WINAPI d3dx9_line_QueryInterface(ID3DXLine *iface, REFIID riid, void **out)
Definition: line.c:41
static HRESULT WINAPI d3dx9_line_End(ID3DXLine *iface)
Definition: line.c:237
static HRESULT WINAPI d3dx9_line_SetGLLines(ID3DXLine *iface, BOOL gl_lines)
Definition: line.c:223
static HRESULT WINAPI d3dx9_line_DrawTransform(ID3DXLine *iface, const D3DXVECTOR3 *vertex_list, DWORD vertex_list_count, const D3DXMATRIX *transform, D3DCOLOR color)
Definition: line.c:158
static HRESULT WINAPI d3dx9_line_SetPattern(ID3DXLine *iface, DWORD pattern)
Definition: line.c:167
static BOOL WINAPI d3dx9_line_GetAntialias(ID3DXLine *iface)
Definition: line.c:216
static float WINAPI d3dx9_line_GetPatternScale(ID3DXLine *iface)
Definition: line.c:188
static HRESULT WINAPI d3dx9_line_OnResetDevice(ID3DXLine *iface)
Definition: line.c:264
static HRESULT WINAPI d3dx9_line_Draw(ID3DXLine *iface, const D3DXVECTOR2 *vertex_list, DWORD vertex_list_count, D3DCOLOR color)
Definition: line.c:149
static HRESULT WINAPI d3dx9_line_SetAntialias(ID3DXLine *iface, BOOL antialias)
Definition: line.c:209
static HRESULT WINAPI d3dx9_line_GetDevice(struct ID3DXLine *iface, struct IDirect3DDevice9 **device)
Definition: line.c:85
static ULONG WINAPI d3dx9_line_AddRef(ID3DXLine *iface)
Definition: line.c:59
static HRESULT WINAPI d3dx9_line_Begin(ID3DXLine *iface)
Definition: line.c:100
static HRESULT WINAPI d3dx9_line_SetPatternScale(ID3DXLine *iface, float scale)
Definition: line.c:181
static ULONG WINAPI d3dx9_line_Release(ID3DXLine *iface)
Definition: line.c:69

Definition at line 271 of file line.c.

Referenced by D3DXCreateLine().