ReactOS  0.4.14-dev-293-g2b39b42
directx.c File Reference
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "d3d8_private.h"
Include dependency graph for directx.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (d3d8)
 
static struct d3d8impl_from_IDirect3D8 (IDirect3D8 *iface)
 
static HRESULT WINAPI d3d8_QueryInterface (IDirect3D8 *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3d8_AddRef (IDirect3D8 *iface)
 
static ULONG WINAPI d3d8_Release (IDirect3D8 *iface)
 
static HRESULT WINAPI d3d8_RegisterSoftwareDevice (IDirect3D8 *iface, void *init_function)
 
static UINT WINAPI d3d8_GetAdapterCount (IDirect3D8 *iface)
 
static HRESULT WINAPI d3d8_GetAdapterIdentifier (IDirect3D8 *iface, UINT adapter, DWORD flags, D3DADAPTER_IDENTIFIER8 *identifier)
 
static UINT WINAPI d3d8_GetAdapterModeCount (IDirect3D8 *iface, UINT adapter)
 
static HRESULT WINAPI d3d8_EnumAdapterModes (IDirect3D8 *iface, UINT adapter, UINT mode_idx, D3DDISPLAYMODE *mode)
 
static HRESULT WINAPI d3d8_GetAdapterDisplayMode (IDirect3D8 *iface, UINT adapter, D3DDISPLAYMODE *mode)
 
static HRESULT WINAPI d3d8_CheckDeviceType (IDirect3D8 *iface, UINT adapter, D3DDEVTYPE device_type, D3DFORMAT display_format, D3DFORMAT backbuffer_format, BOOL windowed)
 
static HRESULT WINAPI d3d8_CheckDeviceFormat (IDirect3D8 *iface, UINT adapter, D3DDEVTYPE device_type, D3DFORMAT adapter_format, DWORD usage, D3DRESOURCETYPE resource_type, D3DFORMAT format)
 
static HRESULT WINAPI d3d8_CheckDeviceMultiSampleType (IDirect3D8 *iface, UINT adapter, D3DDEVTYPE device_type, D3DFORMAT format, BOOL windowed, D3DMULTISAMPLE_TYPE multisample_type)
 
static HRESULT WINAPI d3d8_CheckDepthStencilMatch (IDirect3D8 *iface, UINT adapter, D3DDEVTYPE device_type, D3DFORMAT adapter_format, D3DFORMAT rt_format, D3DFORMAT ds_format)
 
static HRESULT WINAPI d3d8_GetDeviceCaps (IDirect3D8 *iface, UINT adapter, D3DDEVTYPE device_type, D3DCAPS8 *caps)
 
static HMONITOR WINAPI d3d8_GetAdapterMonitor (IDirect3D8 *iface, UINT adapter)
 
static HRESULT WINAPI d3d8_CreateDevice (IDirect3D8 *iface, UINT adapter, D3DDEVTYPE device_type, HWND focus_window, DWORD flags, D3DPRESENT_PARAMETERS *parameters, IDirect3DDevice8 **device)
 
BOOL d3d8_init (struct d3d8 *d3d8)
 

Variables

static const struct IDirect3D8Vtbl d3d8_vtbl
 

Function Documentation

◆ d3d8_AddRef()

static ULONG WINAPI d3d8_AddRef ( IDirect3D8 *  iface)
static

Definition at line 61 of file directx.c.

62 {
63  struct d3d8 *d3d8 = impl_from_IDirect3D8(iface);
65 
66  TRACE("%p increasing refcount to %u.\n", iface, refcount);
67 
68  return refcount;
69 }
LONG refcount
Definition: d3d8_private.h:50
static struct d3d8 * impl_from_IDirect3D8(IDirect3D8 *iface)
Definition: directx.c:38
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

◆ d3d8_CheckDepthStencilMatch()

static HRESULT WINAPI d3d8_CheckDepthStencilMatch ( IDirect3D8 *  iface,
UINT  adapter,
D3DDEVTYPE  device_type,
D3DFORMAT  adapter_format,
D3DFORMAT  rt_format,
D3DFORMAT  ds_format 
)
static

Definition at line 306 of file directx.c.

308 {
309  struct d3d8 *d3d8 = impl_from_IDirect3D8(iface);
310  HRESULT hr;
311 
312  TRACE("iface %p, adapter %u, device_type %#x, adapter_format %#x, rt_format %#x, ds_format %#x.\n",
313  iface, adapter, device_type, adapter_format, rt_format, ds_format);
314 
318  wined3dformat_from_d3dformat(ds_format));
320 
321  return hr;
322 }
HRESULT hr
Definition: shlfolder.c:183
enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format) DECLSPEC_HIDDEN
Definition: device.c:94
device_type
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
static struct d3d8 * impl_from_IDirect3D8(IDirect3D8 *iface)
Definition: directx.c:38
struct wined3d * wined3d
Definition: d3d8_private.h:51
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT CDECL wined3d_check_depth_stencil_match(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, enum wined3d_format_id adapter_format_id, enum wined3d_format_id render_target_format_id, enum wined3d_format_id depth_stencil_format_id)
Definition: directx.c:5091
LONG HRESULT
Definition: typedefs.h:77
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_CheckDeviceFormat()

static HRESULT WINAPI d3d8_CheckDeviceFormat ( IDirect3D8 *  iface,
UINT  adapter,
D3DDEVTYPE  device_type,
D3DFORMAT  adapter_format,
DWORD  usage,
D3DRESOURCETYPE  resource_type,
D3DFORMAT  format 
)
static

Definition at line 234 of file directx.c.

236 {
237  struct d3d8 *d3d8 = impl_from_IDirect3D8(iface);
238  enum wined3d_resource_type wined3d_rtype;
239  HRESULT hr;
240 
241  TRACE("iface %p, adapter %u, device_type %#x, adapter_format %#x, usage %#x, resource_type %#x, format %#x.\n",
242  iface, adapter, device_type, adapter_format, usage, resource_type, format);
243 
244  if (!adapter_format)
245  {
246  WARN("Invalid adapter format.\n");
247  return D3DERR_INVALIDCALL;
248  }
249 
251  switch (resource_type)
252  {
255  case D3DRTYPE_TEXTURE:
257  case D3DRTYPE_SURFACE:
258  wined3d_rtype = WINED3D_RTYPE_TEXTURE_2D;
259  break;
260 
262  case D3DRTYPE_VOLUME:
264  wined3d_rtype = WINED3D_RTYPE_TEXTURE_3D;
265  break;
266 
269  wined3d_rtype = WINED3D_RTYPE_BUFFER;
270  break;
271 
272  default:
273  FIXME("Unhandled resource type %#x.\n", resource_type);
274  return WINED3DERR_INVALIDCALL;
275  }
276 
279  usage, wined3d_rtype, wined3dformat_from_d3dformat(format));
281 
282  return hr;
283 }
#define WINED3DERR_INVALIDCALL
Definition: wined3d.h:48
wined3d_resource_type
Definition: wined3d.h:695
HRESULT hr
Definition: shlfolder.c:183
enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format) DECLSPEC_HIDDEN
Definition: device.c:94
#define WARN(fmt,...)
Definition: debug.h:111
device_type
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, enum wined3d_format_id adapter_format_id, DWORD usage, enum wined3d_resource_type resource_type, enum wined3d_format_id check_format_id)
Definition: directx.c:5334
#define WINED3DUSAGE_MASK
Definition: wined3d.h:913
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
static struct d3d8 * impl_from_IDirect3D8(IDirect3D8 *iface)
Definition: directx.c:38
struct wined3d * wined3d
Definition: d3d8_private.h:51
#define FIXME(fmt,...)
Definition: debug.h:110
#define WINED3DUSAGE_LEGACY_CUBEMAP
Definition: wined3d.h:917
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
#define WINED3DUSAGE_QUERY_MASK
Definition: wined3d.h:931
#define WINED3DUSAGE_TEXTURE
Definition: wined3d.h:918
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_CheckDeviceMultiSampleType()

static HRESULT WINAPI d3d8_CheckDeviceMultiSampleType ( IDirect3D8 *  iface,
UINT  adapter,
D3DDEVTYPE  device_type,
D3DFORMAT  format,
BOOL  windowed,
D3DMULTISAMPLE_TYPE  multisample_type 
)
static

Definition at line 285 of file directx.c.

287 {
288  struct d3d8 *d3d8 = impl_from_IDirect3D8(iface);
289  HRESULT hr;
290 
291  TRACE("iface %p, adapter %u, device_type %#x, format %#x, windowed %#x, multisample_type %#x.\n",
292  iface, adapter, device_type, format, windowed, multisample_type);
293 
294  if (multisample_type > D3DMULTISAMPLE_16_SAMPLES)
295  return D3DERR_INVALIDCALL;
296 
300  (enum wined3d_multisample_type)multisample_type, NULL);
302 
303  return hr;
304 }
HRESULT hr
Definition: shlfolder.c:183
enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format) DECLSPEC_HIDDEN
Definition: device.c:94
device_type
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
static struct d3d8 * impl_from_IDirect3D8(IDirect3D8 *iface)
Definition: directx.c:38
struct wined3d * wined3d
Definition: d3d8_private.h:51
smooth NULL
Definition: ftsmooth.c:416
HRESULT CDECL wined3d_check_device_multisample_type(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, enum wined3d_format_id surface_format_id, BOOL windowed, enum wined3d_multisample_type multisample_type, DWORD *quality_levels)
Definition: directx.c:5145
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
wined3d_multisample_type
Definition: wined3d.h:552
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_CheckDeviceType()

static HRESULT WINAPI d3d8_CheckDeviceType ( IDirect3D8 *  iface,
UINT  adapter,
D3DDEVTYPE  device_type,
D3DFORMAT  display_format,
D3DFORMAT  backbuffer_format,
BOOL  windowed 
)
static

Definition at line 214 of file directx.c.

216 {
217  struct d3d8 *d3d8 = impl_from_IDirect3D8(iface);
218  HRESULT hr;
219 
220  TRACE("iface %p, adapter %u, device_type %#x, display_format %#x, backbuffer_format %#x, windowed %#x.\n",
221  iface, adapter, device_type, display_format, backbuffer_format, windowed);
222 
223  if (!windowed && display_format != D3DFMT_X8R8G8B8 && display_format != D3DFMT_R5G6B5)
225 
228  wined3dformat_from_d3dformat(backbuffer_format), windowed);
230 
231  return hr;
232 }
HRESULT hr
Definition: shlfolder.c:183
enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format) DECLSPEC_HIDDEN
Definition: device.c:94
device_type
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
static struct d3d8 * impl_from_IDirect3D8(IDirect3D8 *iface)
Definition: directx.c:38
struct wined3d * wined3d
Definition: d3d8_private.h:51
HRESULT CDECL wined3d_check_device_type(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, enum wined3d_format_id display_format, enum wined3d_format_id backbuffer_format, BOOL windowed)
Definition: directx.c:5546
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define WINED3DERR_NOTAVAILABLE
Definition: wined3d.h:46
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_CreateDevice()

static HRESULT WINAPI d3d8_CreateDevice ( IDirect3D8 *  iface,
UINT  adapter,
D3DDEVTYPE  device_type,
HWND  focus_window,
DWORD  flags,
D3DPRESENT_PARAMETERS parameters,
IDirect3DDevice8 **  device 
)
static

Definition at line 365 of file directx.c.

368 {
369  struct d3d8 *d3d8 = impl_from_IDirect3D8(iface);
370  struct d3d8_device *object;
371  HRESULT hr;
372 
373  TRACE("iface %p, adapter %u, device_type %#x, focus_window %p, flags %#x, parameters %p, device %p.\n",
374  iface, adapter, device_type, focus_window, flags, parameters, device);
375 
376  if (!(object = heap_alloc_zero(sizeof(*object))))
377  return E_OUTOFMEMORY;
378 
379  hr = device_init(object, d3d8, d3d8->wined3d, adapter, device_type, focus_window, flags, parameters);
380  if (FAILED(hr))
381  {
382  WARN("Failed to initialize device, hr %#x.\n", hr);
383  heap_free(object);
384  return hr;
385  }
386 
387  TRACE("Created device %p.\n", object);
388  *device = &object->IDirect3DDevice8_iface;
389 
390  return D3D_OK;
391 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
device_type
HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wined3d *wined3d, UINT adapter, D3DDEVTYPE device_type, HWND focus_window, DWORD flags, D3DPRESENT_PARAMETERS *parameters) DECLSPEC_HIDDEN
Definition: device.c:3279
static struct d3d8 * impl_from_IDirect3D8(IDirect3D8 *iface)
Definition: directx.c:38
struct wined3d * wined3d
Definition: d3d8_private.h:51
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
GLbitfield flags
Definition: glext.h:7161
#define D3D_OK
Definition: d3d.h:106
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ d3d8_EnumAdapterModes()

static HRESULT WINAPI d3d8_EnumAdapterModes ( IDirect3D8 *  iface,
UINT  adapter,
UINT  mode_idx,
D3DDISPLAYMODE mode 
)
static

Definition at line 165 of file directx.c.

166 {
167  struct d3d8 *d3d8 = impl_from_IDirect3D8(iface);
168  struct wined3d_display_mode wined3d_mode;
169  HRESULT hr;
170 
171  TRACE("iface %p, adapter %u, mode_idx %u, mode %p.\n",
172  iface, adapter, mode_idx, mode);
173 
176  WINED3D_SCANLINE_ORDERING_UNKNOWN, mode_idx, &wined3d_mode);
178 
179  if (SUCCEEDED(hr))
180  {
181  mode->Width = wined3d_mode.width;
182  mode->Height = wined3d_mode.height;
183  mode->RefreshRate = wined3d_mode.refresh_rate;
184  mode->Format = d3dformat_from_wined3dformat(wined3d_mode.format_id);
185  }
186 
187  return hr;
188 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
static struct d3d8 * impl_from_IDirect3D8(IDirect3D8 *iface)
Definition: directx.c:38
struct wined3d * wined3d
Definition: d3d8_private.h:51
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
GLenum mode
Definition: glext.h:6217
D3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN
Definition: device.c:44
HRESULT CDECL wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_format_id format_id, enum wined3d_scanline_ordering scanline_ordering, UINT mode_idx, struct wined3d_display_mode *mode)
Definition: directx.c:4589
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ d3d8_GetAdapterCount()

static UINT WINAPI d3d8_GetAdapterCount ( IDirect3D8 *  iface)
static

Definition at line 104 of file directx.c.

105 {
106  struct d3d8 *d3d8 = impl_from_IDirect3D8(iface);
107  HRESULT hr;
108 
109  TRACE("iface %p.\n", iface);
110 
114 
115  return hr;
116 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
static struct d3d8 * impl_from_IDirect3D8(IDirect3D8 *iface)
Definition: directx.c:38
struct wined3d * wined3d
Definition: d3d8_private.h:51
UINT CDECL wined3d_get_adapter_count(const struct wined3d *wined3d)
Definition: directx.c:4484
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_GetAdapterDisplayMode()

static HRESULT WINAPI d3d8_GetAdapterDisplayMode ( IDirect3D8 *  iface,
UINT  adapter,
D3DDISPLAYMODE mode 
)
static

Definition at line 190 of file directx.c.

191 {
192  struct d3d8 *d3d8 = impl_from_IDirect3D8(iface);
193  struct wined3d_display_mode wined3d_mode;
194  HRESULT hr;
195 
196  TRACE("iface %p, adapter %u, mode %p.\n",
197  iface, adapter, mode);
198 
200  hr = wined3d_get_adapter_display_mode(d3d8->wined3d, adapter, &wined3d_mode, NULL);
202 
203  if (SUCCEEDED(hr))
204  {
205  mode->Width = wined3d_mode.width;
206  mode->Height = wined3d_mode.height;
207  mode->RefreshRate = wined3d_mode.refresh_rate;
208  mode->Format = d3dformat_from_wined3dformat(wined3d_mode.format_id);
209  }
210 
211  return hr;
212 }
HRESULT CDECL wined3d_get_adapter_display_mode(const struct wined3d *wined3d, UINT adapter_idx, struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation)
Definition: directx.c:4767
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
static struct d3d8 * impl_from_IDirect3D8(IDirect3D8 *iface)
Definition: directx.c:38
struct wined3d * wined3d
Definition: d3d8_private.h:51
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
GLenum mode
Definition: glext.h:6217
D3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN
Definition: device.c:44
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ d3d8_GetAdapterIdentifier()

static HRESULT WINAPI d3d8_GetAdapterIdentifier ( IDirect3D8 *  iface,
UINT  adapter,
DWORD  flags,
D3DADAPTER_IDENTIFIER8 identifier 
)
static

Definition at line 118 of file directx.c.

120 {
121  struct d3d8 *d3d8 = impl_from_IDirect3D8(iface);
122  struct wined3d_adapter_identifier adapter_id;
123  HRESULT hr;
124 
125  TRACE("iface %p, adapter %u, flags %#x, identifier %p.\n",
126  iface, adapter, flags, identifier);
127 
128  adapter_id.driver = identifier->Driver;
129  adapter_id.driver_size = sizeof(identifier->Driver);
130  adapter_id.description = identifier->Description;
131  adapter_id.description_size = sizeof(identifier->Description);
132  adapter_id.device_name = NULL; /* d3d9 only */
133  adapter_id.device_name_size = 0; /* d3d9 only */
134 
136  hr = wined3d_get_adapter_identifier(d3d8->wined3d, adapter, flags, &adapter_id);
138 
139  identifier->DriverVersion = adapter_id.driver_version;
140  identifier->VendorId = adapter_id.vendor_id;
141  identifier->DeviceId = adapter_id.device_id;
142  identifier->SubSysId = adapter_id.subsystem_id;
143  identifier->Revision = adapter_id.revision;
144  memcpy(&identifier->DeviceIdentifier, &adapter_id.device_identifier, sizeof(identifier->DeviceIdentifier));
145  identifier->WHQLLevel = adapter_id.whql_level;
146 
147  return hr;
148 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
char Description[MAX_DEVICE_IDENTIFIER_STRING]
Definition: d3d8types.h:997
static struct d3d8 * impl_from_IDirect3D8(IDirect3D8 *iface)
Definition: directx.c:38
struct wined3d * wined3d
Definition: d3d8_private.h:51
smooth NULL
Definition: ftsmooth.c:416
HRESULT CDECL wined3d_get_adapter_identifier(const struct wined3d *wined3d, UINT adapter_idx, DWORD flags, struct wined3d_adapter_identifier *identifier)
Definition: directx.c:4939
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
GLbitfield flags
Definition: glext.h:7161
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
LARGE_INTEGER DriverVersion
Definition: d3d8types.h:999
char Driver[MAX_DEVICE_IDENTIFIER_STRING]
Definition: d3d8types.h:996
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_GetAdapterModeCount()

static UINT WINAPI d3d8_GetAdapterModeCount ( IDirect3D8 *  iface,
UINT  adapter 
)
static

Definition at line 150 of file directx.c.

151 {
152  struct d3d8 *d3d8 = impl_from_IDirect3D8(iface);
153  HRESULT hr;
154 
155  TRACE("iface %p, adapter %u.\n", iface, adapter);
156 
161 
162  return hr;
163 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
static struct d3d8 * impl_from_IDirect3D8(IDirect3D8 *iface)
Definition: directx.c:38
struct wined3d * wined3d
Definition: d3d8_private.h:51
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
UINT CDECL wined3d_get_adapter_mode_count(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_format_id format_id, enum wined3d_scanline_ordering scanline_ordering)
Definition: directx.c:4536
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_GetAdapterMonitor()

static HMONITOR WINAPI d3d8_GetAdapterMonitor ( IDirect3D8 *  iface,
UINT  adapter 
)
static

Definition at line 344 of file directx.c.

345 {
346  struct d3d8 *d3d8 = impl_from_IDirect3D8(iface);
347  struct wined3d_output_desc desc;
348  HRESULT hr;
349 
350  TRACE("iface %p, adapter %u.\n", iface, adapter);
351 
353  hr = wined3d_get_output_desc(d3d8->wined3d, adapter, &desc);
355 
356  if (FAILED(hr))
357  {
358  WARN("Failed to get output desc, hr %#x.\n", hr);
359  return NULL;
360  }
361 
362  return desc.monitor;
363 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
static struct d3d8 * impl_from_IDirect3D8(IDirect3D8 *iface)
Definition: directx.c:38
struct wined3d * wined3d
Definition: d3d8_private.h:51
static const WCHAR desc[]
Definition: protectdata.c:36
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
HRESULT CDECL wined3d_get_output_desc(const struct wined3d *wined3d, unsigned int adapter_idx, struct wined3d_output_desc *desc)
Definition: directx.c:4499
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_GetDeviceCaps()

static HRESULT WINAPI d3d8_GetDeviceCaps ( IDirect3D8 *  iface,
UINT  adapter,
D3DDEVTYPE  device_type,
D3DCAPS8 caps 
)
static

Definition at line 324 of file directx.c.

325 {
326  struct d3d8 *d3d8 = impl_from_IDirect3D8(iface);
327  WINED3DCAPS wined3d_caps;
328  HRESULT hr;
329 
330  TRACE("iface %p, adapter %u, device_type %#x, caps %p.\n", iface, adapter, device_type, caps);
331 
332  if (!caps)
333  return D3DERR_INVALIDCALL;
334 
336  hr = wined3d_get_device_caps(d3d8->wined3d, adapter, device_type, &wined3d_caps);
338 
339  d3dcaps_from_wined3dcaps(caps, &wined3d_caps);
340 
341  return hr;
342 }
HRESULT hr
Definition: shlfolder.c:183
device_type
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DERR_INVALIDCALL
HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, WINED3DCAPS *caps)
Definition: directx.c:5659
static struct d3d8 * impl_from_IDirect3D8(IDirect3D8 *iface)
Definition: directx.c:38
struct wined3d * wined3d
Definition: d3d8_private.h:51
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
void d3dcaps_from_wined3dcaps(D3DCAPS8 *caps, const WINED3DCAPS *wined3d_caps) DECLSPEC_HIDDEN
Definition: device.c:290
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_init()

BOOL d3d8_init ( struct d3d8 d3d8)

Definition at line 415 of file directx.c.

416 {
421 
422  d3d8->IDirect3D8_iface.lpVtbl = &d3d8_vtbl;
423  d3d8->refcount = 1;
424 
428  if (!d3d8->wined3d)
429  return FALSE;
430 
431  return TRUE;
432 }
#define TRUE
Definition: types.h:120
#define WINED3D_LEGACY_DEPTH_BIAS
Definition: wined3d.h:1315
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
LONG refcount
Definition: d3d8_private.h:50
#define WINED3D_HANDLE_RESTORE
Definition: wined3d.h:1321
struct wined3d * wined3d
Definition: d3d8_private.h:51
struct wined3d *CDECL wined3d_create(DWORD flags)
Definition: wined3d_main.c:97
#define WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR
Definition: wined3d.h:1325
#define WINED3D_PIXEL_CENTER_INTEGER
Definition: wined3d.h:1322
IDirect3D8 IDirect3D8_iface
Definition: d3d8_private.h:49
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WINED3D_LEGACY_CUBEMAP_FILTERING
Definition: wined3d.h:1327
GLbitfield flags
Definition: glext.h:7161
#define WINED3D_LIMIT_VIEWPORT
Definition: wined3d.h:1330
#define WINED3D_NO_PRIMITIVE_RESTART
Definition: wined3d.h:1326
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define WINED3D_VIDMEM_ACCOUNTING
Definition: wined3d.h:1317
static const struct IDirect3D8Vtbl d3d8_vtbl
Definition: directx.c:393

Referenced by Direct3DCreate8().

◆ d3d8_QueryInterface()

static HRESULT WINAPI d3d8_QueryInterface ( IDirect3D8 *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 43 of file directx.c.

44 {
45  TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
46 
47  if (IsEqualGUID(riid, &IID_IDirect3D8)
49  {
50  IDirect3D8_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: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 S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#define IDirect3D8_AddRef(p)
Definition: d3d8.h:160

◆ d3d8_RegisterSoftwareDevice()

static HRESULT WINAPI d3d8_RegisterSoftwareDevice ( IDirect3D8 *  iface,
void init_function 
)
static

Definition at line 90 of file directx.c.

91 {
92  struct d3d8 *d3d8 = impl_from_IDirect3D8(iface);
93  HRESULT hr;
94 
95  TRACE("iface %p, init_function %p.\n", iface, init_function);
96 
100 
101  return hr;
102 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
static struct d3d8 * impl_from_IDirect3D8(IDirect3D8 *iface)
Definition: directx.c:38
struct wined3d * wined3d
Definition: d3d8_private.h:51
HRESULT CDECL wined3d_register_software_device(struct wined3d *wined3d, void *init_function)
Definition: directx.c:4492
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d8_Release()

static ULONG WINAPI d3d8_Release ( IDirect3D8 *  iface)
static

Definition at line 71 of file directx.c.

72 {
73  struct d3d8 *d3d8 = impl_from_IDirect3D8(iface);
75 
76  TRACE("%p decreasing refcount to %u.\n", iface, refcount);
77 
78  if (!refcount)
79  {
83 
84  heap_free(d3d8);
85  }
86 
87  return refcount;
88 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
LONG refcount
Definition: d3d8_private.h:50
static struct d3d8 * impl_from_IDirect3D8(IDirect3D8 *iface)
Definition: directx.c:38
struct wined3d * wined3d
Definition: d3d8_private.h:51
#define TRACE(s)
Definition: solgame.cpp:4
ULONG CDECL wined3d_decref(struct wined3d *wined3d)
Definition: directx.c:465
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ impl_from_IDirect3D8()

static struct d3d8* impl_from_IDirect3D8 ( IDirect3D8 *  iface)
inlinestatic

Definition at line 38 of file directx.c.

39 {
40  return CONTAINING_RECORD(iface, struct d3d8, IDirect3D8_iface);
41 }
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
IDirect3D8 IDirect3D8_iface
Definition: d3d8_private.h:49

Referenced by d3d8_AddRef(), d3d8_CheckDepthStencilMatch(), d3d8_CheckDeviceFormat(), d3d8_CheckDeviceMultiSampleType(), d3d8_CheckDeviceType(), d3d8_CreateDevice(), d3d8_EnumAdapterModes(), d3d8_GetAdapterCount(), d3d8_GetAdapterDisplayMode(), d3d8_GetAdapterIdentifier(), d3d8_GetAdapterModeCount(), d3d8_GetAdapterMonitor(), d3d8_GetDeviceCaps(), d3d8_RegisterSoftwareDevice(), and d3d8_Release().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( d3d8  )

Variable Documentation

◆ d3d8_vtbl

const struct IDirect3D8Vtbl d3d8_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI d3d8_GetAdapterIdentifier(IDirect3D8 *iface, UINT adapter, DWORD flags, D3DADAPTER_IDENTIFIER8 *identifier)
Definition: directx.c:118
static UINT WINAPI d3d8_GetAdapterCount(IDirect3D8 *iface)
Definition: directx.c:104
static HRESULT WINAPI d3d8_CheckDeviceType(IDirect3D8 *iface, UINT adapter, D3DDEVTYPE device_type, D3DFORMAT display_format, D3DFORMAT backbuffer_format, BOOL windowed)
Definition: directx.c:214
static HRESULT WINAPI d3d8_RegisterSoftwareDevice(IDirect3D8 *iface, void *init_function)
Definition: directx.c:90
static HRESULT WINAPI d3d8_GetAdapterDisplayMode(IDirect3D8 *iface, UINT adapter, D3DDISPLAYMODE *mode)
Definition: directx.c:190
static HRESULT WINAPI d3d8_CreateDevice(IDirect3D8 *iface, UINT adapter, D3DDEVTYPE device_type, HWND focus_window, DWORD flags, D3DPRESENT_PARAMETERS *parameters, IDirect3DDevice8 **device)
Definition: directx.c:365
static HRESULT WINAPI d3d8_CheckDeviceMultiSampleType(IDirect3D8 *iface, UINT adapter, D3DDEVTYPE device_type, D3DFORMAT format, BOOL windowed, D3DMULTISAMPLE_TYPE multisample_type)
Definition: directx.c:285
static HRESULT WINAPI d3d8_CheckDeviceFormat(IDirect3D8 *iface, UINT adapter, D3DDEVTYPE device_type, D3DFORMAT adapter_format, DWORD usage, D3DRESOURCETYPE resource_type, D3DFORMAT format)
Definition: directx.c:234
static ULONG WINAPI d3d8_Release(IDirect3D8 *iface)
Definition: directx.c:71
static HRESULT WINAPI d3d8_GetDeviceCaps(IDirect3D8 *iface, UINT adapter, D3DDEVTYPE device_type, D3DCAPS8 *caps)
Definition: directx.c:324
static HRESULT WINAPI d3d8_QueryInterface(IDirect3D8 *iface, REFIID riid, void **out)
Definition: directx.c:43
static HRESULT WINAPI d3d8_CheckDepthStencilMatch(IDirect3D8 *iface, UINT adapter, D3DDEVTYPE device_type, D3DFORMAT adapter_format, D3DFORMAT rt_format, D3DFORMAT ds_format)
Definition: directx.c:306
static ULONG WINAPI d3d8_AddRef(IDirect3D8 *iface)
Definition: directx.c:61
static HMONITOR WINAPI d3d8_GetAdapterMonitor(IDirect3D8 *iface, UINT adapter)
Definition: directx.c:344
static HRESULT WINAPI d3d8_EnumAdapterModes(IDirect3D8 *iface, UINT adapter, UINT mode_idx, D3DDISPLAYMODE *mode)
Definition: directx.c:165
static UINT WINAPI d3d8_GetAdapterModeCount(IDirect3D8 *iface, UINT adapter)
Definition: directx.c:150

Definition at line 393 of file directx.c.

Referenced by d3d8_init().