ReactOS 0.4.16-dev-297-gc569aee
ddraw.c File Reference
#include "config.h"
#include "wine/port.h"
#include "ddraw_private.h"
#include "wine/exception.h"
Include dependency graph for ddraw.c:

Go to the source code of this file.

Classes

struct  enum_device_entry
 
struct  displaymodescallback_context
 
struct  surfacescallback2_context
 
struct  surfacescallback_context
 

Macros

#define CMP(FLAG, FIELD)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ddraw)
 
static void STDMETHODCALLTYPE ddraw_null_wined3d_object_destroyed (void *parent)
 
static struct ddrawimpl_from_IDirectDraw (IDirectDraw *iface)
 
static struct ddrawimpl_from_IDirectDraw2 (IDirectDraw2 *iface)
 
static struct ddrawimpl_from_IDirectDraw4 (IDirectDraw4 *iface)
 
static struct ddrawimpl_from_IDirectDraw7 (IDirectDraw7 *iface)
 
static struct ddrawimpl_from_IDirect3D (IDirect3D *iface)
 
static struct ddrawimpl_from_IDirect3D2 (IDirect3D2 *iface)
 
static struct ddrawimpl_from_IDirect3D3 (IDirect3D3 *iface)
 
static struct ddrawimpl_from_IDirect3D7 (IDirect3D7 *iface)
 
static HRESULT WINAPI ddraw7_QueryInterface (IDirectDraw7 *iface, REFIID riid, void **out)
 
static HRESULT WINAPI ddraw4_QueryInterface (IDirectDraw4 *iface, REFIID riid, void **object)
 
static HRESULT WINAPI ddraw2_QueryInterface (IDirectDraw2 *iface, REFIID riid, void **object)
 
static HRESULT WINAPI ddraw1_QueryInterface (IDirectDraw *iface, REFIID riid, void **object)
 
static HRESULT WINAPI d3d7_QueryInterface (IDirect3D7 *iface, REFIID riid, void **object)
 
static HRESULT WINAPI d3d3_QueryInterface (IDirect3D3 *iface, REFIID riid, void **object)
 
static HRESULT WINAPI d3d2_QueryInterface (IDirect3D2 *iface, REFIID riid, void **object)
 
static HRESULT WINAPI d3d1_QueryInterface (IDirect3D *iface, REFIID riid, void **object)
 
static ULONG WINAPI ddraw7_AddRef (IDirectDraw7 *iface)
 
static ULONG WINAPI ddraw4_AddRef (IDirectDraw4 *iface)
 
static ULONG WINAPI ddraw2_AddRef (IDirectDraw2 *iface)
 
static ULONG WINAPI ddraw1_AddRef (IDirectDraw *iface)
 
static ULONG WINAPI d3d7_AddRef (IDirect3D7 *iface)
 
static ULONG WINAPI d3d3_AddRef (IDirect3D3 *iface)
 
static ULONG WINAPI d3d2_AddRef (IDirect3D2 *iface)
 
static ULONG WINAPI d3d1_AddRef (IDirect3D *iface)
 
static void ddraw_destroy_swapchain (struct ddraw *ddraw)
 
static void ddraw_destroy (struct ddraw *This)
 
static ULONG WINAPI ddraw7_Release (IDirectDraw7 *iface)
 
static ULONG WINAPI ddraw4_Release (IDirectDraw4 *iface)
 
static ULONG WINAPI ddraw2_Release (IDirectDraw2 *iface)
 
static ULONG WINAPI ddraw1_Release (IDirectDraw *iface)
 
static ULONG WINAPI d3d7_Release (IDirect3D7 *iface)
 
static ULONG WINAPI d3d3_Release (IDirect3D3 *iface)
 
static ULONG WINAPI d3d2_Release (IDirect3D2 *iface)
 
static ULONG WINAPI d3d1_Release (IDirect3D *iface)
 
static HRESULT ddraw_set_focus_window (struct ddraw *ddraw, HWND window)
 
static HRESULT ddraw_attach_d3d_device (struct ddraw *ddraw, struct wined3d_swapchain_desc *swapchain_desc)
 
static HRESULT ddraw_create_swapchain (struct ddraw *ddraw, HWND window, BOOL windowed)
 
static HRESULT WINAPI ddraw7_RestoreDisplayMode (IDirectDraw7 *iface)
 
static HRESULT WINAPI ddraw4_RestoreDisplayMode (IDirectDraw4 *iface)
 
static HRESULT WINAPI ddraw2_RestoreDisplayMode (IDirectDraw2 *iface)
 
static HRESULT WINAPI ddraw1_RestoreDisplayMode (IDirectDraw *iface)
 
static HRESULT ddraw_set_cooperative_level (struct ddraw *ddraw, HWND window, DWORD cooplevel, BOOL restore_mode_on_normal)
 
static HRESULT WINAPI ddraw7_SetCooperativeLevel (IDirectDraw7 *iface, HWND window, DWORD flags)
 
static HRESULT WINAPI ddraw4_SetCooperativeLevel (IDirectDraw4 *iface, HWND window, DWORD flags)
 
static HRESULT WINAPI ddraw2_SetCooperativeLevel (IDirectDraw2 *iface, HWND window, DWORD flags)
 
static HRESULT WINAPI ddraw1_SetCooperativeLevel (IDirectDraw *iface, HWND window, DWORD flags)
 
static HRESULT WINAPI ddraw7_SetDisplayMode (IDirectDraw7 *iface, DWORD width, DWORD height, DWORD bpp, DWORD refresh_rate, DWORD flags)
 
static HRESULT WINAPI ddraw4_SetDisplayMode (IDirectDraw4 *iface, DWORD width, DWORD height, DWORD bpp, DWORD refresh_rate, DWORD flags)
 
static HRESULT WINAPI ddraw2_SetDisplayMode (IDirectDraw2 *iface, DWORD width, DWORD height, DWORD bpp, DWORD refresh_rate, DWORD flags)
 
static HRESULT WINAPI ddraw1_SetDisplayMode (IDirectDraw *iface, DWORD width, DWORD height, DWORD bpp)
 
void ddraw_d3dcaps1_from_7 (D3DDEVICEDESC *caps1, D3DDEVICEDESC7 *caps7)
 
HRESULT ddraw_get_d3dcaps (const struct ddraw *ddraw, D3DDEVICEDESC7 *caps)
 
HRESULT CALLBACK enum_zbuffer (DDPIXELFORMAT *format, void *ctx)
 
static HRESULT WINAPI ddraw7_GetCaps (IDirectDraw7 *iface, DDCAPS *DriverCaps, DDCAPS *HELCaps)
 
static HRESULT WINAPI ddraw4_GetCaps (IDirectDraw4 *iface, DDCAPS *driver_caps, DDCAPS *hel_caps)
 
static HRESULT WINAPI ddraw2_GetCaps (IDirectDraw2 *iface, DDCAPS *driver_caps, DDCAPS *hel_caps)
 
static HRESULT WINAPI ddraw1_GetCaps (IDirectDraw *iface, DDCAPS *driver_caps, DDCAPS *hel_caps)
 
static HRESULT WINAPI ddraw7_Compact (IDirectDraw7 *iface)
 
static HRESULT WINAPI ddraw4_Compact (IDirectDraw4 *iface)
 
static HRESULT WINAPI ddraw2_Compact (IDirectDraw2 *iface)
 
static HRESULT WINAPI ddraw1_Compact (IDirectDraw *iface)
 
static HRESULT WINAPI ddraw7_GetDisplayMode (IDirectDraw7 *iface, DDSURFACEDESC2 *DDSD)
 
static HRESULT WINAPI ddraw4_GetDisplayMode (IDirectDraw4 *iface, DDSURFACEDESC2 *surface_desc)
 
static HRESULT WINAPI ddraw2_GetDisplayMode (IDirectDraw2 *iface, DDSURFACEDESC *surface_desc)
 
static HRESULT WINAPI ddraw1_GetDisplayMode (IDirectDraw *iface, DDSURFACEDESC *surface_desc)
 
static HRESULT WINAPI ddraw7_GetFourCCCodes (IDirectDraw7 *iface, DWORD *NumCodes, DWORD *Codes)
 
static HRESULT WINAPI ddraw4_GetFourCCCodes (IDirectDraw4 *iface, DWORD *codes_count, DWORD *codes)
 
static HRESULT WINAPI ddraw2_GetFourCCCodes (IDirectDraw2 *iface, DWORD *codes_count, DWORD *codes)
 
static HRESULT WINAPI ddraw1_GetFourCCCodes (IDirectDraw *iface, DWORD *codes_count, DWORD *codes)
 
static HRESULT WINAPI ddraw7_GetMonitorFrequency (IDirectDraw7 *iface, DWORD *frequency)
 
static HRESULT WINAPI ddraw4_GetMonitorFrequency (IDirectDraw4 *iface, DWORD *frequency)
 
static HRESULT WINAPI ddraw2_GetMonitorFrequency (IDirectDraw2 *iface, DWORD *frequency)
 
static HRESULT WINAPI ddraw1_GetMonitorFrequency (IDirectDraw *iface, DWORD *frequency)
 
static HRESULT WINAPI ddraw7_GetVerticalBlankStatus (IDirectDraw7 *iface, BOOL *status)
 
static HRESULT WINAPI ddraw4_GetVerticalBlankStatus (IDirectDraw4 *iface, BOOL *status)
 
static HRESULT WINAPI ddraw2_GetVerticalBlankStatus (IDirectDraw2 *iface, BOOL *status)
 
static HRESULT WINAPI ddraw1_GetVerticalBlankStatus (IDirectDraw *iface, BOOL *status)
 
static HRESULT WINAPI ddraw7_GetAvailableVidMem (IDirectDraw7 *iface, DDSCAPS2 *caps, DWORD *total, DWORD *free)
 
static HRESULT WINAPI ddraw4_GetAvailableVidMem (IDirectDraw4 *iface, DDSCAPS2 *caps, DWORD *total, DWORD *free)
 
static HRESULT WINAPI ddraw2_GetAvailableVidMem (IDirectDraw2 *iface, DDSCAPS *caps, DWORD *total, DWORD *free)
 
static HRESULT WINAPI ddraw7_Initialize (IDirectDraw7 *iface, GUID *guid)
 
static HRESULT WINAPI ddraw4_Initialize (IDirectDraw4 *iface, GUID *guid)
 
static HRESULT WINAPI ddraw2_Initialize (IDirectDraw2 *iface, GUID *guid)
 
static HRESULT WINAPI ddraw1_Initialize (IDirectDraw *iface, GUID *guid)
 
static HRESULT WINAPI d3d1_Initialize (IDirect3D *iface, REFIID riid)
 
static HRESULT WINAPI ddraw7_FlipToGDISurface (IDirectDraw7 *iface)
 
static HRESULT WINAPI ddraw4_FlipToGDISurface (IDirectDraw4 *iface)
 
static HRESULT WINAPI ddraw2_FlipToGDISurface (IDirectDraw2 *iface)
 
static HRESULT WINAPI ddraw1_FlipToGDISurface (IDirectDraw *iface)
 
static HRESULT WINAPI ddraw7_WaitForVerticalBlank (IDirectDraw7 *iface, DWORD Flags, HANDLE event)
 
static HRESULT WINAPI ddraw4_WaitForVerticalBlank (IDirectDraw4 *iface, DWORD flags, HANDLE event)
 
static HRESULT WINAPI ddraw2_WaitForVerticalBlank (IDirectDraw2 *iface, DWORD flags, HANDLE event)
 
static HRESULT WINAPI ddraw1_WaitForVerticalBlank (IDirectDraw *iface, DWORD flags, HANDLE event)
 
static HRESULT WINAPI ddraw7_GetScanLine (IDirectDraw7 *iface, DWORD *Scanline)
 
static HRESULT WINAPI ddraw4_GetScanLine (IDirectDraw4 *iface, DWORD *line)
 
static HRESULT WINAPI ddraw2_GetScanLine (IDirectDraw2 *iface, DWORD *line)
 
static HRESULT WINAPI ddraw1_GetScanLine (IDirectDraw *iface, DWORD *line)
 
static HRESULT WINAPI ddraw7_TestCooperativeLevel (IDirectDraw7 *iface)
 
static HRESULT WINAPI ddraw4_TestCooperativeLevel (IDirectDraw4 *iface)
 
static HRESULT WINAPI ddraw7_GetGDISurface (IDirectDraw7 *iface, IDirectDrawSurface7 **GDISurface)
 
static HRESULT WINAPI ddraw4_GetGDISurface (IDirectDraw4 *iface, IDirectDrawSurface4 **surface)
 
static HRESULT WINAPI ddraw2_GetGDISurface (IDirectDraw2 *iface, IDirectDrawSurface **surface)
 
static HRESULT WINAPI ddraw1_GetGDISurface (IDirectDraw *iface, IDirectDrawSurface **surface)
 
static HRESULT CALLBACK EnumDisplayModesCallbackThunk (DDSURFACEDESC2 *surface_desc, void *context)
 
static HRESULT WINAPI ddraw7_EnumDisplayModes (IDirectDraw7 *iface, DWORD Flags, DDSURFACEDESC2 *DDSD, void *Context, LPDDENUMMODESCALLBACK2 cb)
 
static HRESULT WINAPI ddraw4_EnumDisplayModes (IDirectDraw4 *iface, DWORD flags, DDSURFACEDESC2 *surface_desc, void *context, LPDDENUMMODESCALLBACK2 callback)
 
static HRESULT WINAPI ddraw2_EnumDisplayModes (IDirectDraw2 *iface, DWORD flags, DDSURFACEDESC *surface_desc, void *context, LPDDENUMMODESCALLBACK callback)
 
static HRESULT WINAPI ddraw1_EnumDisplayModes (IDirectDraw *iface, DWORD flags, DDSURFACEDESC *surface_desc, void *context, LPDDENUMMODESCALLBACK callback)
 
static HRESULT WINAPI ddraw7_EvaluateMode (IDirectDraw7 *iface, DWORD Flags, DWORD *Timeout)
 
static HRESULT WINAPI ddraw7_GetDeviceIdentifier (IDirectDraw7 *iface, DDDEVICEIDENTIFIER2 *DDDI, DWORD Flags)
 
static HRESULT WINAPI ddraw4_GetDeviceIdentifier (IDirectDraw4 *iface, DDDEVICEIDENTIFIER *identifier, DWORD flags)
 
static HRESULT WINAPI ddraw7_GetSurfaceFromDC (IDirectDraw7 *iface, HDC dc, IDirectDrawSurface7 **surface)
 
static HRESULT WINAPI ddraw4_GetSurfaceFromDC (IDirectDraw4 *iface, HDC dc, IDirectDrawSurface4 **surface)
 
static HRESULT CALLBACK restore_callback (IDirectDrawSurface7 *surface, DDSURFACEDESC2 *desc, void *context)
 
static HRESULT WINAPI ddraw7_RestoreAllSurfaces (IDirectDraw7 *iface)
 
static HRESULT WINAPI ddraw4_RestoreAllSurfaces (IDirectDraw4 *iface)
 
static HRESULT WINAPI ddraw7_StartModeTest (IDirectDraw7 *iface, SIZE *Modes, DWORD NumModes, DWORD Flags)
 
static HRESULT WINAPI ddraw7_CreateSurface (IDirectDraw7 *iface, DDSURFACEDESC2 *surface_desc, IDirectDrawSurface7 **surface, IUnknown *outer_unknown)
 
static HRESULT WINAPI ddraw4_CreateSurface (IDirectDraw4 *iface, DDSURFACEDESC2 *surface_desc, IDirectDrawSurface4 **surface, IUnknown *outer_unknown)
 
static HRESULT WINAPI ddraw2_CreateSurface (IDirectDraw2 *iface, DDSURFACEDESC *surface_desc, IDirectDrawSurface **surface, IUnknown *outer_unknown)
 
static HRESULT WINAPI ddraw1_CreateSurface (IDirectDraw *iface, DDSURFACEDESC *surface_desc, IDirectDrawSurface **surface, IUnknown *outer_unknown)
 
static BOOL Main_DirectDraw_DDPIXELFORMAT_Match (const DDPIXELFORMAT *requested, const DDPIXELFORMAT *provided)
 
static BOOL ddraw_match_surface_desc (const DDSURFACEDESC2 *requested, const DDSURFACEDESC2 *provided)
 
static HRESULT CALLBACK EnumSurfacesCallback2Thunk (IDirectDrawSurface7 *surface, DDSURFACEDESC2 *surface_desc, void *context)
 
static HRESULT CALLBACK EnumSurfacesCallbackThunk (IDirectDrawSurface7 *surface, DDSURFACEDESC2 *surface_desc, void *context)
 
static HRESULT WINAPI ddraw7_EnumSurfaces (IDirectDraw7 *iface, DWORD Flags, DDSURFACEDESC2 *DDSD, void *Context, LPDDENUMSURFACESCALLBACK7 Callback)
 
static HRESULT WINAPI ddraw4_EnumSurfaces (IDirectDraw4 *iface, DWORD flags, DDSURFACEDESC2 *surface_desc, void *context, LPDDENUMSURFACESCALLBACK2 callback)
 
static HRESULT WINAPI ddraw2_EnumSurfaces (IDirectDraw2 *iface, DWORD flags, DDSURFACEDESC *surface_desc, void *context, LPDDENUMSURFACESCALLBACK callback)
 
static HRESULT WINAPI ddraw1_EnumSurfaces (IDirectDraw *iface, DWORD flags, DDSURFACEDESC *surface_desc, void *context, LPDDENUMSURFACESCALLBACK callback)
 
HRESULT WINAPI DirectDrawCreateClipper (DWORD flags, IDirectDrawClipper **clipper, IUnknown *outer_unknown)
 
static HRESULT WINAPI ddraw7_CreateClipper (IDirectDraw7 *iface, DWORD Flags, IDirectDrawClipper **Clipper, IUnknown *UnkOuter)
 
static HRESULT WINAPI ddraw4_CreateClipper (IDirectDraw4 *iface, DWORD flags, IDirectDrawClipper **clipper, IUnknown *outer_unknown)
 
static HRESULT WINAPI ddraw2_CreateClipper (IDirectDraw2 *iface, DWORD flags, IDirectDrawClipper **clipper, IUnknown *outer_unknown)
 
static HRESULT WINAPI ddraw1_CreateClipper (IDirectDraw *iface, DWORD flags, IDirectDrawClipper **clipper, IUnknown *outer_unknown)
 
static HRESULT WINAPI ddraw7_CreatePalette (IDirectDraw7 *iface, DWORD Flags, PALETTEENTRY *ColorTable, IDirectDrawPalette **Palette, IUnknown *pUnkOuter)
 
static HRESULT WINAPI ddraw4_CreatePalette (IDirectDraw4 *iface, DWORD flags, PALETTEENTRY *entries, IDirectDrawPalette **palette, IUnknown *outer_unknown)
 
static HRESULT WINAPI ddraw2_CreatePalette (IDirectDraw2 *iface, DWORD flags, PALETTEENTRY *entries, IDirectDrawPalette **palette, IUnknown *outer_unknown)
 
static HRESULT WINAPI ddraw1_CreatePalette (IDirectDraw *iface, DWORD flags, PALETTEENTRY *entries, IDirectDrawPalette **palette, IUnknown *outer_unknown)
 
static HRESULT WINAPI ddraw7_DuplicateSurface (IDirectDraw7 *iface, IDirectDrawSurface7 *Src, IDirectDrawSurface7 **Dest)
 
static HRESULT WINAPI ddraw4_DuplicateSurface (IDirectDraw4 *iface, IDirectDrawSurface4 *src, IDirectDrawSurface4 **dst)
 
static HRESULT WINAPI ddraw2_DuplicateSurface (IDirectDraw2 *iface, IDirectDrawSurface *src, IDirectDrawSurface **dst)
 
static HRESULT WINAPI ddraw1_DuplicateSurface (IDirectDraw *iface, IDirectDrawSurface *src, IDirectDrawSurface **dst)
 
static HRESULT WINAPI d3d7_EnumDevices (IDirect3D7 *iface, LPD3DENUMDEVICESCALLBACK7 callback, void *context)
 
static HRESULT WINAPI d3d3_EnumDevices (IDirect3D3 *iface, LPD3DENUMDEVICESCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d2_EnumDevices (IDirect3D2 *iface, LPD3DENUMDEVICESCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d1_EnumDevices (IDirect3D *iface, LPD3DENUMDEVICESCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d3_CreateLight (IDirect3D3 *iface, IDirect3DLight **light, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d2_CreateLight (IDirect3D2 *iface, IDirect3DLight **light, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d1_CreateLight (IDirect3D *iface, IDirect3DLight **light, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d3_CreateMaterial (IDirect3D3 *iface, IDirect3DMaterial3 **material, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d2_CreateMaterial (IDirect3D2 *iface, IDirect3DMaterial2 **material, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d1_CreateMaterial (IDirect3D *iface, IDirect3DMaterial **material, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d3_CreateViewport (IDirect3D3 *iface, IDirect3DViewport3 **viewport, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d2_CreateViewport (IDirect3D2 *iface, IDirect3DViewport2 **viewport, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d1_CreateViewport (IDirect3D *iface, IDirect3DViewport **viewport, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d3_FindDevice (IDirect3D3 *iface, D3DFINDDEVICESEARCH *fds, D3DFINDDEVICERESULT *fdr)
 
static HRESULT WINAPI d3d2_FindDevice (IDirect3D2 *iface, D3DFINDDEVICESEARCH *fds, D3DFINDDEVICERESULT *fdr)
 
static HRESULT WINAPI d3d1_FindDevice (IDirect3D *iface, D3DFINDDEVICESEARCH *fds, D3DFINDDEVICERESULT *fdr)
 
static HRESULT WINAPI d3d7_CreateDevice (IDirect3D7 *iface, REFCLSID riid, IDirectDrawSurface7 *surface, IDirect3DDevice7 **device)
 
static HRESULT WINAPI d3d3_CreateDevice (IDirect3D3 *iface, REFCLSID riid, IDirectDrawSurface4 *surface, IDirect3DDevice3 **device, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d2_CreateDevice (IDirect3D2 *iface, REFCLSID riid, IDirectDrawSurface *surface, IDirect3DDevice2 **device)
 
static HRESULT WINAPI d3d7_CreateVertexBuffer (IDirect3D7 *iface, D3DVERTEXBUFFERDESC *desc, IDirect3DVertexBuffer7 **vertex_buffer, DWORD flags)
 
static HRESULT WINAPI d3d3_CreateVertexBuffer (IDirect3D3 *iface, D3DVERTEXBUFFERDESC *desc, IDirect3DVertexBuffer **vertex_buffer, DWORD flags, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d7_EnumZBufferFormats (IDirect3D7 *iface, REFCLSID device_iid, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d3_EnumZBufferFormats (IDirect3D3 *iface, REFCLSID device_iid, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d7_EvictManagedTextures (IDirect3D7 *iface)
 
static HRESULT WINAPI d3d3_EvictManagedTextures (IDirect3D3 *iface)
 
struct wined3d_vertex_declarationddraw_find_decl (struct ddraw *This, DWORD fvf)
 
static struct ddrawddraw_from_device_parent (struct wined3d_device_parent *device_parent)
 
static void CDECL device_parent_wined3d_device_created (struct wined3d_device_parent *device_parent, struct wined3d_device *device)
 
static void CDECL device_parent_mode_changed (struct wined3d_device_parent *device_parent)
 
static void CDECL device_parent_activate (struct wined3d_device_parent *device_parent, BOOL activate)
 
void ddraw_update_lost_surfaces (struct ddraw *ddraw)
 
static HRESULT CDECL device_parent_surface_created (struct wined3d_device_parent *device_parent, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, void **parent, const struct wined3d_parent_ops **parent_ops)
 
static HRESULT CDECL device_parent_volume_created (struct wined3d_device_parent *device_parent, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, void **parent, const struct wined3d_parent_ops **parent_ops)
 
static void STDMETHODCALLTYPE ddraw_frontbuffer_destroyed (void *parent)
 
static HRESULT CDECL device_parent_create_swapchain_texture (struct wined3d_device_parent *device_parent, void *container_parent, const struct wined3d_resource_desc *desc, DWORD texture_flags, struct wined3d_texture **texture)
 
static HRESULT CDECL device_parent_create_swapchain (struct wined3d_device_parent *device_parent, struct wined3d_swapchain_desc *desc, struct wined3d_swapchain **swapchain)
 
HRESULT ddraw_init (struct ddraw *ddraw, DWORD flags, enum wined3d_device_type device_type)
 

Variables

static const struct ddrawexclusive_ddraw
 
static HWND exclusive_window
 
static const DDDEVICEIDENTIFIER2 deviceidentifier
 
static struct enum_device_entry device_list7 []
 
const struct wined3d_parent_ops ddraw_null_wined3d_parent_ops
 
static const struct IDirectDraw7Vtbl ddraw7_vtbl
 
static const struct IDirectDraw4Vtbl ddraw4_vtbl
 
static const struct IDirectDraw2Vtbl ddraw2_vtbl
 
static struct IDirectDrawVtbl ddraw1_vtbl
 
static const struct IDirect3D7Vtbl d3d7_vtbl
 
static const struct IDirect3D3Vtbl d3d3_vtbl
 
static const struct IDirect3D2Vtbl d3d2_vtbl
 
static const struct IDirect3DVtbl d3d1_vtbl
 
static const struct wined3d_parent_ops ddraw_frontbuffer_parent_ops
 
static const struct wined3d_device_parent_ops ddraw_wined3d_device_parent_ops
 

Macro Definition Documentation

◆ CMP

#define CMP (   FLAG,
  FIELD 
)
Value:
{ DDSD_##FLAG, offsetof(DDSURFACEDESC2, FIELD), \
sizeof(((DDSURFACEDESC2 *)(NULL))->FIELD) }
#define FLAG
Definition: main.h:130
#define NULL
Definition: types.h:112
#define offsetof(TYPE, MEMBER)

Function Documentation

◆ d3d1_AddRef()

static ULONG WINAPI d3d1_AddRef ( IDirect3D *  iface)
static

Definition at line 359 of file ddraw.c.

360{
361 struct ddraw *This = impl_from_IDirect3D(iface);
362
363 TRACE("iface %p.\n", iface);
364
365 return ddraw1_AddRef(&This->IDirectDraw_iface);
366}
static struct ddraw * impl_from_IDirect3D(IDirect3D *iface)
Definition: ddraw.c:108
static ULONG WINAPI ddraw1_AddRef(IDirectDraw *iface)
Definition: ddraw.c:320
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d1_CreateLight()

static HRESULT WINAPI d3d1_CreateLight ( IDirect3D *  iface,
IDirect3DLight **  light,
IUnknown outer_unknown 
)
static

Definition at line 3975 of file ddraw.c.

3976{
3977 struct ddraw *ddraw = impl_from_IDirect3D(iface);
3978
3979 TRACE("iface %p, light %p, outer_unknown %p.\n", iface, light, outer_unknown);
3980
3981 return d3d3_CreateLight(&ddraw->IDirect3D3_iface, light, outer_unknown);
3982}
static HRESULT WINAPI d3d3_CreateLight(IDirect3D3 *iface, IDirect3DLight **light, IUnknown *outer_unknown)
Definition: ddraw.c:3941
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum light
Definition: glfuncs.h:170
IDirect3D3 IDirect3D3_iface
Definition: ddraw_private.h:84

◆ d3d1_CreateMaterial()

static HRESULT WINAPI d3d1_CreateMaterial ( IDirect3D *  iface,
IDirect3DMaterial **  material,
IUnknown outer_unknown 
)
static

Definition at line 4048 of file ddraw.c.

4050{
4051 struct ddraw *ddraw = impl_from_IDirect3D(iface);
4052 struct d3d_material *object;
4053
4054 TRACE("iface %p, material %p, outer_unknown %p.\n", iface, material, outer_unknown);
4055
4056 object = d3d_material_create(ddraw);
4057 if (!object)
4058 {
4059 ERR("Failed to allocate material memory.\n");
4060 return DDERR_OUTOFMEMORY;
4061 }
4062
4063 TRACE("Created material %p.\n", object);
4064 *material = &object->IDirect3DMaterial_iface;
4065
4066 return D3D_OK;
4067}
#define ERR(fmt,...)
Definition: precomp.h:57
#define D3D_OK
Definition: d3d.h:106
struct d3d_material * d3d_material_create(struct ddraw *ddraw) DECLSPEC_HIDDEN
Definition: material.c:501
#define DDERR_OUTOFMEMORY
Definition: ddraw.h:111

◆ d3d1_CreateViewport()

static HRESULT WINAPI d3d1_CreateViewport ( IDirect3D *  iface,
IDirect3DViewport **  viewport,
IUnknown outer_unknown 
)
static

Definition at line 4123 of file ddraw.c.

4124{
4125 struct ddraw *ddraw = impl_from_IDirect3D(iface);
4126
4127 TRACE("iface %p, viewport %p, outer_unknown %p.\n", iface, viewport, outer_unknown);
4128
4129 return d3d3_CreateViewport(&ddraw->IDirect3D3_iface, (IDirect3DViewport3 **)viewport,
4130 outer_unknown);
4131}
static HRESULT WINAPI d3d3_CreateViewport(IDirect3D3 *iface, IDirect3DViewport3 **viewport, IUnknown *outer_unknown)
Definition: ddraw.c:4089

◆ d3d1_EnumDevices()

static HRESULT WINAPI d3d1_EnumDevices ( IDirect3D *  iface,
LPD3DENUMDEVICESCALLBACK  callback,
void context 
)
static

Definition at line 3911 of file ddraw.c.

3912{
3913 struct ddraw *ddraw = impl_from_IDirect3D(iface);
3914
3915 TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
3916
3918}
static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBACK callback, void *context)
Definition: ddraw.c:3797
static IPrintDialogCallback callback
Definition: printdlg.c:326
Definition: http.c:7252

◆ d3d1_FindDevice()

static HRESULT WINAPI d3d1_FindDevice ( IDirect3D *  iface,
D3DFINDDEVICESEARCH fds,
D3DFINDDEVICERESULT fdr 
)
static

Definition at line 4223 of file ddraw.c.

4224{
4225 struct ddraw *ddraw = impl_from_IDirect3D(iface);
4226
4227 TRACE("iface %p, fds %p, fdr %p.\n", iface, fds, fdr);
4228
4229 return d3d3_FindDevice(&ddraw->IDirect3D3_iface, fds, fdr);
4230}
static HRESULT WINAPI d3d3_FindDevice(IDirect3D3 *iface, D3DFINDDEVICESEARCH *fds, D3DFINDDEVICERESULT *fdr)
Definition: ddraw.c:4149

◆ d3d1_Initialize()

static HRESULT WINAPI d3d1_Initialize ( IDirect3D *  iface,
REFIID  riid 
)
static

Definition at line 2077 of file ddraw.c.

2078{
2079 TRACE("iface %p, riid %s.\n", iface, debugstr_guid(riid));
2080
2082}
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define DDERR_ALREADYINITIALIZED
Definition: ddraw.h:67

◆ d3d1_QueryInterface()

static HRESULT WINAPI d3d1_QueryInterface ( IDirect3D *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 257 of file ddraw.c.

258{
259 struct ddraw *ddraw = impl_from_IDirect3D(iface);
260
261 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
262
264}
static HRESULT WINAPI ddraw7_QueryInterface(IDirectDraw7 *iface, REFIID riid, void **out)
Definition: ddraw.c:128
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ d3d1_Release()

static ULONG WINAPI d3d1_Release ( IDirect3D *  iface)
static

Definition at line 538 of file ddraw.c.

539{
540 struct ddraw *This = impl_from_IDirect3D(iface);
541
542 TRACE("iface %p.\n", iface);
543
544 return ddraw1_Release(&This->IDirectDraw_iface);
545}
static ULONG WINAPI ddraw1_Release(IDirectDraw *iface)
Definition: ddraw.c:498

◆ d3d2_AddRef()

static ULONG WINAPI d3d2_AddRef ( IDirect3D2 *  iface)
static

Definition at line 350 of file ddraw.c.

351{
352 struct ddraw *This = impl_from_IDirect3D2(iface);
353
354 TRACE("iface %p.\n", iface);
355
356 return ddraw1_AddRef(&This->IDirectDraw_iface);
357}
static struct ddraw * impl_from_IDirect3D2(IDirect3D2 *iface)
Definition: ddraw.c:113

◆ d3d2_CreateDevice()

static HRESULT WINAPI d3d2_CreateDevice ( IDirect3D2 *  iface,
REFCLSID  riid,
IDirectDrawSurface *  surface,
IDirect3DDevice2 **  device 
)
static

Definition at line 4307 of file ddraw.c.

4309{
4310 struct ddraw_surface *surface_impl = unsafe_impl_from_IDirectDrawSurface(surface);
4311 struct ddraw *ddraw = impl_from_IDirect3D2(iface);
4312 struct d3d_device *device_impl;
4313 HRESULT hr;
4314
4315 TRACE("iface %p, riid %s, surface %p, device %p.\n",
4316 iface, debugstr_guid(riid), surface, device);
4317
4319 if (SUCCEEDED(hr = d3d_device_create(ddraw, riid, surface_impl, (IUnknown *)surface, 2, &device_impl, NULL)))
4320 {
4321 *device = &device_impl->IDirect3DDevice2_iface;
4322 }
4323 else
4324 {
4325 WARN("Failed to create device, hr %#x.\n", hr);
4326 *device = NULL;
4327 }
4329
4330 return hr;
4331}
#define WARN(fmt,...)
Definition: precomp.h:61
HRESULT d3d_device_create(struct ddraw *ddraw, const GUID *guid, struct ddraw_surface *target, IUnknown *rt_iface, UINT version, struct d3d_device **device, IUnknown *outer_unknown) DECLSPEC_HIDDEN
Definition: device.c:6980
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface(IDirectDrawSurface *iface) DECLSPEC_HIDDEN
Definition: surface.c:5705
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT hr
Definition: shlfolder.c:183
IDirect3DDevice2 IDirect3DDevice2_iface
Definition: devices.h:37
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368

◆ d3d2_CreateLight()

static HRESULT WINAPI d3d2_CreateLight ( IDirect3D2 *  iface,
IDirect3DLight **  light,
IUnknown outer_unknown 
)
static

Definition at line 3966 of file ddraw.c.

3967{
3968 struct ddraw *ddraw = impl_from_IDirect3D2(iface);
3969
3970 TRACE("iface %p, light %p, outer_unknown %p.\n", iface, light, outer_unknown);
3971
3972 return d3d3_CreateLight(&ddraw->IDirect3D3_iface, light, outer_unknown);
3973}

◆ d3d2_CreateMaterial()

static HRESULT WINAPI d3d2_CreateMaterial ( IDirect3D2 *  iface,
IDirect3DMaterial2 **  material,
IUnknown outer_unknown 
)
static

Definition at line 4027 of file ddraw.c.

4029{
4030 struct ddraw *ddraw = impl_from_IDirect3D2(iface);
4031 struct d3d_material *object;
4032
4033 TRACE("iface %p, material %p, outer_unknown %p.\n", iface, material, outer_unknown);
4034
4035 object = d3d_material_create(ddraw);
4036 if (!object)
4037 {
4038 ERR("Failed to allocate material memory.\n");
4039 return DDERR_OUTOFMEMORY;
4040 }
4041
4042 TRACE("Created material %p.\n", object);
4043 *material = &object->IDirect3DMaterial2_iface;
4044
4045 return D3D_OK;
4046}

◆ d3d2_CreateViewport()

static HRESULT WINAPI d3d2_CreateViewport ( IDirect3D2 *  iface,
IDirect3DViewport2 **  viewport,
IUnknown outer_unknown 
)
static

Definition at line 4113 of file ddraw.c.

4114{
4115 struct ddraw *ddraw = impl_from_IDirect3D2(iface);
4116
4117 TRACE("iface %p, viewport %p, outer_unknown %p.\n", iface, viewport, outer_unknown);
4118
4119 return d3d3_CreateViewport(&ddraw->IDirect3D3_iface, (IDirect3DViewport3 **)viewport,
4120 outer_unknown);
4121}

◆ d3d2_EnumDevices()

static HRESULT WINAPI d3d2_EnumDevices ( IDirect3D2 *  iface,
LPD3DENUMDEVICESCALLBACK  callback,
void context 
)
static

Definition at line 3902 of file ddraw.c.

3903{
3904 struct ddraw *ddraw = impl_from_IDirect3D2(iface);
3905
3906 TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
3907
3909}

◆ d3d2_FindDevice()

static HRESULT WINAPI d3d2_FindDevice ( IDirect3D2 *  iface,
D3DFINDDEVICESEARCH fds,
D3DFINDDEVICERESULT fdr 
)
static

Definition at line 4214 of file ddraw.c.

4215{
4216 struct ddraw *ddraw = impl_from_IDirect3D2(iface);
4217
4218 TRACE("iface %p, fds %p, fdr %p.\n", iface, fds, fdr);
4219
4220 return d3d3_FindDevice(&ddraw->IDirect3D3_iface, fds, fdr);
4221}

◆ d3d2_QueryInterface()

static HRESULT WINAPI d3d2_QueryInterface ( IDirect3D2 *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 248 of file ddraw.c.

249{
250 struct ddraw *ddraw = impl_from_IDirect3D2(iface);
251
252 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
253
255}

◆ d3d2_Release()

static ULONG WINAPI d3d2_Release ( IDirect3D2 *  iface)
static

Definition at line 529 of file ddraw.c.

530{
531 struct ddraw *This = impl_from_IDirect3D2(iface);
532
533 TRACE("iface %p.\n", iface);
534
535 return ddraw1_Release(&This->IDirectDraw_iface);
536}

◆ d3d3_AddRef()

static ULONG WINAPI d3d3_AddRef ( IDirect3D3 *  iface)
static

Definition at line 341 of file ddraw.c.

342{
343 struct ddraw *This = impl_from_IDirect3D3(iface);
344
345 TRACE("iface %p.\n", iface);
346
347 return ddraw1_AddRef(&This->IDirectDraw_iface);
348}
static struct ddraw * impl_from_IDirect3D3(IDirect3D3 *iface)
Definition: ddraw.c:118

◆ d3d3_CreateDevice()

static HRESULT WINAPI d3d3_CreateDevice ( IDirect3D3 *  iface,
REFCLSID  riid,
IDirectDrawSurface4 *  surface,
IDirect3DDevice3 **  device,
IUnknown outer_unknown 
)
static

Definition at line 4278 of file ddraw.c.

4280{
4281 struct ddraw_surface *surface_impl = unsafe_impl_from_IDirectDrawSurface4(surface);
4282 struct ddraw *ddraw = impl_from_IDirect3D3(iface);
4283 struct d3d_device *device_impl;
4284 HRESULT hr;
4285
4286 TRACE("iface %p, riid %s, surface %p, device %p, outer_unknown %p.\n",
4287 iface, debugstr_guid(riid), surface, device, outer_unknown);
4288
4289 if (outer_unknown)
4290 return CLASS_E_NOAGGREGATION;
4291
4293 if (SUCCEEDED(hr = d3d_device_create(ddraw, riid, surface_impl, (IUnknown *)surface, 3, &device_impl, NULL)))
4294 {
4295 *device = &device_impl->IDirect3DDevice3_iface;
4296 }
4297 else
4298 {
4299 WARN("Failed to create device, hr %#x.\n", hr);
4300 *device = NULL;
4301 }
4303
4304 return hr;
4305}
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface4(IDirectDrawSurface4 *iface) DECLSPEC_HIDDEN
Definition: surface.c:5657
IUnknown * outer_unknown
IDirect3DDevice3 IDirect3DDevice3_iface
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

◆ d3d3_CreateLight()

static HRESULT WINAPI d3d3_CreateLight ( IDirect3D3 *  iface,
IDirect3DLight **  light,
IUnknown outer_unknown 
)
static

Definition at line 3941 of file ddraw.c.

3943{
3944 struct ddraw *ddraw = impl_from_IDirect3D3(iface);
3945 struct d3d_light *object;
3946
3947 TRACE("iface %p, light %p, outer_unknown %p.\n", iface, light, outer_unknown);
3948
3949 if (outer_unknown)
3950 return CLASS_E_NOAGGREGATION;
3951
3952 if (!(object = heap_alloc_zero(sizeof(*object))))
3953 {
3954 ERR("Failed to allocate light memory.\n");
3955 return DDERR_OUTOFMEMORY;
3956 }
3957
3958 d3d_light_init(object, ddraw);
3959
3960 TRACE("Created light %p.\n", object);
3961 *light = &object->IDirect3DLight_iface;
3962
3963 return D3D_OK;
3964}
void d3d_light_init(struct d3d_light *light, struct ddraw *ddraw) DECLSPEC_HIDDEN
Definition: light.c:247

Referenced by d3d1_CreateLight(), and d3d2_CreateLight().

◆ d3d3_CreateMaterial()

static HRESULT WINAPI d3d3_CreateMaterial ( IDirect3D3 *  iface,
IDirect3DMaterial3 **  material,
IUnknown outer_unknown 
)
static

Definition at line 4004 of file ddraw.c.

4006{
4007 struct ddraw *ddraw = impl_from_IDirect3D3(iface);
4008 struct d3d_material *object;
4009
4010 TRACE("iface %p, material %p, outer_unknown %p.\n", iface, material, outer_unknown);
4011
4012 if (outer_unknown) return CLASS_E_NOAGGREGATION;
4013
4014 object = d3d_material_create(ddraw);
4015 if (!object)
4016 {
4017 ERR("Failed to allocate material memory.\n");
4018 return DDERR_OUTOFMEMORY;
4019 }
4020
4021 TRACE("Created material %p.\n", object);
4022 *material = &object->IDirect3DMaterial3_iface;
4023
4024 return D3D_OK;
4025}

◆ d3d3_CreateVertexBuffer()

static HRESULT WINAPI d3d3_CreateVertexBuffer ( IDirect3D3 *  iface,
D3DVERTEXBUFFERDESC desc,
IDirect3DVertexBuffer **  vertex_buffer,
DWORD  flags,
IUnknown outer_unknown 
)
static

Definition at line 4376 of file ddraw.c.

4378{
4379 struct ddraw *ddraw = impl_from_IDirect3D3(iface);
4380 struct d3d_vertex_buffer *object;
4381 HRESULT hr;
4382
4383 TRACE("iface %p, desc %p, vertex_buffer %p, flags %#x, outer_unknown %p.\n",
4384 iface, desc, vertex_buffer, flags, outer_unknown);
4385
4386 if (outer_unknown)
4387 return CLASS_E_NOAGGREGATION;
4388 if (!vertex_buffer || !desc)
4389 return DDERR_INVALIDPARAMS;
4390
4392 if (hr == D3D_OK)
4393 {
4394 TRACE("Created vertex buffer %p.\n", object);
4395 *vertex_buffer = (IDirect3DVertexBuffer *)&object->IDirect3DVertexBuffer7_iface;
4396 }
4397 else
4398 WARN("Failed to create vertex buffer, hr %#x.\n", hr);
4399
4400 return hr;
4401}
HRESULT d3d_vertex_buffer_create(struct d3d_vertex_buffer **buffer, struct ddraw *ddraw, D3DVERTEXBUFFERDESC *desc) DECLSPEC_HIDDEN
Definition: vertexbuffer.c:432
GLbitfield flags
Definition: glext.h:7161
static const WCHAR desc[]
Definition: protectdata.c:36
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

◆ d3d3_CreateViewport()

static HRESULT WINAPI d3d3_CreateViewport ( IDirect3D3 *  iface,
IDirect3DViewport3 **  viewport,
IUnknown outer_unknown 
)
static

Definition at line 4089 of file ddraw.c.

4091{
4092 struct ddraw *ddraw = impl_from_IDirect3D3(iface);
4093 struct d3d_viewport *object;
4094
4095 TRACE("iface %p, viewport %p, outer_unknown %p.\n", iface, viewport, outer_unknown);
4096
4097 if (outer_unknown) return CLASS_E_NOAGGREGATION;
4098
4099 if (!(object = heap_alloc_zero(sizeof(*object))))
4100 {
4101 ERR("Failed to allocate viewport memory.\n");
4102 return DDERR_OUTOFMEMORY;
4103 }
4104
4105 d3d_viewport_init(object, ddraw);
4106
4107 TRACE("Created viewport %p.\n", object);
4108 *viewport = &object->IDirect3DViewport3_iface;
4109
4110 return D3D_OK;
4111}
void d3d_viewport_init(struct d3d_viewport *viewport, struct ddraw *ddraw) DECLSPEC_HIDDEN
Definition: viewport.c:1146

Referenced by d3d1_CreateViewport(), and d3d2_CreateViewport().

◆ d3d3_EnumDevices()

static HRESULT WINAPI d3d3_EnumDevices ( IDirect3D3 *  iface,
LPD3DENUMDEVICESCALLBACK  callback,
void context 
)
static

Definition at line 3797 of file ddraw.c.

3798{
3799 static CHAR wined3d_description[] = "Wine D3DDevice using WineD3D and OpenGL";
3800
3801 struct ddraw *ddraw = impl_from_IDirect3D3(iface);
3802 D3DDEVICEDESC device_desc1, hal_desc, hel_desc;
3803 D3DDEVICEDESC7 device_desc7;
3804 HRESULT hr;
3805
3806 /* Some games (Motoracer 2 demo) have the bad idea to modify the device
3807 * name string. Let's put the string in a sufficiently sized array in
3808 * writable memory. */
3809 char device_name[50];
3810 strcpy(device_name,"Direct3D HEL");
3811
3812 TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
3813
3814 if (!callback)
3815 return DDERR_INVALIDPARAMS;
3816
3818
3819 if (FAILED(hr = ddraw_get_d3dcaps(ddraw, &device_desc7)))
3820 {
3822 return hr;
3823 }
3824 ddraw_d3dcaps1_from_7(&device_desc1, &device_desc7);
3825
3826 /* Do I have to enumerate the reference id? Note from old d3d7:
3827 * "It seems that enumerating the reference IID on Direct3D 1 games
3828 * (AvP / Motoracer2) breaks them". So do not enumerate this iid in V1
3829 *
3830 * There's a registry key HKLM\Software\Microsoft\Direct3D\Drivers,
3831 * EnumReference which enables / disables enumerating the reference
3832 * rasterizer. It's a DWORD, 0 means disabled, 2 means enabled. The
3833 * enablerefrast.reg and disablerefrast.reg files in the DirectX 7.0 sdk
3834 * demo directory suggest this.
3835 *
3836 * Some games(GTA 2) seem to use the second enumerated device, so I have
3837 * to enumerate at least 2 devices. So enumerate the reference device to
3838 * have 2 devices.
3839 *
3840 * Other games (Rollcage) tell emulation and hal device apart by certain
3841 * flags. Rollcage expects D3DPTEXTURECAPS_POW2 to be set (yeah, it is a
3842 * limitation flag), and it refuses all devices that have the perspective
3843 * flag set. This way it refuses the emulation device, and HAL devices
3844 * never have POW2 unset in d3d7 on windows. */
3845 if (ddraw->d3dversion != 1)
3846 {
3847 static CHAR reference_description[] = "RGB Direct3D emulation";
3848
3849 TRACE("Enumerating WineD3D D3DDevice interface.\n");
3850 hal_desc = device_desc1;
3851 hel_desc = device_desc1;
3852 /* The rgb device has the pow2 flag set in the hel caps, but not in the hal caps. */
3857 /* RGB, RAMP and MMX devices have a HAL dcmColorModel of 0 */
3858 hal_desc.dcmColorModel = 0;
3859 /* RGB, RAMP and MMX devices cannot report HAL hardware flags */
3860 hal_desc.dwFlags = 0;
3861
3862 hr = callback((GUID *)&IID_IDirect3DRGBDevice, reference_description,
3863 device_name, &hal_desc, &hel_desc, context);
3864 if (hr != D3DENUMRET_OK)
3865 {
3866 TRACE("Application cancelled the enumeration.\n");
3868 return D3D_OK;
3869 }
3870 }
3871
3872 strcpy(device_name,"Direct3D HAL");
3873
3874 TRACE("Enumerating HAL Direct3D device.\n");
3875 hal_desc = device_desc1;
3876 hel_desc = device_desc1;
3877
3878 /* The hal device does not have the pow2 flag set in hel, but in hal. */
3883 /* HAL devices have a HEL dcmColorModel of 0 */
3884 hel_desc.dcmColorModel = 0;
3885
3886 hr = callback((GUID *)&IID_IDirect3DHALDevice, wined3d_description,
3887 device_name, &hal_desc, &hel_desc, context);
3888 if (hr != D3DENUMRET_OK)
3889 {
3890 TRACE("Application cancelled the enumeration.\n");
3892 return D3D_OK;
3893 }
3894
3895 TRACE("End of enumeration.\n");
3896
3898
3899 return D3D_OK;
3900}
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL
Definition: d3d8caps.h:119
#define D3DPTEXTURECAPS_PERSPECTIVE
Definition: d3d8caps.h:113
#define D3DPTEXTURECAPS_POW2
Definition: d3d8caps.h:114
#define D3DENUMRET_OK
Definition: d3dtypes.h:81
HRESULT ddraw_get_d3dcaps(const struct ddraw *ddraw, D3DDEVICEDESC7 *caps)
Definition: ddraw.c:1252
void ddraw_d3dcaps1_from_7(D3DDEVICEDESC *caps1, D3DDEVICEDESC7 *caps7)
Definition: ddraw.c:1196
static const WCHAR device_name[]
Definition: btrfs.c:60
#define FAILED(hr)
Definition: intsafe.h:51
D3DPRIMCAPS dpcTriCaps
Definition: d3dcaps.h:326
DWORD dwFlags
Definition: d3dcaps.h:319
D3DPRIMCAPS dpcLineCaps
Definition: d3dcaps.h:325
D3DCOLORMODEL dcmColorModel
Definition: d3dcaps.h:320
DWORD dwTextureCaps
Definition: d3dcaps.h:272
int d3dversion
char CHAR
Definition: xmlstorage.h:175

Referenced by d3d1_EnumDevices(), and d3d2_EnumDevices().

◆ d3d3_EnumZBufferFormats()

static HRESULT WINAPI d3d3_EnumZBufferFormats ( IDirect3D3 *  iface,
REFCLSID  device_iid,
LPD3DENUMPIXELFORMATSCALLBACK  callback,
void context 
)
static

Definition at line 4534 of file ddraw.c.

4536{
4537 struct ddraw *ddraw = impl_from_IDirect3D3(iface);
4538
4539 TRACE("iface %p, device_iid %s, callback %p, context %p.\n",
4540 iface, debugstr_guid(device_iid), callback, context);
4541
4543}
static HRESULT WINAPI d3d7_EnumZBufferFormats(IDirect3D7 *iface, REFCLSID device_iid, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
Definition: ddraw.c:4420
IDirect3D7 IDirect3D7_iface
Definition: ddraw_private.h:83

◆ d3d3_EvictManagedTextures()

static HRESULT WINAPI d3d3_EvictManagedTextures ( IDirect3D3 *  iface)
static

Definition at line 4571 of file ddraw.c.

4572{
4573 struct ddraw *ddraw = impl_from_IDirect3D3(iface);
4574
4575 TRACE("iface %p.\n", iface);
4576
4578}
static HRESULT WINAPI d3d7_EvictManagedTextures(IDirect3D7 *iface)
Definition: ddraw.c:4557

◆ d3d3_FindDevice()

static HRESULT WINAPI d3d3_FindDevice ( IDirect3D3 *  iface,
D3DFINDDEVICESEARCH fds,
D3DFINDDEVICERESULT fdr 
)
static

Definition at line 4149 of file ddraw.c.

4150{
4151 struct ddraw *ddraw = impl_from_IDirect3D3(iface);
4152 D3DDEVICEDESC7 desc7;
4153 D3DDEVICEDESC desc1;
4154 HRESULT hr;
4155
4156 TRACE("iface %p, fds %p, fdr %p.\n", iface, fds, fdr);
4157
4158 if (!fds || !fdr) return DDERR_INVALIDPARAMS;
4159
4160 if (fds->dwSize != sizeof(D3DFINDDEVICESEARCH) || (fdr->dwSize != sizeof(D3DFINDDEVICERESULT1) &&
4161 fdr->dwSize != sizeof(D3DFINDDEVICERESULT2) && fdr->dwSize != sizeof(D3DFINDDEVICERESULT)))
4162 return DDERR_INVALIDPARAMS;
4163
4164 if ((fds->dwFlags & D3DFDS_COLORMODEL)
4165 && fds->dcmColorModel != D3DCOLOR_RGB)
4166 {
4167 WARN("Trying to request a non-RGB D3D color model. Not supported.\n");
4168 return DDERR_INVALIDPARAMS; /* No real idea what to return here :-) */
4169 }
4170
4171 if (fds->dwFlags & D3DFDS_GUID)
4172 {
4173 TRACE("Trying to match guid %s.\n", debugstr_guid(&(fds->guid)));
4175 && !IsEqualGUID(&IID_IDirect3DHALDevice, &fds->guid)
4176 && !IsEqualGUID(&IID_IDirect3DRGBDevice, &fds->guid))
4177 {
4178 WARN("No match for this GUID.\n");
4179 return DDERR_NOTFOUND;
4180 }
4181 }
4182
4183 /* Get the caps */
4184 if (FAILED(hr = ddraw_get_d3dcaps(ddraw, &desc7)))
4185 return hr;
4186
4187 /* Now return our own GUID */
4188 ddraw_d3dcaps1_from_7(&desc1, &desc7);
4190
4191 if (fdr->dwSize == sizeof(D3DFINDDEVICERESULT1))
4192 {
4194 memcpy(&fdr1->ddHwDesc, &desc1, sizeof(fdr1->ddHwDesc));
4195 memcpy(&fdr1->ddSwDesc, &desc1, sizeof(fdr1->ddSwDesc));
4196 }
4197 else if (fdr->dwSize == sizeof(D3DFINDDEVICERESULT2))
4198 {
4200 memcpy(&fdr2->ddHwDesc, &desc1, sizeof(fdr2->ddHwDesc));
4201 memcpy(&fdr2->ddSwDesc, &desc1, sizeof(fdr2->ddSwDesc));
4202 }
4203 else
4204 {
4205 fdr->ddHwDesc = desc1;
4206 fdr->ddSwDesc = desc1;
4207 }
4208
4209 TRACE("Returning Wine's wined3d device with (undumped) capabilities.\n");
4210
4211 return D3D_OK;
4212}
#define D3DFDS_COLORMODEL
Definition: d3dcaps.h:126
#define D3DFDS_GUID
Definition: d3dcaps.h:127
#define D3DCOLOR_RGB
Definition: d3dtypes.h:627
const GUID IID_D3DDEVICE_WineD3D
Definition: device.c:39
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define DDERR_NOTFOUND
Definition: ddraw.h:97
D3DDEVICEDESC1 ddSwDesc
Definition: d3dcaps.h:408
D3DDEVICEDESC1 ddHwDesc
Definition: d3dcaps.h:407
D3DDEVICEDESC2 ddSwDesc
Definition: d3dcaps.h:415
D3DDEVICEDESC2 ddHwDesc
Definition: d3dcaps.h:414
D3DDEVICEDESC ddSwDesc
Definition: d3dcaps.h:423
D3DDEVICEDESC ddHwDesc
Definition: d3dcaps.h:422
D3DCOLORMODEL dcmColorModel
Definition: d3dcaps.h:398

Referenced by d3d1_FindDevice(), and d3d2_FindDevice().

◆ d3d3_QueryInterface()

static HRESULT WINAPI d3d3_QueryInterface ( IDirect3D3 *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 239 of file ddraw.c.

240{
241 struct ddraw *ddraw = impl_from_IDirect3D3(iface);
242
243 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
244
246}

◆ d3d3_Release()

static ULONG WINAPI d3d3_Release ( IDirect3D3 *  iface)
static

Definition at line 520 of file ddraw.c.

521{
522 struct ddraw *This = impl_from_IDirect3D3(iface);
523
524 TRACE("iface %p.\n", iface);
525
526 return ddraw1_Release(&This->IDirectDraw_iface);
527}

◆ d3d7_AddRef()

static ULONG WINAPI d3d7_AddRef ( IDirect3D7 *  iface)
static

Definition at line 332 of file ddraw.c.

333{
334 struct ddraw *This = impl_from_IDirect3D7(iface);
335
336 TRACE("iface %p.\n", iface);
337
338 return ddraw7_AddRef(&This->IDirectDraw7_iface);
339}
static struct ddraw * impl_from_IDirect3D7(IDirect3D7 *iface)
Definition: ddraw.c:123
static ULONG WINAPI ddraw7_AddRef(IDirectDraw7 *iface)
Definition: ddraw.c:284

◆ d3d7_CreateDevice()

static HRESULT WINAPI d3d7_CreateDevice ( IDirect3D7 *  iface,
REFCLSID  riid,
IDirectDrawSurface7 surface,
IDirect3DDevice7 **  device 
)
static

Definition at line 4253 of file ddraw.c.

4255{
4257 struct ddraw *ddraw = impl_from_IDirect3D7(iface);
4258 struct d3d_device *object;
4259 HRESULT hr;
4260
4261 TRACE("iface %p, riid %s, surface %p, device %p.\n", iface, debugstr_guid(riid), surface, device);
4262
4264 if (SUCCEEDED(hr = d3d_device_create(ddraw, riid, target, (IUnknown *)surface, 7, &object, NULL)))
4265 {
4266 *device = &object->IDirect3DDevice7_iface;
4267 }
4268 else
4269 {
4270 WARN("Failed to create device, hr %#x.\n", hr);
4271 *device = NULL;
4272 }
4274
4275 return hr;
4276}
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface) DECLSPEC_HIDDEN
Definition: surface.c:5641
GLenum target
Definition: glext.h:7315

◆ d3d7_CreateVertexBuffer()

static HRESULT WINAPI d3d7_CreateVertexBuffer ( IDirect3D7 *  iface,
D3DVERTEXBUFFERDESC desc,
IDirect3DVertexBuffer7 **  vertex_buffer,
DWORD  flags 
)
static

Definition at line 4352 of file ddraw.c.

4354{
4355 struct ddraw *ddraw = impl_from_IDirect3D7(iface);
4356 struct d3d_vertex_buffer *object;
4357 HRESULT hr;
4358
4359 TRACE("iface %p, desc %p, vertex_buffer %p, flags %#x.\n",
4360 iface, desc, vertex_buffer, flags);
4361
4362 if (!vertex_buffer || !desc) return DDERR_INVALIDPARAMS;
4363
4365 if (hr == D3D_OK)
4366 {
4367 TRACE("Created vertex buffer %p.\n", object);
4368 *vertex_buffer = &object->IDirect3DVertexBuffer7_iface;
4369 }
4370 else
4371 WARN("Failed to create vertex buffer, hr %#x.\n", hr);
4372
4373 return hr;
4374}

◆ d3d7_EnumDevices()

static HRESULT WINAPI d3d7_EnumDevices ( IDirect3D7 *  iface,
LPD3DENUMDEVICESCALLBACK7  callback,
void context 
)
static

Definition at line 3734 of file ddraw.c.

3735{
3736 struct ddraw *ddraw = impl_from_IDirect3D7(iface);
3737 D3DDEVICEDESC7 device_desc7;
3738 DWORD dev_caps;
3739 HRESULT hr;
3740 size_t i;
3741
3742 TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
3743
3744 if (!callback)
3745 return DDERR_INVALIDPARAMS;
3746
3748
3749 if (FAILED(hr = ddraw_get_d3dcaps(ddraw, &device_desc7)))
3750 {
3752 return hr;
3753 }
3754
3755 dev_caps = device_desc7.dwDevCaps;
3756
3757 for (i = 0; i < ARRAY_SIZE(device_list7); i++)
3758 {
3759 HRESULT ret;
3760
3761 device_desc7.deviceGUID = *device_list7[i].device_guid;
3762 device_desc7.dwDevCaps = dev_caps & ~device_list7[i].remove_caps;
3763
3764 ret = callback(device_list7[i].interface_name, device_list7[i].device_name, &device_desc7, context);
3765 if (ret != DDENUMRET_OK)
3766 {
3767 TRACE("Application cancelled the enumeration.\n");
3769 return D3D_OK;
3770 }
3771 }
3772
3773 TRACE("End of enumeration.\n");
3774
3776
3777 return D3D_OK;
3778}
#define ARRAY_SIZE(A)
Definition: main.h:20
static struct enum_device_entry device_list7[]
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define DDENUMRET_OK
Definition: ddraw.h:189
GUID deviceGUID
Definition: d3dcaps.h:382
DWORD dwDevCaps
Definition: d3dcaps.h:358
int ret

◆ d3d7_EnumZBufferFormats()

static HRESULT WINAPI d3d7_EnumZBufferFormats ( IDirect3D7 *  iface,
REFCLSID  device_iid,
LPD3DENUMPIXELFORMATSCALLBACK  callback,
void context 
)
static

Definition at line 4420 of file ddraw.c.

4422{
4423 struct ddraw *ddraw = impl_from_IDirect3D7(iface);
4426 unsigned int i;
4427 HRESULT hr;
4428
4429 /* Order matters. Specifically, BattleZone II (full version) expects the
4430 * 16-bit depth formats to be listed before the 24 and 32 ones. */
4431 static const enum wined3d_format_id formats[] =
4432 {
4439 };
4440
4441 TRACE("iface %p, device_iid %s, callback %p, context %p.\n",
4442 iface, debugstr_guid(device_iid), callback, context);
4443
4444 if (!callback) return DDERR_INVALIDPARAMS;
4445
4446 if (IsEqualGUID(device_iid, &IID_IDirect3DHALDevice)
4447 || IsEqualGUID(device_iid, &IID_IDirect3DTnLHalDevice)
4448 || IsEqualGUID(device_iid, &IID_D3DDEVICE_WineD3D))
4449 {
4450 TRACE("Asked for HAL device.\n");
4452 }
4453 else if (IsEqualGUID(device_iid, &IID_IDirect3DRGBDevice)
4454 || IsEqualGUID(device_iid, &IID_IDirect3DMMXDevice))
4455 {
4456 TRACE("Asked for SW device.\n");
4458 }
4459 else if (IsEqualGUID(device_iid, &IID_IDirect3DRefDevice))
4460 {
4461 TRACE("Asked for REF device.\n");
4463 }
4464 else if (IsEqualGUID(device_iid, &IID_IDirect3DNullDevice))
4465 {
4466 TRACE("Asked for NULLREF device.\n");
4468 }
4469 else
4470 {
4471 FIXME("Unexpected device GUID %s.\n", debugstr_guid(device_iid));
4473 }
4474
4476 /* We need an adapter format from somewhere to please wined3d and WGL.
4477 * Use the current display mode. So far all cards offer the same depth
4478 * stencil format for all modes, but if some do not and applications do
4479 * not like that we'll have to find some workaround, like iterating over
4480 * all imaginable formats and collecting all the depth stencil formats we
4481 * can get. */
4483 {
4484 ERR("Failed to get display mode, hr %#x.\n", hr);
4486 return hr;
4487 }
4488
4489 for (i = 0; i < ARRAY_SIZE(formats); ++i)
4490 {
4493 {
4494 DDPIXELFORMAT pformat;
4495
4496 memset(&pformat, 0, sizeof(pformat));
4497 pformat.dwSize = sizeof(pformat);
4499
4500 TRACE("Enumerating wined3d format %#x.\n", formats[i]);
4501 hr = callback(&pformat, context);
4502 if (hr != DDENUMRET_OK)
4503 {
4504 TRACE("Format enumeration cancelled by application.\n");
4506 return D3D_OK;
4507 }
4508 }
4509 }
4510
4511 /* Historically some windows drivers used dwZBufferBitDepth=24 for WINED3DFMT_X8D24_UNORM,
4512 * while others used dwZBufferBitDepth=32. In either case the pitch matches a 32 bits per
4513 * pixel format, so we use dwZBufferBitDepth=32. Some games expect 24. Windows Vista and
4514 * newer enumerate both versions, so we do the same(bug 22434) */
4517 {
4518 DDPIXELFORMAT x8d24 =
4519 {
4520 sizeof(x8d24), DDPF_ZBUFFER, 0,
4521 {24}, {0x00000000}, {0x00ffffff}, {0x00000000}
4522 };
4523 TRACE("Enumerating WINED3DFMT_X8D24_UNORM, dwZBufferBitDepth=24 version\n");
4524 callback(&x8d24, context);
4525 }
4526
4527 TRACE("End of enumeration.\n");
4528
4530
4531 return D3D_OK;
4532}
#define FIXME(fmt,...)
Definition: precomp.h:53
void ddrawformat_from_wined3dformat(DDPIXELFORMAT *ddraw_format, enum wined3d_format_id wined3d_format) DECLSPEC_HIDDEN
Definition: utils.c:33
static const struct pixel_format_desc formats[]
Definition: util.c:59
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLenum mode
Definition: glext.h:6217
#define DDPF_ZBUFFER
Definition: ddraw.h:511
#define memset(x, y, z)
Definition: compat.h:39
DWORD dwSize
Definition: ddraw.h:1070
struct wined3d * wined3d
Definition: ddraw_private.h:92
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
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
#define WINED3DADAPTER_DEFAULT
Definition: wined3d.h:857
@ WINED3D_RTYPE_TEXTURE_2D
Definition: wined3d.h:700
wined3d_format_id
Definition: wined3d.h:106
@ WINED3DFMT_X8D24_UNORM
Definition: wined3d.h:130
@ WINED3DFMT_S1_UINT_D15_UNORM
Definition: wined3d.h:129
@ WINED3DFMT_D16_UNORM
Definition: wined3d.h:191
@ WINED3DFMT_D32_UNORM
Definition: wined3d.h:128
@ WINED3DFMT_S4X4_UINT_D24_UNORM
Definition: wined3d.h:131
@ WINED3DFMT_D24_UNORM_S8_UINT
Definition: wined3d.h:181
wined3d_device_type
Definition: wined3d.h:86
@ WINED3D_DEVICE_TYPE_NULLREF
Definition: wined3d.h:90
@ WINED3D_DEVICE_TYPE_SW
Definition: wined3d.h:89
@ WINED3D_DEVICE_TYPE_HAL
Definition: wined3d.h:87
@ WINED3D_DEVICE_TYPE_REF
Definition: wined3d.h:88
#define WINED3DUSAGE_DEPTHSTENCIL
Definition: wined3d.h:900

Referenced by d3d3_EnumZBufferFormats().

◆ d3d7_EvictManagedTextures()

static HRESULT WINAPI d3d7_EvictManagedTextures ( IDirect3D7 *  iface)
static

Definition at line 4557 of file ddraw.c.

4558{
4559 struct ddraw *ddraw = impl_from_IDirect3D7(iface);
4560
4561 TRACE("iface %p!\n", iface);
4562
4567
4568 return D3D_OK;
4569}
#define DDRAW_D3D_INITIALIZED
Definition: ddraw_private.h:55
void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device)
Definition: device.c:4753
DWORD flags
Definition: ddraw_private.h:94
struct wined3d_device * wined3d_device
Definition: ddraw_private.h:93

Referenced by d3d3_EvictManagedTextures().

◆ d3d7_QueryInterface()

static HRESULT WINAPI d3d7_QueryInterface ( IDirect3D7 *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 230 of file ddraw.c.

231{
232 struct ddraw *ddraw = impl_from_IDirect3D7(iface);
233
234 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
235
237}

◆ d3d7_Release()

static ULONG WINAPI d3d7_Release ( IDirect3D7 *  iface)
static

Definition at line 511 of file ddraw.c.

512{
513 struct ddraw *This = impl_from_IDirect3D7(iface);
514
515 TRACE("iface %p.\n", iface);
516
517 return ddraw7_Release(&This->IDirectDraw7_iface);
518}
static ULONG WINAPI ddraw7_Release(IDirectDraw7 *iface)
Definition: ddraw.c:459

◆ ddraw1_AddRef()

static ULONG WINAPI ddraw1_AddRef ( IDirectDraw *  iface)
static

Definition at line 320 of file ddraw.c.

321{
322 struct ddraw *This = impl_from_IDirectDraw(iface);
324
325 TRACE("%p increasing refcount to %u.\n", This, ref);
326
327 if (ref == 1) InterlockedIncrement(&This->numIfaces);
328
329 return ref;
330}
#define InterlockedIncrement
Definition: armddk.h:53
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

Referenced by d3d1_AddRef(), d3d2_AddRef(), and d3d3_AddRef().

◆ ddraw1_Compact()

static HRESULT WINAPI ddraw1_Compact ( IDirectDraw *  iface)
static

Definition at line 1636 of file ddraw.c.

1637{
1638 struct ddraw *ddraw = impl_from_IDirectDraw(iface);
1639
1640 TRACE("iface %p.\n", iface);
1641
1643}
static HRESULT WINAPI ddraw7_Compact(IDirectDraw7 *iface)
Definition: ddraw.c:1611

◆ ddraw1_CreateClipper()

static HRESULT WINAPI ddraw1_CreateClipper ( IDirectDraw *  iface,
DWORD  flags,
IDirectDrawClipper **  clipper,
IUnknown outer_unknown 
)
static

Definition at line 3486 of file ddraw.c.

3488{
3489 struct ddraw *ddraw = impl_from_IDirectDraw(iface);
3490
3491 TRACE("iface %p, flags %#x, clipper %p, outer_unknown %p.\n",
3492 iface, flags, clipper, outer_unknown);
3493
3494 return ddraw7_CreateClipper(&ddraw->IDirectDraw7_iface, flags, clipper, outer_unknown);
3495}
static HRESULT WINAPI ddraw7_CreateClipper(IDirectDraw7 *iface, DWORD Flags, IDirectDrawClipper **Clipper, IUnknown *UnkOuter)
Definition: ddraw.c:3455

◆ ddraw1_CreatePalette()

static HRESULT WINAPI ddraw1_CreatePalette ( IDirectDraw *  iface,
DWORD  flags,
PALETTEENTRY entries,
IDirectDrawPalette **  palette,
IUnknown outer_unknown 
)
static

Definition at line 3600 of file ddraw.c.

3602{
3603 struct ddraw *ddraw = impl_from_IDirectDraw(iface);
3604 HRESULT hr;
3605
3606 TRACE("iface %p, flags %#x, entries %p, palette %p, outer_unknown %p.\n",
3607 iface, flags, entries, palette, outer_unknown);
3608
3609 hr = ddraw7_CreatePalette(&ddraw->IDirectDraw7_iface, flags, entries, palette, outer_unknown);
3610 if (SUCCEEDED(hr) && *palette)
3611 {
3613 IDirectDraw7_Release(&ddraw->IDirectDraw7_iface);
3614 impl->ifaceToRelease = NULL;
3615 }
3616
3617 return hr;
3618}
static struct ddraw_palette * impl_from_IDirectDrawPalette(IDirectDrawPalette *iface)
static HRESULT WINAPI ddraw7_CreatePalette(IDirectDraw7 *iface, DWORD Flags, PALETTEENTRY *ColorTable, IDirectDrawPalette **Palette, IUnknown *pUnkOuter)
Definition: ddraw.c:3514
static HPALETTE palette
Definition: clipboard.c:1345
IUnknown * ifaceToRelease

◆ ddraw1_CreateSurface()

static HRESULT WINAPI ddraw1_CreateSurface ( IDirectDraw *  iface,
DDSURFACEDESC surface_desc,
IDirectDrawSurface **  surface,
IUnknown outer_unknown 
)
static

Definition at line 3023 of file ddraw.c.

3025{
3026 struct ddraw *ddraw = impl_from_IDirectDraw(iface);
3027 struct ddraw_surface *impl;
3028 HRESULT hr;
3029 DDSURFACEDESC2 surface_desc2;
3030
3031 TRACE("iface %p, surface_desc %p, surface %p, outer_unknown %p.\n",
3032 iface, surface_desc, surface, outer_unknown);
3033
3035
3037 {
3038 WARN("Cooperative level not set.\n");
3041 }
3042
3043 if(surface_desc == NULL || surface_desc->dwSize != sizeof(DDSURFACEDESC))
3044 {
3045 WARN("Application supplied invalid surface descriptor\n");
3047 return DDERR_INVALIDPARAMS;
3048 }
3049
3050 __TRY
3051 {
3052 *surface = NULL;
3053 }
3055 {
3056 WARN("Surface pointer %p is invalid.\n", surface);
3058 return DDERR_INVALIDPARAMS;
3059 }
3060 __ENDTRY;
3061
3066 {
3067 WARN("Application tried to create an explicit front or back buffer.\n");
3069 return DDERR_INVALIDCAPS;
3070 }
3071
3072 DDSD_to_DDSD2(surface_desc, &surface_desc2);
3073 hr = ddraw_surface_create(ddraw, &surface_desc2, &impl, outer_unknown, 1);
3075 if (FAILED(hr))
3076 return hr;
3077
3078 *surface = &impl->IDirectDrawSurface_iface;
3079 impl->ifaceToRelease = NULL;
3080
3081 return hr;
3082}
void DDSD_to_DDSD2(const DDSURFACEDESC *in, DDSURFACEDESC2 *out) DECLSPEC_HIDDEN
Definition: utils.c:1218
HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_desc, struct ddraw_surface **surface, IUnknown *outer_unknown, unsigned int version) DECLSPEC_HIDDEN
Definition: surface.c:5791
#define __TRY
Definition: compat.h:80
#define __ENDTRY
Definition: compat.h:82
#define __EXCEPT_PAGE_FAULT
Definition: compat.h:81
#define DDSCAPS_FRONTBUFFER
Definition: ddraw.h:254
#define DDSCL_NORMAL
Definition: ddraw.h:535
#define DDSCAPS_PRIMARYSURFACE
Definition: ddraw.h:258
#define DDERR_INVALIDCAPS
Definition: ddraw.h:75
#define DDSCL_EXCLUSIVE
Definition: ddraw.h:536
#define DDERR_NOCOOPERATIVELEVELSET
Definition: ddraw.h:89
#define DDSCAPS_FLIP
Definition: ddraw.h:253
#define DDSCAPS_BACKBUFFER
Definition: ddraw.h:251
DWORD dwCaps
Definition: ddraw.h:732
DDSCAPS2 ddsCaps
Definition: ddraw.h:1188
DWORD dwSize
Definition: ddraw.h:1152
IDirectDrawSurface IDirectDrawSurface_iface
DDSURFACEDESC2 surface_desc
IUnknown * ifaceToRelease
DWORD cooperative_level

◆ ddraw1_DuplicateSurface()

static HRESULT WINAPI ddraw1_DuplicateSurface ( IDirectDraw *  iface,
IDirectDrawSurface *  src,
IDirectDrawSurface **  dst 
)
static

Definition at line 3697 of file ddraw.c.

3699{
3701 struct ddraw *ddraw = impl_from_IDirectDraw(iface);
3702 struct ddraw_surface *dst_impl;
3703 IDirectDrawSurface7 *dst7;
3704 HRESULT hr;
3705
3706 TRACE("iface %p, src %p, dst %p.\n", iface, src, dst);
3707
3709 src_impl ? &src_impl->IDirectDrawSurface7_iface : NULL, &dst7);
3710 if (FAILED(hr))
3711 return hr;
3712 dst_impl = impl_from_IDirectDrawSurface7(dst7);
3713 *dst = &dst_impl->IDirectDrawSurface_iface;
3714 IDirectDrawSurface_AddRef(*dst);
3715 IDirectDrawSurface7_Release(dst7);
3716
3717 return hr;
3718}
static struct ddraw_surface * impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface)
static HRESULT WINAPI ddraw7_DuplicateSurface(IDirectDraw7 *iface, IDirectDrawSurface7 *Src, IDirectDrawSurface7 **Dest)
Definition: ddraw.c:3637
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
DWORD IDirectDrawSurface7
Definition: vmrender.idl:20
IDirectDrawSurface7 IDirectDrawSurface7_iface

◆ ddraw1_EnumDisplayModes()

static HRESULT WINAPI ddraw1_EnumDisplayModes ( IDirectDraw *  iface,
DWORD  flags,
DDSURFACEDESC surface_desc,
void context,
LPDDENUMMODESCALLBACK  callback 
)
static

Definition at line 2573 of file ddraw.c.

2575{
2576 struct ddraw *ddraw = impl_from_IDirectDraw(iface);
2577 struct displaymodescallback_context cbcontext;
2578 DDSURFACEDESC2 surface_desc2;
2579
2580 TRACE("iface %p, flags %#x, surface_desc %p, context %p, callback %p.\n",
2581 iface, flags, surface_desc, context, callback);
2582
2583 cbcontext.func = callback;
2584 cbcontext.context = context;
2585
2586 if (surface_desc) DDSD_to_DDSD2(surface_desc, &surface_desc2);
2588 surface_desc ? &surface_desc2 : NULL, &cbcontext, EnumDisplayModesCallbackThunk);
2589}
static HRESULT CALLBACK EnumDisplayModesCallbackThunk(DDSURFACEDESC2 *surface_desc, void *context)
Definition: ddraw.c:2398
static HRESULT WINAPI ddraw7_EnumDisplayModes(IDirectDraw7 *iface, DWORD Flags, DDSURFACEDESC2 *DDSD, void *Context, LPDDENUMMODESCALLBACK2 cb)
Definition: ddraw.c:2425

◆ ddraw1_EnumSurfaces()

static HRESULT WINAPI ddraw1_EnumSurfaces ( IDirectDraw *  iface,
DWORD  flags,
DDSURFACEDESC surface_desc,
void context,
LPDDENUMSURFACESCALLBACK  callback 
)
static

Definition at line 3381 of file ddraw.c.

3383{
3384 struct ddraw *ddraw = impl_from_IDirectDraw(iface);
3385 struct surfacescallback_context cbcontext;
3386 DDSURFACEDESC2 surface_desc2;
3387
3388 TRACE("iface %p, flags %#x, surface_desc %p, context %p, callback %p.\n",
3389 iface, flags, surface_desc, context, callback);
3390
3391 cbcontext.func = callback;
3392 cbcontext.context = context;
3393
3394 if (surface_desc) DDSD_to_DDSD2(surface_desc, &surface_desc2);
3396 surface_desc ? &surface_desc2 : NULL, &cbcontext, EnumSurfacesCallbackThunk);
3397}
static HRESULT WINAPI ddraw7_EnumSurfaces(IDirectDraw7 *iface, DWORD Flags, DDSURFACEDESC2 *DDSD, void *Context, LPDDENUMSURFACESCALLBACK7 Callback)
Definition: ddraw.c:3247
static HRESULT CALLBACK EnumSurfacesCallbackThunk(IDirectDrawSurface7 *surface, DDSURFACEDESC2 *surface_desc, void *context)
Definition: ddraw.c:3215

◆ ddraw1_FlipToGDISurface()

static HRESULT WINAPI ddraw1_FlipToGDISurface ( IDirectDraw *  iface)
static

Definition at line 2145 of file ddraw.c.

2146{
2147 struct ddraw *ddraw = impl_from_IDirectDraw(iface);
2148
2149 TRACE("iface %p.\n", iface);
2150
2152}
static HRESULT WINAPI ddraw7_FlipToGDISurface(IDirectDraw7 *iface)
Definition: ddraw.c:2097

◆ ddraw1_GetCaps()

static HRESULT WINAPI ddraw1_GetCaps ( IDirectDraw *  iface,
DDCAPS driver_caps,
DDCAPS hel_caps 
)
static

Definition at line 1593 of file ddraw.c.

1594{
1595 struct ddraw *ddraw = impl_from_IDirectDraw(iface);
1596
1597 TRACE("iface %p, driver_caps %p, hel_caps %p.\n", iface, driver_caps, hel_caps);
1598
1599 return ddraw7_GetCaps(&ddraw->IDirectDraw7_iface, driver_caps, hel_caps);
1600}
static HRESULT WINAPI ddraw7_GetCaps(IDirectDraw7 *iface, DDCAPS *DriverCaps, DDCAPS *HELCaps)
Definition: ddraw.c:1483

◆ ddraw1_GetDisplayMode()

static HRESULT WINAPI ddraw1_GetDisplayMode ( IDirectDraw *  iface,
DDSURFACEDESC surface_desc 
)
static

Definition at line 1723 of file ddraw.c.

1724{
1725 struct ddraw *ddraw = impl_from_IDirectDraw(iface);
1726 HRESULT hr;
1727
1728 TRACE("iface %p, surface_desc %p.\n", iface, surface_desc);
1729
1731 if (SUCCEEDED(hr)) surface_desc->dwSize = sizeof(*surface_desc);
1732 return hr;
1733}
static HRESULT WINAPI ddraw7_GetDisplayMode(IDirectDraw7 *iface, DDSURFACEDESC2 *DDSD)
Definition: ddraw.c:1659

◆ ddraw1_GetFourCCCodes()

static HRESULT WINAPI ddraw1_GetFourCCCodes ( IDirectDraw *  iface,
DWORD codes_count,
DWORD codes 
)
static

Definition at line 1811 of file ddraw.c.

1812{
1813 struct ddraw *ddraw = impl_from_IDirectDraw(iface);
1814
1815 TRACE("iface %p, codes_count %p, codes %p.\n", iface, codes_count, codes);
1816
1817 return ddraw7_GetFourCCCodes(&ddraw->IDirectDraw7_iface, codes_count, codes);
1818}
static HRESULT WINAPI ddraw7_GetFourCCCodes(IDirectDraw7 *iface, DWORD *NumCodes, DWORD *Codes)
Definition: ddraw.c:1752

◆ ddraw1_GetGDISurface()

static HRESULT WINAPI ddraw1_GetGDISurface ( IDirectDraw *  iface,
IDirectDrawSurface **  surface 
)
static

Definition at line 2369 of file ddraw.c.

2370{
2371 struct ddraw *ddraw = impl_from_IDirectDraw(iface);
2372 struct ddraw_surface *surface_impl;
2373 IDirectDrawSurface7 *surface7;
2374 HRESULT hr;
2375
2376 TRACE("iface %p, surface %p.\n", iface, surface);
2377
2379 if (FAILED(hr))
2380 {
2381 *surface = NULL;
2382 return hr;
2383 }
2384 surface_impl = impl_from_IDirectDrawSurface7(surface7);
2385 *surface = &surface_impl->IDirectDrawSurface_iface;
2386 IDirectDrawSurface_AddRef(*surface);
2387 IDirectDrawSurface7_Release(surface7);
2388
2389 return hr;
2390}
static HRESULT WINAPI ddraw7_GetGDISurface(IDirectDraw7 *iface, IDirectDrawSurface7 **GDISurface)
Definition: ddraw.c:2302

◆ ddraw1_GetMonitorFrequency()

static HRESULT WINAPI ddraw1_GetMonitorFrequency ( IDirectDraw *  iface,
DWORD frequency 
)
static

Definition at line 1860 of file ddraw.c.

1861{
1862 struct ddraw *ddraw = impl_from_IDirectDraw(iface);
1863
1864 TRACE("iface %p, frequency %p.\n", iface, frequency);
1865
1867}
static HRESULT WINAPI ddraw7_GetMonitorFrequency(IDirectDraw7 *iface, DWORD *frequency)
Definition: ddraw.c:1820
static LARGE_INTEGER * frequency
Definition: time.c:106

◆ ddraw1_GetScanLine()

static HRESULT WINAPI ddraw1_GetScanLine ( IDirectDraw *  iface,
DWORD line 
)
static

Definition at line 2261 of file ddraw.c.

2262{
2263 struct ddraw *ddraw = impl_from_IDirectDraw(iface);
2264
2265 TRACE("iface %p, line %p.\n", iface, line);
2266
2268}
static HRESULT WINAPI ddraw7_GetScanLine(IDirectDraw7 *iface, DWORD *Scanline)
Definition: ddraw.c:2218
Definition: parser.c:49

◆ ddraw1_GetVerticalBlankStatus()

static HRESULT WINAPI ddraw1_GetVerticalBlankStatus ( IDirectDraw *  iface,
BOOL status 
)
static

Definition at line 1912 of file ddraw.c.

1913{
1914 struct ddraw *ddraw = impl_from_IDirectDraw(iface);
1915
1916 TRACE("iface %p, status %p.\n", iface, status);
1917
1919}
static HRESULT WINAPI ddraw7_GetVerticalBlankStatus(IDirectDraw7 *iface, BOOL *status)
Definition: ddraw.c:1869
Definition: ps.c:97

◆ ddraw1_Initialize()

static HRESULT WINAPI ddraw1_Initialize ( IDirectDraw *  iface,
GUID guid 
)
static

Definition at line 2068 of file ddraw.c.

2069{
2070 struct ddraw *ddraw = impl_from_IDirectDraw(iface);
2071
2072 TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
2073
2075}
static HRESULT WINAPI ddraw7_Initialize(IDirectDraw7 *iface, GUID *guid)
Definition: ddraw.c:2032
const GUID * guid

◆ ddraw1_QueryInterface()

static HRESULT WINAPI ddraw1_QueryInterface ( IDirectDraw *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 221 of file ddraw.c.

222{
223 struct ddraw *ddraw = impl_from_IDirectDraw(iface);
224
225 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
226
228}

◆ ddraw1_Release()

static ULONG WINAPI ddraw1_Release ( IDirectDraw *  iface)
static

Definition at line 498 of file ddraw.c.

499{
500 struct ddraw *This = impl_from_IDirectDraw(iface);
502
503 TRACE("%p decreasing refcount to %u.\n", This, ref);
504
505 if (!ref && !InterlockedDecrement(&This->numIfaces))
507
508 return ref;
509}
#define InterlockedDecrement
Definition: armddk.h:52
static void ddraw_destroy(struct ddraw *This)
Definition: ddraw.c:423

Referenced by d3d1_Release(), d3d2_Release(), and d3d3_Release().

◆ ddraw1_RestoreDisplayMode()

static HRESULT WINAPI ddraw1_RestoreDisplayMode ( IDirectDraw *  iface)
static

Definition at line 727 of file ddraw.c.

728{
729 struct ddraw *ddraw = impl_from_IDirectDraw(iface);
730
731 TRACE("iface %p.\n", iface);
732
734}
static HRESULT WINAPI ddraw7_RestoreDisplayMode(IDirectDraw7 *iface)
Definition: ddraw.c:678

◆ ddraw1_SetCooperativeLevel()

static HRESULT WINAPI ddraw1_SetCooperativeLevel ( IDirectDraw *  iface,
HWND  window,
DWORD  flags 
)
static

Definition at line 1049 of file ddraw.c.

1050{
1051 struct ddraw *ddraw = impl_from_IDirectDraw(iface);
1052 HRESULT hr;
1053
1054 TRACE("iface %p, window %p, flags %#x.\n", iface, window, flags);
1055
1057 if (SUCCEEDED(hr))
1059 return hr;
1060}
#define DDRAW_SCL_DDRAW1
Definition: ddraw_private.h:58
#define FALSE
Definition: types.h:117
static HRESULT ddraw_set_cooperative_level(struct ddraw *ddraw, HWND window, DWORD cooplevel, BOOL restore_mode_on_normal)
Definition: ddraw.c:778
static IHTMLWindow2 * window
Definition: events.c:77

◆ ddraw1_SetDisplayMode()

static HRESULT WINAPI ddraw1_SetDisplayMode ( IDirectDraw *  iface,
DWORD  width,
DWORD  height,
DWORD  bpp 
)
static

Definition at line 1187 of file ddraw.c.

1188{
1189 struct ddraw *ddraw = impl_from_IDirectDraw(iface);
1190
1191 TRACE("iface %p, width %u, height %u, bpp %u.\n", iface, width, height, bpp);
1192
1194}
DWORD bpp
Definition: surface.c:185
static HRESULT WINAPI ddraw7_SetDisplayMode(IDirectDraw7 *iface, DWORD width, DWORD height, DWORD bpp, DWORD refresh_rate, DWORD flags)
Definition: ddraw.c:1084
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546

◆ ddraw1_WaitForVerticalBlank()

static HRESULT WINAPI ddraw1_WaitForVerticalBlank ( IDirectDraw *  iface,
DWORD  flags,
HANDLE  event 
)
static

Definition at line 2209 of file ddraw.c.

2210{
2211 struct ddraw *ddraw = impl_from_IDirectDraw(iface);
2212
2213 TRACE("iface %p, flags %#x, event %p.\n", iface, flags, event);
2214
2216}
static HRESULT WINAPI ddraw7_WaitForVerticalBlank(IDirectDraw7 *iface, DWORD Flags, HANDLE event)
Definition: ddraw.c:2171
struct _cl_event * event
Definition: glext.h:7739

◆ ddraw2_AddRef()

static ULONG WINAPI ddraw2_AddRef ( IDirectDraw2 *  iface)
static

Definition at line 308 of file ddraw.c.

309{
310 struct ddraw *This = impl_from_IDirectDraw2(iface);
312
313 TRACE("%p increasing refcount to %u.\n", This, ref);
314
315 if (ref == 1) InterlockedIncrement(&This->numIfaces);
316
317 return ref;
318}
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93

◆ ddraw2_Compact()

static HRESULT WINAPI ddraw2_Compact ( IDirectDraw2 *  iface)
static

Definition at line 1627 of file ddraw.c.

1628{
1629 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
1630
1631 TRACE("iface %p.\n", iface);
1632
1634}

◆ ddraw2_CreateClipper()

static HRESULT WINAPI ddraw2_CreateClipper ( IDirectDraw2 *  iface,
DWORD  flags,
IDirectDrawClipper **  clipper,
IUnknown outer_unknown 
)
static

Definition at line 3475 of file ddraw.c.

3477{
3478 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
3479
3480 TRACE("iface %p, flags %#x, clipper %p, outer_unknown %p.\n",
3481 iface, flags, clipper, outer_unknown);
3482
3483 return ddraw7_CreateClipper(&ddraw->IDirectDraw7_iface, flags, clipper, outer_unknown);
3484}

◆ ddraw2_CreatePalette()

static HRESULT WINAPI ddraw2_CreatePalette ( IDirectDraw2 *  iface,
DWORD  flags,
PALETTEENTRY entries,
IDirectDrawPalette **  palette,
IUnknown outer_unknown 
)
static

Definition at line 3580 of file ddraw.c.

3582{
3583 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
3584 HRESULT hr;
3585
3586 TRACE("iface %p, flags %#x, entries %p, palette %p, outer_unknown %p.\n",
3587 iface, flags, entries, palette, outer_unknown);
3588
3589 hr = ddraw7_CreatePalette(&ddraw->IDirectDraw7_iface, flags, entries, palette, outer_unknown);
3590 if (SUCCEEDED(hr) && *palette)
3591 {
3593 IDirectDraw7_Release(&ddraw->IDirectDraw7_iface);
3594 impl->ifaceToRelease = NULL;
3595 }
3596
3597 return hr;
3598}

◆ ddraw2_CreateSurface()

static HRESULT WINAPI ddraw2_CreateSurface ( IDirectDraw2 *  iface,
DDSURFACEDESC surface_desc,
IDirectDrawSurface **  surface,
IUnknown outer_unknown 
)
static

Definition at line 2959 of file ddraw.c.

2961{
2962 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
2963 struct ddraw_surface *impl;
2964 HRESULT hr;
2965 DDSURFACEDESC2 surface_desc2;
2966
2967 TRACE("iface %p, surface_desc %p, surface %p, outer_unknown %p.\n",
2968 iface, surface_desc, surface, outer_unknown);
2969
2971
2973 {
2974 WARN("Cooperative level not set.\n");
2977 }
2978
2979 if(surface_desc == NULL || surface_desc->dwSize != sizeof(DDSURFACEDESC))
2980 {
2981 WARN("Application supplied invalid surface descriptor\n");
2983 return DDERR_INVALIDPARAMS;
2984 }
2985
2986 __TRY
2987 {
2988 *surface = NULL;
2989 }
2991 {
2992 WARN("Surface pointer %p is invalid.\n", surface);
2994 return DDERR_INVALIDPARAMS;
2995 }
2996 __ENDTRY;
2997
2998 DDSD_to_DDSD2(surface_desc, &surface_desc2);
3000 {
3001 if (TRACE_ON(ddraw))
3002 {
3003 TRACE(" (%p) Requesting surface desc :\n", iface);
3005 }
3006
3007 WARN("Application tried to create an explicit front or back buffer\n");
3009 return DDERR_INVALIDCAPS;
3010 }
3011
3012 hr = ddraw_surface_create(ddraw, &surface_desc2, &impl, outer_unknown, 2);
3014 if (FAILED(hr))
3015 return hr;
3016
3017 *surface = &impl->IDirectDrawSurface_iface;
3018 impl->ifaceToRelease = NULL;
3019
3020 return hr;
3021}
void DDRAW_dump_surface_desc(const DDSURFACEDESC2 *lpddsd) DECLSPEC_HIDDEN
Definition: utils.c:864
#define TRACE_ON(x)
Definition: compat.h:75

◆ ddraw2_DuplicateSurface()

static HRESULT WINAPI ddraw2_DuplicateSurface ( IDirectDraw2 *  iface,
IDirectDrawSurface *  src,
IDirectDrawSurface **  dst 
)
static

Definition at line 3674 of file ddraw.c.

3676{
3678 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
3679 struct ddraw_surface *dst_impl;
3680 IDirectDrawSurface7 *dst7;
3681 HRESULT hr;
3682
3683 TRACE("iface %p, src %p, dst %p.\n", iface, src, dst);
3684
3686 src_impl ? &src_impl->IDirectDrawSurface7_iface : NULL, &dst7);
3687 if (FAILED(hr))
3688 return hr;
3689 dst_impl = impl_from_IDirectDrawSurface7(dst7);
3690 *dst = &dst_impl->IDirectDrawSurface_iface;
3691 IDirectDrawSurface_AddRef(*dst);
3692 IDirectDrawSurface7_Release(dst7);
3693
3694 return hr;
3695}

◆ ddraw2_EnumDisplayModes()

static HRESULT WINAPI ddraw2_EnumDisplayModes ( IDirectDraw2 *  iface,
DWORD  flags,
DDSURFACEDESC surface_desc,
void context,
LPDDENUMMODESCALLBACK  callback 
)
static

Definition at line 2555 of file ddraw.c.

2557{
2558 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
2559 struct displaymodescallback_context cbcontext;
2560 DDSURFACEDESC2 surface_desc2;
2561
2562 TRACE("iface %p, flags %#x, surface_desc %p, context %p, callback %p.\n",
2563 iface, flags, surface_desc, context, callback);
2564
2565 cbcontext.func = callback;
2566 cbcontext.context = context;
2567
2568 if (surface_desc) DDSD_to_DDSD2(surface_desc, &surface_desc2);
2570 surface_desc ? &surface_desc2 : NULL, &cbcontext, EnumDisplayModesCallbackThunk);
2571}

◆ ddraw2_EnumSurfaces()

static HRESULT WINAPI ddraw2_EnumSurfaces ( IDirectDraw2 *  iface,
DWORD  flags,
DDSURFACEDESC surface_desc,
void context,
LPDDENUMSURFACESCALLBACK  callback 
)
static

Definition at line 3363 of file ddraw.c.

3365{
3366 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
3367 struct surfacescallback_context cbcontext;
3368 DDSURFACEDESC2 surface_desc2;
3369
3370 TRACE("iface %p, flags %#x, surface_desc %p, context %p, callback %p.\n",
3371 iface, flags, surface_desc, context, callback);
3372
3373 cbcontext.func = callback;
3374 cbcontext.context = context;
3375
3376 if (surface_desc) DDSD_to_DDSD2(surface_desc, &surface_desc2);
3378 surface_desc ? &surface_desc2 : NULL, &cbcontext, EnumSurfacesCallbackThunk);
3379}

◆ ddraw2_FlipToGDISurface()

static HRESULT WINAPI ddraw2_FlipToGDISurface ( IDirectDraw2 *  iface)
static

Definition at line 2136 of file ddraw.c.

2137{
2138 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
2139
2140 TRACE("iface %p.\n", iface);
2141
2143}

◆ ddraw2_GetAvailableVidMem()

static HRESULT WINAPI ddraw2_GetAvailableVidMem ( IDirectDraw2 *  iface,
DDSCAPS caps,
DWORD total,
DWORD free 
)
static

Definition at line 2006 of file ddraw.c.

2008{
2009 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
2010 DDSCAPS2 caps2;
2011
2012 TRACE("iface %p, caps %p, total %p, free %p.\n", iface, caps, total, free);
2013
2014 DDRAW_Convert_DDSCAPS_1_To_2(caps, &caps2);
2016}
void DDRAW_Convert_DDSCAPS_1_To_2(const DDSCAPS *pIn, DDSCAPS2 *pOut) DECLSPEC_HIDDEN
Definition: utils.c:951
#define free
Definition: debug_ros.c:5
static HRESULT WINAPI ddraw7_GetAvailableVidMem(IDirectDraw7 *iface, DDSCAPS2 *caps, DWORD *total, DWORD *free)
Definition: ddraw.c:1936
size_t total

◆ ddraw2_GetCaps()

static HRESULT WINAPI ddraw2_GetCaps ( IDirectDraw2 *  iface,
DDCAPS driver_caps,
DDCAPS hel_caps 
)
static

Definition at line 1584 of file ddraw.c.

1585{
1586 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
1587
1588 TRACE("iface %p, driver_caps %p, hel_caps %p.\n", iface, driver_caps, hel_caps);
1589
1590 return ddraw7_GetCaps(&ddraw->IDirectDraw7_iface, driver_caps, hel_caps);
1591}

◆ ddraw2_GetDisplayMode()

static HRESULT WINAPI ddraw2_GetDisplayMode ( IDirectDraw2 *  iface,
DDSURFACEDESC surface_desc 
)
static

Definition at line 1711 of file ddraw.c.

1712{
1713 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
1714 HRESULT hr;
1715
1716 TRACE("iface %p, surface_desc %p.\n", iface, surface_desc);
1717
1719 if (SUCCEEDED(hr)) surface_desc->dwSize = sizeof(*surface_desc);
1720 return hr;
1721}

◆ ddraw2_GetFourCCCodes()

static HRESULT WINAPI ddraw2_GetFourCCCodes ( IDirectDraw2 *  iface,
DWORD codes_count,
DWORD codes 
)
static

Definition at line 1802 of file ddraw.c.

1803{
1804 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
1805
1806 TRACE("iface %p, codes_count %p, codes %p.\n", iface, codes_count, codes);
1807
1808 return ddraw7_GetFourCCCodes(&ddraw->IDirectDraw7_iface, codes_count, codes);
1809}

◆ ddraw2_GetGDISurface()

static HRESULT WINAPI ddraw2_GetGDISurface ( IDirectDraw2 *  iface,
IDirectDrawSurface **  surface 
)
static

Definition at line 2346 of file ddraw.c.

2347{
2348 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
2349 struct ddraw_surface *surface_impl;
2350 IDirectDrawSurface7 *surface7;
2351 HRESULT hr;
2352
2353 TRACE("iface %p, surface %p.\n", iface, surface);
2354
2356 if (FAILED(hr))
2357 {
2358 *surface = NULL;
2359 return hr;
2360 }
2361 surface_impl = impl_from_IDirectDrawSurface7(surface7);
2362 *surface = &surface_impl->IDirectDrawSurface_iface;
2363 IDirectDrawSurface_AddRef(*surface);
2364 IDirectDrawSurface7_Release(surface7);
2365
2366 return hr;
2367}

◆ ddraw2_GetMonitorFrequency()

static HRESULT WINAPI ddraw2_GetMonitorFrequency ( IDirectDraw2 *  iface,
DWORD frequency 
)
static

Definition at line 1851 of file ddraw.c.

1852{
1853 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
1854
1855 TRACE("iface %p, frequency %p.\n", iface, frequency);
1856
1858}

◆ ddraw2_GetScanLine()

static HRESULT WINAPI ddraw2_GetScanLine ( IDirectDraw2 *  iface,
DWORD line 
)
static

Definition at line 2252 of file ddraw.c.

2253{
2254 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
2255
2256 TRACE("iface %p, line %p.\n", iface, line);
2257
2259}

◆ ddraw2_GetVerticalBlankStatus()

static HRESULT WINAPI ddraw2_GetVerticalBlankStatus ( IDirectDraw2 *  iface,
BOOL status 
)
static

Definition at line 1903 of file ddraw.c.

1904{
1905 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
1906
1907 TRACE("iface %p, status %p.\n", iface, status);
1908
1910}

◆ ddraw2_Initialize()

static HRESULT WINAPI ddraw2_Initialize ( IDirectDraw2 *  iface,
GUID guid 
)
static

Definition at line 2059 of file ddraw.c.

2060{
2061 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
2062
2063 TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
2064
2066}

◆ ddraw2_QueryInterface()

static HRESULT WINAPI ddraw2_QueryInterface ( IDirectDraw2 *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 212 of file ddraw.c.

213{
214 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
215
216 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
217
219}

◆ ddraw2_Release()

static ULONG WINAPI ddraw2_Release ( IDirectDraw2 *  iface)
static

Definition at line 485 of file ddraw.c.

486{
487 struct ddraw *This = impl_from_IDirectDraw2(iface);
489
490 TRACE("%p decreasing refcount to %u.\n", This, ref);
491
492 if (!ref && !InterlockedDecrement(&This->numIfaces))
494
495 return ref;
496}

◆ ddraw2_RestoreDisplayMode()

static HRESULT WINAPI ddraw2_RestoreDisplayMode ( IDirectDraw2 *  iface)
static

Definition at line 718 of file ddraw.c.

719{
720 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
721
722 TRACE("iface %p.\n", iface);
723
725}

◆ ddraw2_SetCooperativeLevel()

static HRESULT WINAPI ddraw2_SetCooperativeLevel ( IDirectDraw2 *  iface,
HWND  window,
DWORD  flags 
)
static

Definition at line 1040 of file ddraw.c.

1041{
1042 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
1043
1044 TRACE("iface %p, window %p, flags %#x.\n", iface, window, flags);
1045
1047}

◆ ddraw2_SetDisplayMode()

static HRESULT WINAPI ddraw2_SetDisplayMode ( IDirectDraw2 *  iface,
DWORD  width,
DWORD  height,
DWORD  bpp,
DWORD  refresh_rate,
DWORD  flags 
)
static

Definition at line 1176 of file ddraw.c.

1178{
1179 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
1180
1181 TRACE("iface %p, width %u, height %u, bpp %u, refresh_rate %u, flags %#x.\n",
1182 iface, width, height, bpp, refresh_rate, flags);
1183
1185}

◆ ddraw2_WaitForVerticalBlank()

static HRESULT WINAPI ddraw2_WaitForVerticalBlank ( IDirectDraw2 *  iface,
DWORD  flags,
HANDLE  event 
)
static

Definition at line 2200 of file ddraw.c.

2201{
2202 struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
2203
2204 TRACE("iface %p, flags %#x, event %p.\n", iface, flags, event);
2205
2207}

◆ ddraw4_AddRef()

static ULONG WINAPI ddraw4_AddRef ( IDirectDraw4 *  iface)
static

Definition at line 296 of file ddraw.c.

297{
298 struct ddraw *This = impl_from_IDirectDraw4(iface);
300
301 TRACE("%p increasing refcount to %u.\n", This, ref);
302
303 if (ref == 1) InterlockedIncrement(&This->numIfaces);
304
305 return ref;
306}
static struct ddraw * impl_from_IDirectDraw4(IDirectDraw4 *iface)
Definition: ddraw.c:98

◆ ddraw4_Compact()

static HRESULT WINAPI ddraw4_Compact ( IDirectDraw4 *  iface)
static

Definition at line 1618 of file ddraw.c.

1619{
1620 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
1621
1622 TRACE("iface %p.\n", iface);
1623
1625}

◆ ddraw4_CreateClipper()

static HRESULT WINAPI ddraw4_CreateClipper ( IDirectDraw4 *  iface,
DWORD  flags,
IDirectDrawClipper **  clipper,
IUnknown outer_unknown 
)
static

Definition at line 3464 of file ddraw.c.

3466{
3467 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
3468
3469 TRACE("iface %p, flags %#x, clipper %p, outer_unknown %p.\n",
3470 iface, flags, clipper, outer_unknown);
3471
3472 return ddraw7_CreateClipper(&ddraw->IDirectDraw7_iface, flags, clipper, outer_unknown);
3473}

◆ ddraw4_CreatePalette()

static HRESULT WINAPI ddraw4_CreatePalette ( IDirectDraw4 *  iface,
DWORD  flags,
PALETTEENTRY entries,
IDirectDrawPalette **  palette,
IUnknown outer_unknown 
)
static

Definition at line 3560 of file ddraw.c.

3562{
3563 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
3564 HRESULT hr;
3565
3566 TRACE("iface %p, flags %#x, entries %p, palette %p, outer_unknown %p.\n",
3567 iface, flags, entries, palette, outer_unknown);
3568
3569 hr = ddraw7_CreatePalette(&ddraw->IDirectDraw7_iface, flags, entries, palette, outer_unknown);
3570 if (SUCCEEDED(hr) && *palette)
3571 {
3573 IDirectDraw7_Release(&ddraw->IDirectDraw7_iface);
3574 IDirectDraw4_AddRef(iface);
3575 impl->ifaceToRelease = (IUnknown *)iface;
3576 }
3577 return hr;
3578}

◆ ddraw4_CreateSurface()

static HRESULT WINAPI ddraw4_CreateSurface ( IDirectDraw4 *  iface,
DDSURFACEDESC2 surface_desc,
IDirectDrawSurface4 **  surface,
IUnknown outer_unknown 
)
static

Definition at line 2896 of file ddraw.c.

2898{
2899 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2900 struct ddraw_surface *impl;
2901 HRESULT hr;
2902
2903 TRACE("iface %p, surface_desc %p, surface %p, outer_unknown %p.\n",
2904 iface, surface_desc, surface, outer_unknown);
2905
2907
2909 {
2910 WARN("Cooperative level not set.\n");
2913 }
2914
2915 if(surface_desc == NULL || surface_desc->dwSize != sizeof(DDSURFACEDESC2))
2916 {
2917 WARN("Application supplied invalid surface descriptor\n");
2919 return DDERR_INVALIDPARAMS;
2920 }
2921
2922 __TRY
2923 {
2924 *surface = NULL;
2925 }
2927 {
2928 WARN("Surface pointer %p is invalid.\n", surface);
2930 return DDERR_INVALIDPARAMS;
2931 }
2932 __ENDTRY;
2933
2935 {
2936 if (TRACE_ON(ddraw))
2937 {
2938 TRACE(" (%p) Requesting surface desc :\n", iface);
2940 }
2941
2942 WARN("Application tried to create an explicit front or back buffer\n");
2944 return DDERR_INVALIDCAPS;
2945 }
2946
2947 hr = ddraw_surface_create(ddraw, surface_desc, &impl, outer_unknown, 4);
2949 if (FAILED(hr))
2950 return hr;
2951
2952 *surface = &impl->IDirectDrawSurface4_iface;
2953 IDirectDraw4_AddRef(iface);
2954 impl->ifaceToRelease = (IUnknown *)iface;
2955
2956 return hr;
2957}
IDirectDrawSurface4 IDirectDrawSurface4_iface

◆ ddraw4_DuplicateSurface()

static HRESULT WINAPI ddraw4_DuplicateSurface ( IDirectDraw4 *  iface,
IDirectDrawSurface4 *  src,
IDirectDrawSurface4 **  dst 
)
static

Definition at line 3648 of file ddraw.c.

3650{
3652 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
3653 struct ddraw_surface *dst_impl;
3654 IDirectDrawSurface7 *dst7;
3655 HRESULT hr;
3656
3657 TRACE("iface %p, src %p, dst %p.\n", iface, src, dst);
3658
3660 src_impl ? &src_impl->IDirectDrawSurface7_iface : NULL, &dst7);
3661 if (FAILED(hr))
3662 {
3663 *dst = NULL;
3664 return hr;
3665 }
3666 dst_impl = impl_from_IDirectDrawSurface7(dst7);
3667 *dst = &dst_impl->IDirectDrawSurface4_iface;
3668 IDirectDrawSurface4_AddRef(*dst);
3669 IDirectDrawSurface7_Release(dst7);
3670
3671 return hr;
3672}

◆ ddraw4_EnumDisplayModes()

static HRESULT WINAPI ddraw4_EnumDisplayModes ( IDirectDraw4 *  iface,
DWORD  flags,
DDSURFACEDESC2 surface_desc,
void context,
LPDDENUMMODESCALLBACK2  callback 
)
static

Definition at line 2544 of file ddraw.c.

2546{
2547 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2548
2549 TRACE("iface %p, flags %#x, surface_desc %p, context %p, callback %p.\n",
2550 iface, flags, surface_desc, context, callback);
2551
2553}

◆ ddraw4_EnumSurfaces()

static HRESULT WINAPI ddraw4_EnumSurfaces ( IDirectDraw4 *  iface,
DWORD  flags,
DDSURFACEDESC2 surface_desc,
void context,
LPDDENUMSURFACESCALLBACK2  callback 
)
static

Definition at line 3347 of file ddraw.c.

3349{
3350 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
3351 struct surfacescallback2_context cbcontext;
3352
3353 TRACE("iface %p, flags %#x, surface_desc %p, context %p, callback %p.\n",
3354 iface, flags, surface_desc, context, callback);
3355
3356 cbcontext.func = callback;
3357 cbcontext.context = context;
3358
3359 return ddraw7_EnumSurfaces(&ddraw->IDirectDraw7_iface, flags, surface_desc,
3360 &cbcontext, EnumSurfacesCallback2Thunk);
3361}
static HRESULT CALLBACK EnumSurfacesCallback2Thunk(IDirectDrawSurface7 *surface, DDSURFACEDESC2 *surface_desc, void *context)
Definition: ddraw.c:3202

◆ ddraw4_FlipToGDISurface()

static HRESULT WINAPI ddraw4_FlipToGDISurface ( IDirectDraw4 *  iface)
static

Definition at line 2127 of file ddraw.c.

2128{
2129 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2130
2131 TRACE("iface %p.\n", iface);
2132
2134}

◆ ddraw4_GetAvailableVidMem()

static HRESULT WINAPI ddraw4_GetAvailableVidMem ( IDirectDraw4 *  iface,
DDSCAPS2 caps,
DWORD total,
DWORD free 
)
static

Definition at line 1996 of file ddraw.c.

1998{
1999 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2000
2001 TRACE("iface %p, caps %p, total %p, free %p.\n", iface, caps, total, free);
2002
2004}

◆ ddraw4_GetCaps()

static HRESULT WINAPI ddraw4_GetCaps ( IDirectDraw4 *  iface,
DDCAPS driver_caps,
DDCAPS hel_caps 
)
static

Definition at line 1575 of file ddraw.c.

1576{
1577 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
1578
1579 TRACE("iface %p, driver_caps %p, hel_caps %p.\n", iface, driver_caps, hel_caps);
1580
1581 return ddraw7_GetCaps(&ddraw->IDirectDraw7_iface, driver_caps, hel_caps);
1582}

◆ ddraw4_GetDeviceIdentifier()

static HRESULT WINAPI ddraw4_GetDeviceIdentifier ( IDirectDraw4 *  iface,
DDDEVICEIDENTIFIER identifier,
DWORD  flags 
)
static

Definition at line 2677 of file ddraw.c.

2679{
2680 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2681 DDDEVICEIDENTIFIER2 identifier2;
2682 HRESULT hr;
2683
2684 TRACE("iface %p, identifier %p, flags %#x.\n", iface, identifier, flags);
2685
2687 DDRAW_Convert_DDDEVICEIDENTIFIER_2_To_1(&identifier2, identifier);
2688
2689 return hr;
2690}
void DDRAW_Convert_DDDEVICEIDENTIFIER_2_To_1(const DDDEVICEIDENTIFIER2 *pIn, DDDEVICEIDENTIFIER *pOut) DECLSPEC_HIDDEN
Definition: utils.c:961
static HRESULT WINAPI ddraw7_GetDeviceIdentifier(IDirectDraw7 *iface, DDDEVICEIDENTIFIER2 *DDDI, DWORD Flags)
Definition: ddraw.c:2631

◆ ddraw4_GetDisplayMode()

static HRESULT WINAPI ddraw4_GetDisplayMode ( IDirectDraw4 *  iface,
DDSURFACEDESC2 surface_desc 
)
static

Definition at line 1702 of file ddraw.c.

1703{
1704 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
1705
1706 TRACE("iface %p, surface_desc %p.\n", iface, surface_desc);
1707
1708 return ddraw7_GetDisplayMode(&ddraw->IDirectDraw7_iface, surface_desc);
1709}

◆ ddraw4_GetFourCCCodes()

static HRESULT WINAPI ddraw4_GetFourCCCodes ( IDirectDraw4 *  iface,
DWORD codes_count,
DWORD codes 
)
static

Definition at line 1793 of file ddraw.c.

1794{
1795 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
1796
1797 TRACE("iface %p, codes_count %p, codes %p.\n", iface, codes_count, codes);
1798
1799 return ddraw7_GetFourCCCodes(&ddraw->IDirectDraw7_iface, codes_count, codes);
1800}

◆ ddraw4_GetGDISurface()

static HRESULT WINAPI ddraw4_GetGDISurface ( IDirectDraw4 *  iface,
IDirectDrawSurface4 **  surface 
)
static

Definition at line 2323 of file ddraw.c.

2324{
2325 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2326 struct ddraw_surface *surface_impl;
2327 IDirectDrawSurface7 *surface7;
2328 HRESULT hr;
2329
2330 TRACE("iface %p, surface %p.\n", iface, surface);
2331
2333 if (FAILED(hr))
2334 {
2335 *surface = NULL;
2336 return hr;
2337 }
2338 surface_impl = impl_from_IDirectDrawSurface7(surface7);
2339 *surface = &surface_impl->IDirectDrawSurface4_iface;
2340 IDirectDrawSurface4_AddRef(*surface);
2341 IDirectDrawSurface7_Release(surface7);
2342
2343 return hr;
2344}

◆ ddraw4_GetMonitorFrequency()

static HRESULT WINAPI ddraw4_GetMonitorFrequency ( IDirectDraw4 *  iface,
DWORD frequency 
)
static

Definition at line 1842 of file ddraw.c.

1843{
1844 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
1845
1846 TRACE("iface %p, frequency %p.\n", iface, frequency);
1847
1849}

◆ ddraw4_GetScanLine()

static HRESULT WINAPI ddraw4_GetScanLine ( IDirectDraw4 *  iface,
DWORD line 
)
static

Definition at line 2243 of file ddraw.c.

2244{
2245 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2246
2247 TRACE("iface %p, line %p.\n", iface, line);
2248
2250}

◆ ddraw4_GetSurfaceFromDC()

static HRESULT WINAPI ddraw4_GetSurfaceFromDC ( IDirectDraw4 *  iface,
HDC  dc,
IDirectDrawSurface4 **  surface 
)
static

Definition at line 2740 of file ddraw.c.

2742{
2743 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2744 struct ddraw_surface *surface_impl;
2745 IDirectDrawSurface7 *surface7;
2746 HRESULT hr;
2747
2748 TRACE("iface %p, dc %p, surface %p.\n", iface, dc, surface);
2749
2750 if (!surface) return E_INVALIDARG;
2751
2753 if (FAILED(hr))
2754 {
2755 *surface = NULL;
2756 return hr;
2757 }
2758 surface_impl = impl_from_IDirectDrawSurface7(surface7);
2759 /* Tests say this is true */
2760 *surface = (IDirectDrawSurface4 *)&surface_impl->IDirectDrawSurface_iface;
2761 IDirectDrawSurface_AddRef(&surface_impl->IDirectDrawSurface_iface);
2762 IDirectDrawSurface7_Release(surface7);
2763
2764 return hr;
2765}
#define E_INVALIDARG
Definition: ddrawi.h:101
static HRESULT WINAPI ddraw7_GetSurfaceFromDC(IDirectDraw7 *iface, HDC dc, IDirectDrawSurface7 **surface)
Definition: ddraw.c:2706
static const WCHAR dc[]

◆ ddraw4_GetVerticalBlankStatus()

static HRESULT WINAPI ddraw4_GetVerticalBlankStatus ( IDirectDraw4 *  iface,
BOOL status 
)
static

Definition at line 1894 of file ddraw.c.

1895{
1896 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
1897
1898 TRACE("iface %p, status %p.\n", iface, status);
1899
1901}

◆ ddraw4_Initialize()

static HRESULT WINAPI ddraw4_Initialize ( IDirectDraw4 *  iface,
GUID guid 
)
static

Definition at line 2050 of file ddraw.c.

2051{
2052 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2053
2054 TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
2055
2057}

◆ ddraw4_QueryInterface()

static HRESULT WINAPI ddraw4_QueryInterface ( IDirectDraw4 *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 203 of file ddraw.c.

204{
205 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
206
207 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
208
210}

◆ ddraw4_Release()

static ULONG WINAPI ddraw4_Release ( IDirectDraw4 *  iface)
static

Definition at line 472 of file ddraw.c.

473{
474 struct ddraw *This = impl_from_IDirectDraw4(iface);
476
477 TRACE("%p decreasing refcount to %u.\n", This, ref);
478
479 if (!ref && !InterlockedDecrement(&This->numIfaces))
481
482 return ref;
483}

◆ ddraw4_RestoreAllSurfaces()

static HRESULT WINAPI ddraw4_RestoreAllSurfaces ( IDirectDraw4 *  iface)
static

Definition at line 2783 of file ddraw.c.

2784{
2785 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2786
2787 TRACE("iface %p.\n", iface);
2788
2790}
static HRESULT WINAPI ddraw7_RestoreAllSurfaces(IDirectDraw7 *iface)
Definition: ddraw.c:2775

◆ ddraw4_RestoreDisplayMode()

static HRESULT WINAPI ddraw4_RestoreDisplayMode ( IDirectDraw4 *  iface)
static

Definition at line 709 of file ddraw.c.

710{
711 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
712
713 TRACE("iface %p.\n", iface);
714
716}

◆ ddraw4_SetCooperativeLevel()

static HRESULT WINAPI ddraw4_SetCooperativeLevel ( IDirectDraw4 *  iface,
HWND  window,
DWORD  flags 
)
static

Definition at line 1031 of file ddraw.c.

1032{
1033 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
1034
1035 TRACE("iface %p, window %p, flags %#x.\n", iface, window, flags);
1036
1038}

◆ ddraw4_SetDisplayMode()

static HRESULT WINAPI ddraw4_SetDisplayMode ( IDirectDraw4 *  iface,
DWORD  width,
DWORD  height,
DWORD  bpp,
DWORD  refresh_rate,
DWORD  flags 
)
static

Definition at line 1165 of file ddraw.c.

1167{
1168 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
1169
1170 TRACE("iface %p, width %u, height %u, bpp %u, refresh_rate %u, flags %#x.\n",
1171 iface, width, height, bpp, refresh_rate, flags);
1172
1174}

◆ ddraw4_TestCooperativeLevel()

static HRESULT WINAPI ddraw4_TestCooperativeLevel ( IDirectDraw4 *  iface)
static

Definition at line 2279 of file ddraw.c.

2280{
2281 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2282
2283 TRACE("iface %p.\n", iface);
2284
2286}
static HRESULT WINAPI ddraw7_TestCooperativeLevel(IDirectDraw7 *iface)
Definition: ddraw.c:2270

◆ ddraw4_WaitForVerticalBlank()

static HRESULT WINAPI ddraw4_WaitForVerticalBlank ( IDirectDraw4 *  iface,
DWORD  flags,
HANDLE  event 
)
static

Definition at line 2191 of file ddraw.c.

2192{
2193 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2194
2195 TRACE("iface %p, flags %#x, event %p.\n", iface, flags, event);
2196
2198}

◆ ddraw7_AddRef()

static ULONG WINAPI ddraw7_AddRef ( IDirectDraw7 iface)
static

Definition at line 284 of file ddraw.c.

285{
286 struct ddraw *This = impl_from_IDirectDraw7(iface);
288
289 TRACE("%p increasing refcount to %u.\n", This, ref);
290
291 if(ref == 1) InterlockedIncrement(&This->numIfaces);
292
293 return ref;
294}
static struct ddraw * impl_from_IDirectDraw7(IDirectDraw7 *iface)
Definition: ddraw.c:103

Referenced by d3d7_AddRef().

◆ ddraw7_Compact()

static HRESULT WINAPI ddraw7_Compact ( IDirectDraw7 iface)
static

Definition at line 1611 of file ddraw.c.

1612{
1613 TRACE("iface %p.\n", iface);
1614
1615 return DD_OK;
1616}
#define DD_OK
Definition: ddraw.h:186

Referenced by ddraw1_Compact(), ddraw2_Compact(), and ddraw4_Compact().

◆ ddraw7_CreateClipper()

static HRESULT WINAPI ddraw7_CreateClipper ( IDirectDraw7 iface,
DWORD  Flags,
IDirectDrawClipper **  Clipper,
IUnknown UnkOuter 
)
static

Definition at line 3455 of file ddraw.c.

3457{
3458 TRACE("iface %p, flags %#x, clipper %p, outer_unknown %p.\n",
3459 iface, Flags, Clipper, UnkOuter);
3460
3461 return DirectDrawCreateClipper(Flags, Clipper, UnkOuter);
3462}
HRESULT WINAPI DirectDrawCreateClipper(DWORD flags, IDirectDrawClipper **clipper, IUnknown *outer_unknown)
Definition: ddraw.c:3414
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by ddraw1_CreateClipper(), ddraw2_CreateClipper(), and ddraw4_CreateClipper().

◆ ddraw7_CreatePalette()

static HRESULT WINAPI ddraw7_CreatePalette ( IDirectDraw7 iface,
DWORD  Flags,
PALETTEENTRY ColorTable,
IDirectDrawPalette **  Palette,
IUnknown pUnkOuter 
)
static

Definition at line 3514 of file ddraw.c.

3516{
3517 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
3518 struct ddraw_palette *object;
3519 HRESULT hr;
3520
3521 TRACE("iface %p, flags %#x, color_table %p, palette %p, outer_unknown %p.\n",
3522 iface, Flags, ColorTable, Palette, pUnkOuter);
3523
3524 if (pUnkOuter)
3525 return CLASS_E_NOAGGREGATION;
3526
3528
3529 /* The refcount test shows that a cooplevel is required for this */
3531 {
3532 WARN("No cooperative level set, returning DDERR_NOCOOPERATIVELEVELSET\n");
3535 }
3536
3537 if (!(object = heap_alloc(sizeof(*object))))
3538 {
3539 ERR("Out of memory when allocating memory for a palette implementation\n");
3541 return E_OUTOFMEMORY;
3542 }
3543
3544 hr = ddraw_palette_init(object, ddraw, Flags, ColorTable);
3545 if (FAILED(hr))
3546 {
3547 WARN("Failed to initialize palette, hr %#x.\n", hr);
3548 heap_free(object);
3550 return hr;
3551 }
3552
3553 TRACE("Created palette %p.\n", object);
3554 *Palette = &object->IDirectDrawPalette_iface;
3556
3557 return DD_OK;
3558}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
HRESULT ddraw_palette_init(struct ddraw_palette *palette, struct ddraw *ddraw, DWORD flags, PALETTEENTRY *entries) DECLSPEC_HIDDEN
Definition: palette.c:258
#define E_OUTOFMEMORY
Definition: ddrawi.h:100

Referenced by ddraw1_CreatePalette(), ddraw2_CreatePalette(), and ddraw4_CreatePalette().

◆ ddraw7_CreateSurface()

static HRESULT WINAPI ddraw7_CreateSurface ( IDirectDraw7 iface,
DDSURFACEDESC2 surface_desc,
IDirectDrawSurface7 **  surface,
IUnknown outer_unknown 
)
static

Definition at line 2833 of file ddraw.c.

2835{
2836 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
2837 struct ddraw_surface *impl;
2838 HRESULT hr;
2839
2840 TRACE("iface %p, surface_desc %p, surface %p, outer_unknown %p.\n",
2841 iface, surface_desc, surface, outer_unknown);
2842
2844
2846 {
2847 WARN("Cooperative level not set.\n");
2850 }
2851
2852 if(surface_desc == NULL || surface_desc->dwSize != sizeof(DDSURFACEDESC2))
2853 {
2854 WARN("Application supplied invalid surface descriptor\n");
2856 return DDERR_INVALIDPARAMS;
2857 }
2858
2859 __TRY
2860 {
2861 *surface = NULL;
2862 }
2864 {
2865 WARN("Surface pointer %p is invalid.\n", surface);
2867 return DDERR_INVALIDPARAMS;
2868 }
2869 __ENDTRY;
2870
2872 {
2873 if (TRACE_ON(ddraw))
2874 {
2875 TRACE(" (%p) Requesting surface desc :\n", iface);
2877 }
2878
2879 WARN("Application tried to create an explicit front or back buffer\n");
2881 return DDERR_INVALIDCAPS;
2882 }
2883
2884 hr = ddraw_surface_create(ddraw, surface_desc, &impl, outer_unknown, 7);
2886 if (FAILED(hr))
2887 return hr;
2888
2889 *surface = &impl->IDirectDrawSurface7_iface;
2890 IDirectDraw7_AddRef(iface);
2891 impl->ifaceToRelease = (IUnknown *)iface;
2892
2893 return hr;
2894}

◆ ddraw7_DuplicateSurface()

static HRESULT WINAPI ddraw7_DuplicateSurface ( IDirectDraw7 iface,
IDirectDrawSurface7 Src,
IDirectDrawSurface7 **  Dest 
)
static

Definition at line 3637 of file ddraw.c.

3639{
3640 struct ddraw_surface *src_surface = unsafe_impl_from_IDirectDrawSurface7(Src);
3641
3642 FIXME("iface %p, src %p, dst %p partial stub!\n", iface, Src, Dest);
3643
3644 /* For now, simply create a new, independent surface */
3645 return IDirectDraw7_CreateSurface(iface, &src_surface->surface_desc, Dest, NULL);
3646}

Referenced by ddraw1_DuplicateSurface(), ddraw2_DuplicateSurface(), and ddraw4_DuplicateSurface().

◆ ddraw7_EnumDisplayModes()

static HRESULT WINAPI ddraw7_EnumDisplayModes ( IDirectDraw7 iface,
DWORD  Flags,
DDSURFACEDESC2 DDSD,
void Context,
LPDDENUMMODESCALLBACK2  cb 
)
static

Definition at line 2425 of file ddraw.c.

2427{
2428 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
2429 struct wined3d_display_mode *enum_modes = NULL;
2431 unsigned int modenum, fmt;
2432 DDSURFACEDESC2 callback_sd;
2433 unsigned enum_mode_count = 0, enum_mode_array_size = 16;
2435
2436 static const enum wined3d_format_id checkFormatList[] =
2437 {
2441 };
2442
2443 TRACE("iface %p, flags %#x, surface_desc %p, context %p, callback %p.\n",
2444 iface, Flags, DDSD, Context, cb);
2445
2446 if (!cb)
2447 return DDERR_INVALIDPARAMS;
2448
2449 if (!(enum_modes = heap_alloc(enum_mode_array_size * sizeof(*enum_modes))))
2450 return DDERR_OUTOFMEMORY;
2451
2453
2454 pixelformat.dwSize = sizeof(pixelformat);
2455 for(fmt = 0; fmt < ARRAY_SIZE(checkFormatList); fmt++)
2456 {
2457 modenum = 0;
2460 {
2461 BOOL found = FALSE;
2462 unsigned i;
2463
2465 if (DDSD)
2466 {
2467 if (DDSD->dwFlags & DDSD_WIDTH && mode.width != DDSD->dwWidth)
2468 continue;
2469 if (DDSD->dwFlags & DDSD_HEIGHT && mode.height != DDSD->dwHeight)
2470 continue;
2471 if (DDSD->dwFlags & DDSD_REFRESHRATE && mode.refresh_rate != DDSD->u2.dwRefreshRate)
2472 continue;
2473 if (DDSD->dwFlags & DDSD_PIXELFORMAT
2474 && pixelformat.u1.dwRGBBitCount != DDSD->u4.ddpfPixelFormat.u1.dwRGBBitCount)
2475 continue;
2476 }
2477
2478 /* DX docs state EnumDisplayMode should return only unique modes */
2479 for (i = 0; i < enum_mode_count; i++)
2480 {
2481 if (enum_modes[i].width == mode.width && enum_modes[i].height == mode.height
2482 && enum_modes[i].format_id == mode.format_id
2483 && (enum_modes[i].refresh_rate == mode.refresh_rate || !(Flags & DDEDM_REFRESHRATES)))
2484 {
2485 found = TRUE;
2486 break;
2487 }
2488 }
2489 if(found) continue;
2490
2491 memset(&callback_sd, 0, sizeof(callback_sd));
2492 callback_sd.dwSize = sizeof(callback_sd);
2493 callback_sd.u4.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT);
2494
2497 callback_sd.u2.dwRefreshRate = mode.refresh_rate;
2498
2499 callback_sd.dwWidth = mode.width;
2500 callback_sd.dwHeight = mode.height;
2501
2502 callback_sd.u4.ddpfPixelFormat=pixelformat;
2503
2504 /* Calc pitch and DWORD align like MSDN says */
2505 callback_sd.u1.lPitch = (callback_sd.u4.ddpfPixelFormat.u1.dwRGBBitCount / 8) * mode.width;
2506 callback_sd.u1.lPitch = (callback_sd.u1.lPitch + 3) & ~3;
2507
2508 TRACE("Enumerating %dx%dx%d @%d\n", callback_sd.dwWidth, callback_sd.dwHeight, callback_sd.u4.ddpfPixelFormat.u1.dwRGBBitCount,
2509 callback_sd.u2.dwRefreshRate);
2510
2511 if(cb(&callback_sd, Context) == DDENUMRET_CANCEL)
2512 {
2513 TRACE("Application asked to terminate the enumeration\n");
2514 heap_free(enum_modes);
2516 return DD_OK;
2517 }
2518
2519 if (enum_mode_count == enum_mode_array_size)
2520 {
2521 struct wined3d_display_mode *new_enum_modes;
2522
2523 enum_mode_array_size *= 2;
2524 if (!(new_enum_modes = heap_realloc(enum_modes, enum_mode_array_size * sizeof(*new_enum_modes))))
2525 {
2526 heap_free(enum_modes);
2528 return DDERR_OUTOFMEMORY;
2529 }
2530
2531 enum_modes = new_enum_modes;
2532 }
2533 enum_modes[enum_mode_count++] = mode;
2534 }
2535 }
2536
2537 TRACE("End of enumeration\n");
2538 heap_free(enum_modes);
2540
2541 return DD_OK;
2542}
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:71
#define TRUE
Definition: types.h:120
pixelformat
Definition: converter.c:40
unsigned int BOOL
Definition: ntddk_ex.h:94
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
#define DDSD_WIDTH
Definition: ddraw.h:210
#define DDSD_PIXELFORMAT
Definition: ddraw.h:216
#define DDSD_PITCH
Definition: ddraw.h:211
#define DDEDM_REFRESHRATES
Definition: ddraw.h:529
#define DDSD_REFRESHRATE
Definition: ddraw.h:222
#define DDSD_HEIGHT
Definition: ddraw.h:209
struct _DDPIXELFORMAT DDPIXELFORMAT
#define DDENUMRET_CANCEL
Definition: ddraw.h:188
DWORD dwRGBBitCount
Definition: ddraw.h:1075
DWORD dwWidth
Definition: ddraw.h:1155
DWORD dwHeight
Definition: ddraw.h:1154
DWORD dwRefreshRate
Definition: ddraw.h:1169
DDPIXELFORMAT ddpfPixelFormat
Definition: ddraw.h:1185
DWORD dwFlags
Definition: ddraw.h:1153
Definition: dsound.c:943
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
#define WINED3D_OK
Definition: wined3d.h:37
@ WINED3DFMT_B8G8R8X8_UNORM
Definition: wined3d.h:224
@ WINED3DFMT_B5G6R5_UNORM
Definition: wined3d.h:221
@ WINED3DFMT_P8_UINT
Definition: wined3d.h:117
@ WINED3D_SCANLINE_ORDERING_UNKNOWN
Definition: wined3d.h:832

Referenced by ddraw1_EnumDisplayModes(), ddraw2_EnumDisplayModes(), and ddraw4_EnumDisplayModes().

◆ ddraw7_EnumSurfaces()

static HRESULT WINAPI ddraw7_EnumSurfaces ( IDirectDraw7 iface,
DWORD  Flags,
DDSURFACEDESC2 DDSD,
void Context,
LPDDENUMSURFACESCALLBACK7  Callback 
)
static

Definition at line 3247 of file ddraw.c.

3249{
3250 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
3251 struct ddraw_surface *surf;
3253
3254 TRACE("iface %p, flags %#x, surface_desc %p, context %p, callback %p.\n",
3255 iface, Flags, DDSD, Context, Callback);
3256
3257 if (!Callback)
3258 return DDERR_INVALIDPARAMS;
3259
3261 {
3262 IDirectDrawSurface7 *surface;
3263 DDSURFACEDESC2 testdesc;
3264 HRESULT hr;
3265
3266 if (match_flags != DDENUMSURFACES_MATCH)
3267 return DDERR_INVALIDPARAMS;
3268
3269 if (!DDSD)
3270 return DDERR_INVALIDPARAMS;
3271
3272 memcpy(&testdesc, DDSD, sizeof(testdesc));
3273 if (!(testdesc.dwFlags & DDSD_WIDTH))
3274 {
3275 testdesc.dwFlags |= DDSD_WIDTH;
3276 testdesc.dwWidth = 512;
3277 }
3278 if (!(testdesc.dwFlags & DDSD_HEIGHT))
3279 {
3280 testdesc.dwFlags |= DDSD_HEIGHT;
3281 testdesc.dwHeight = 512;
3282 }
3283
3284 hr = IDirectDraw7_CreateSurface(iface, &testdesc, &surface, NULL);
3285 if (SUCCEEDED(hr))
3286 {
3289 IDirectDrawSurface7_Release(surface);
3290 }
3291 else
3292 ERR("Failed to create surface, hr %#x.\n", hr);
3293 }
3295 {
3296 BOOL all, nomatch;
3298 struct list *entry, *entry2;
3299
3300 /* a combination of match flags is not allowed */
3301 if (match_flags != 0 &&
3302 match_flags != DDENUMSURFACES_ALL &&
3303 match_flags != DDENUMSURFACES_MATCH &&
3304 match_flags != DDENUMSURFACES_NOMATCH)
3305 return DDERR_INVALIDPARAMS;
3306
3307 all = (Flags & DDENUMSURFACES_ALL) != 0;
3308 nomatch = (Flags & DDENUMSURFACES_NOMATCH) != 0;
3309
3310 if (!all && !DDSD)
3311 return DDERR_INVALIDPARAMS;
3312
3314
3315 /* Use the _SAFE enumeration, the app may destroy enumerated surfaces */
3317 {
3318 surf = LIST_ENTRY(entry, struct ddraw_surface, surface_list_entry);
3319
3320 if (!surf->iface_count)
3321 {
3322 WARN("Not enumerating surface %p because it doesn't have any references.\n", surf);
3323 continue;
3324 }
3325
3326 if (all || (nomatch != ddraw_match_surface_desc(DDSD, &surf->surface_desc)))
3327 {
3328 TRACE("Enumerating surface %p.\n", surf);
3329 desc = surf->surface_desc;
3330 IDirectDrawSurface7_AddRef(&surf->IDirectDrawSurface7_iface);
3332 {
3334 return DD_OK;
3335 }
3336 }
3337 }
3338
3340 }
3341 else
3342 return DDERR_INVALIDPARAMS;
3343
3344 return DD_OK;
3345}
Definition: list.h:37
static BOOL ddraw_match_surface_desc(const DDSURFACEDESC2 *requested, const DDSURFACEDESC2 *provided)
Definition: ddraw.c:3130
uint32_t entry
Definition: isohybrid.c:63
#define DDENUMSURFACES_CANBECREATED
Definition: ddraw.h:524
#define DDENUMSURFACES_ALL
Definition: ddraw.h:521
#define DDENUMSURFACES_NOMATCH
Definition: ddraw.h:523
#define DDENUMSURFACES_MATCH
Definition: ddraw.h:522
#define DDENUMSURFACES_DOESEXIST
Definition: ddraw.h:525
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
struct list surface_list
#define LIST_ENTRY(type)
Definition: queue.h:175
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:458

Referenced by ddraw1_EnumSurfaces(), ddraw2_EnumSurfaces(), and ddraw4_EnumSurfaces().

◆ ddraw7_EvaluateMode()

static HRESULT WINAPI ddraw7_EvaluateMode ( IDirectDraw7 iface,
DWORD  Flags,
DWORD Timeout 
)
static

Definition at line 2607 of file ddraw.c.

2608{
2609 FIXME("iface %p, flags %#x, timeout %p stub!\n", iface, Flags, Timeout);
2610
2611 /* When implementing this, implement it in WineD3D */
2612
2613 return DD_OK;
2614}
static ULONG Timeout
Definition: ping.c:61

◆ ddraw7_FlipToGDISurface()

static HRESULT WINAPI ddraw7_FlipToGDISurface ( IDirectDraw7 iface)
static

Definition at line 2097 of file ddraw.c.

2098{
2099 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
2100 IDirectDrawSurface7 *gdi_surface;
2101 struct ddraw_surface *gdi_impl;
2102 HRESULT hr;
2103
2104 TRACE("iface %p.\n", iface);
2105
2107
2108 if (FAILED(hr = IDirectDraw7_GetGDISurface(iface, &gdi_surface)))
2109 {
2110 WARN("Failed to retrieve GDI surface, hr %#x.\n", hr);
2112 return hr;
2113 }
2114
2115 gdi_impl = impl_from_IDirectDrawSurface7(gdi_surface);
2117 hr = DD_OK;
2118 else
2119 hr = IDirectDrawSurface7_Flip(&ddraw->primary->IDirectDrawSurface7_iface, gdi_surface, DDFLIP_WAIT);
2120 IDirectDrawSurface7_Release(gdi_surface);
2121
2123
2124 return hr;
2125}
#define DDFLIP_WAIT
Definition: ddraw.h:583
struct ddraw_surface * primary
Definition: ddraw_private.h:97

Referenced by ddraw1_FlipToGDISurface(), ddraw2_FlipToGDISurface(), and ddraw4_FlipToGDISurface().

◆ ddraw7_GetAvailableVidMem()

static HRESULT WINAPI ddraw7_GetAvailableVidMem ( IDirectDraw7 iface,
DDSCAPS2 caps,
DWORD total,
DWORD free 
)
static

Definition at line 1936 of file ddraw.c.

1938{
1939 unsigned int framebuffer_size, total_vidmem, free_vidmem;
1940 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
1942 HRESULT hr = DD_OK;
1943
1944 TRACE("iface %p, caps %p, total %p, free %p.\n", iface, caps, total, free);
1945
1946 if (!total && !free)
1947 return DDERR_INVALIDPARAMS;
1948
1949 if (TRACE_ON(ddraw))
1950 {
1951 TRACE("Asked for memory with description: ");
1952 DDRAW_dump_DDSCAPS2(caps);
1953 }
1955
1956 /* Todo: System memory vs local video memory vs non-local video memory
1957 * The MSDN also mentions differences between texture memory and other
1958 * resources, but that's not important
1959 */
1960
1961 /* Some applications (e.g. 3DMark 2000) assume that the reported amount of
1962 * video memory doesn't include the memory used by the default framebuffer.
1963 */
1965 {
1966 WARN("Failed to get display mode, hr %#x.\n", hr);
1968 return hr;
1969 }
1971 mode.format_id, mode.width);
1972 framebuffer_size *= mode.height;
1973
1974 if (free)
1975 {
1977 *free = framebuffer_size > free_vidmem ? 0 : free_vidmem - framebuffer_size;
1978 TRACE("Free video memory %#x.\n", *free);
1979 }
1980
1981 if (total)
1982 {
1983 struct wined3d_adapter_identifier desc = {0};
1984
1986 total_vidmem = min(UINT_MAX, desc.video_memory);
1987 *total = framebuffer_size > total_vidmem ? 0 : total_vidmem - framebuffer_size;
1988 TRACE("Total video memory %#x.\n", *total);
1989 }
1990
1992
1993 return hr;
1994}
void DDRAW_dump_DDSCAPS2(const DDSCAPS2 *in) DECLSPEC_HIDDEN
Definition: utils.c:713
UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device *device)
Definition: device.c:1298
#define UINT_MAX
Definition: intsafe.h:152
#define min(a, b)
Definition: monoChain.cc:55
UINT CDECL wined3d_calculate_format_pitch(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_format_id format_id, UINT width)
Definition: directx.c:5517
HRESULT CDECL wined3d_get_adapter_identifier(const struct wined3d *wined3d, UINT adapter_idx, DWORD flags, struct wined3d_adapter_identifier *identifier)
Definition: directx.c:4939

Referenced by ddraw2_GetAvailableVidMem(), and ddraw4_GetAvailableVidMem().

◆ ddraw7_GetCaps()

static HRESULT WINAPI ddraw7_GetCaps ( IDirectDraw7 iface,
DDCAPS DriverCaps,
DDCAPS HELCaps 
)
static

Definition at line 1483 of file ddraw.c.

1484{
1485 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
1486 DDCAPS caps;
1487 WINED3DCAPS winecaps;
1488 HRESULT hr;
1489 DDSCAPS2 ddscaps = {0, 0, 0, {0}};
1490
1491 TRACE("iface %p, driver_caps %p, hel_caps %p.\n", iface, DriverCaps, HELCaps);
1492
1493 /* One structure must be != NULL */
1494 if (!DriverCaps && !HELCaps)
1495 {
1496 WARN("Invalid parameters.\n");
1497 return DDERR_INVALIDPARAMS;
1498 }
1499
1500 memset(&caps, 0, sizeof(caps));
1501 memset(&winecaps, 0, sizeof(winecaps));
1502 caps.dwSize = sizeof(caps);
1503
1506 if (FAILED(hr))
1507 {
1508 WARN("Failed to get device caps, %#x.\n", hr);
1510 return hr;
1511 }
1512
1513 hr = IDirectDraw7_GetAvailableVidMem(iface, &ddscaps, &caps.dwVidMemTotal, &caps.dwVidMemFree);
1514 if (FAILED(hr))
1515 {
1516 WARN("IDirectDraw7::GetAvailableVidMem failed\n");
1518 return hr;
1519 }
1520
1521 hr = IDirectDraw7_GetFourCCCodes(iface, &caps.dwNumFourCCCodes, NULL);
1523 if (FAILED(hr))
1524 {
1525 WARN("IDirectDraw7::GetFourCCCodes failed\n");
1526 return hr;
1527 }
1528
1529 caps.dwCaps = winecaps.ddraw_caps.caps;
1530 caps.dwCaps2 = winecaps.ddraw_caps.caps2;
1531 caps.dwCKeyCaps = winecaps.ddraw_caps.color_key_caps;
1532 caps.dwFXCaps = winecaps.ddraw_caps.fx_caps;
1533 caps.dwPalCaps = DDPCAPS_8BIT | DDPCAPS_PRIMARYSURFACE;
1534 caps.ddsCaps.dwCaps = winecaps.ddraw_caps.dds_caps;
1535 caps.dwSVBCaps = winecaps.ddraw_caps.svb_caps;
1536 caps.dwSVBCKeyCaps = winecaps.ddraw_caps.svb_color_key_caps;
1537 caps.dwSVBFXCaps = winecaps.ddraw_caps.svb_fx_caps;
1538 caps.dwVSBCaps = winecaps.ddraw_caps.vsb_caps;
1539 caps.dwVSBCKeyCaps = winecaps.ddraw_caps.vsb_color_key_caps;
1540 caps.dwVSBFXCaps = winecaps.ddraw_caps.vsb_fx_caps;
1541 caps.dwSSBCaps = winecaps.ddraw_caps.ssb_caps;
1542 caps.dwSSBCKeyCaps = winecaps.ddraw_caps.ssb_color_key_caps;
1543 caps.dwSSBFXCaps = winecaps.ddraw_caps.ssb_fx_caps;
1544
1545 caps.dwCaps |= DDCAPS_ALIGNSTRIDE;
1546 caps.dwAlignStrideAlign = DDRAW_STRIDE_ALIGNMENT;
1547
1548 caps.ddsOldCaps.dwCaps = caps.ddsCaps.dwCaps;
1549
1550 IDirect3D7_EnumZBufferFormats(&ddraw->IDirect3D7_iface, &IID_IDirect3DHALDevice, enum_zbuffer, &caps);
1551
1552 if(DriverCaps)
1553 {
1554 DD_STRUCT_COPY_BYSIZE(DriverCaps, &caps);
1555 if (TRACE_ON(ddraw))
1556 {
1557 TRACE("Driver Caps :\n");
1558 DDRAW_dump_DDCAPS(DriverCaps);
1559 }
1560
1561 }
1562 if(HELCaps)
1563 {
1564 DD_STRUCT_COPY_BYSIZE(HELCaps, &caps);
1565 if (TRACE_ON(ddraw))
1566 {
1567 TRACE("HEL Caps :\n");
1568 DDRAW_dump_DDCAPS(HELCaps);
1569 }
1570 }
1571
1572 return DD_OK;
1573}
#define IDirect3D7_EnumZBufferFormats(p, a, b, c)
Definition: d3d.h:386
void DDRAW_dump_DDCAPS(const DDCAPS *lpcaps) DECLSPEC_HIDDEN
Definition: utils.c:990
#define DDRAW_STRIDE_ALIGNMENT
Definition: ddraw_private.h:62
#define DD_STRUCT_COPY_BYSIZE(to, from)
HRESULT CALLBACK enum_zbuffer(DDPIXELFORMAT *format, void *ctx)
Definition: ddraw.c:1446
HRESULT CDECL wined3d_device_get_device_caps(const struct wined3d_device *device, WINED3DCAPS *caps)
Definition: device.c:3526
#define DDPCAPS_PRIMARYSURFACE
Definition: ddraw.h:456
#define DDCAPS_ALIGNSTRIDE
Definition: ddraw.h:334
#define DDPCAPS_8BIT
Definition: ddraw.h:455
struct wined3d_ddraw_caps ddraw_caps
Definition: wined3d.h:1973

Referenced by ddraw1_GetCaps(), ddraw2_GetCaps(), and ddraw4_GetCaps().

◆ ddraw7_GetDeviceIdentifier()

static HRESULT WINAPI ddraw7_GetDeviceIdentifier ( IDirectDraw7 iface,
DDDEVICEIDENTIFIER2 DDDI,
DWORD  Flags 
)
static

Definition at line 2631 of file ddraw.c.

2633{
2634 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
2635 struct wined3d_adapter_identifier adapter_id;
2636 HRESULT hr = S_OK;
2637
2638 TRACE("iface %p, device_identifier %p, flags %#x.\n", iface, DDDI, Flags);
2639
2640 if (!DDDI)
2641 return DDERR_INVALIDPARAMS;
2642
2644 {
2645 /* The DDGDI_GETHOSTIDENTIFIER returns the information about the 2D
2646 * host adapter, if there's a secondary 3D adapter. This doesn't apply
2647 * to any modern hardware, nor is it interesting for Wine, so ignore it.
2648 * Size of DDDEVICEIDENTIFIER2 may be aligned to 8 bytes and thus 4
2649 * bytes too long. So only copy the relevant part of the structure
2650 */
2651
2653 return DD_OK;
2654 }
2655
2656 /* Drakan: Order of the Flame expects accurate D3D device information from ddraw */
2657 adapter_id.driver = DDDI->szDriver;
2658 adapter_id.driver_size = sizeof(DDDI->szDriver);
2659 adapter_id.description = DDDI->szDescription;
2660 adapter_id.description_size = sizeof(DDDI->szDescription);
2661 adapter_id.device_name_size = 0;
2665 if (FAILED(hr)) return hr;
2666
2667 DDDI->liDriverVersion = adapter_id.driver_version;
2668 DDDI->dwVendorId = adapter_id.vendor_id;
2669 DDDI->dwDeviceId = adapter_id.device_id;
2670 DDDI->dwSubSysId = adapter_id.subsystem_id;
2671 DDDI->dwRevision = adapter_id.revision;
2672 DDDI->guidDeviceIdentifier = adapter_id.device_identifier;
2673 DDDI->dwWHQLLevel = adapter_id.whql_level;
2674 return DD_OK;
2675}
static const DDDEVICEIDENTIFIER2 deviceidentifier
Definition: ddraw.c:37
static const WCHAR dwWHQLLevel[]
Definition: provider.c:101
#define S_OK
Definition: intsafe.h:52
#define DDGDI_GETHOSTIDENTIFIER
Definition: ddraw.h:202
char szDescription[MAX_DDDEVICEID_STRING]
Definition: ddraw.h:1346
char szDriver[MAX_DDDEVICEID_STRING]
Definition: ddraw.h:1345
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by ddraw4_GetDeviceIdentifier().

◆ ddraw7_GetDisplayMode()

static HRESULT WINAPI ddraw7_GetDisplayMode ( IDirectDraw7 iface,
DDSURFACEDESC2 DDSD 
)
static

Definition at line 1659 of file ddraw.c.

1660{
1661 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
1663 HRESULT hr;
1664
1665 TRACE("iface %p, surface_desc %p.\n", iface, DDSD);
1666
1667 /* This seems sane */
1668 if (!DDSD || (DDSD->dwSize != sizeof(DDSURFACEDESC) && DDSD->dwSize != sizeof(DDSURFACEDESC2)))
1669 return DDERR_INVALIDPARAMS;
1670
1672
1674 {
1675 ERR("Failed to get display mode, hr %#x.\n", hr);
1677 return hr;
1678 }
1679
1680 memset(DDSD, 0, DDSD->dwSize);
1681 DDSD->dwSize = sizeof(*DDSD);
1683 DDSD->dwWidth = mode.width;
1684 DDSD->dwHeight = mode.height;
1685 DDSD->u2.dwRefreshRate = 60;
1686 DDSD->ddsCaps.dwCaps = 0;
1687 DDSD->u4.ddpfPixelFormat.dwSize = sizeof(DDSD->u4.ddpfPixelFormat);
1689 DDSD->u1.lPitch = mode.width * DDSD->u4.ddpfPixelFormat.u1.dwRGBBitCount / 8;
1690
1691 if(TRACE_ON(ddraw))
1692 {
1693 TRACE("Returning surface desc :\n");
1695 }
1696
1698
1699 return DD_OK;
1700}

Referenced by ddraw1_GetDisplayMode(), ddraw2_GetDisplayMode(), and ddraw4_GetDisplayMode().

◆ ddraw7_GetFourCCCodes()

static HRESULT WINAPI ddraw7_GetFourCCCodes ( IDirectDraw7 iface,
DWORD NumCodes,
DWORD Codes 
)
static

Definition at line 1752 of file ddraw.c.

1753{
1754 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
1755 static const enum wined3d_format_id formats[] =
1756 {
1760 };
1762 DWORD count = 0, i, outsize;
1763 HRESULT hr;
1764
1765 TRACE("iface %p, codes_count %p, codes %p.\n", iface, NumCodes, Codes);
1766
1768 {
1769 ERR("Failed to get display mode, hr %#x.\n", hr);
1770 return hr;
1771 }
1772
1773 outsize = NumCodes && Codes ? *NumCodes : 0;
1774
1775 for (i = 0; i < ARRAY_SIZE(formats); ++i)
1776 {
1778 mode.format_id, 0, WINED3D_RTYPE_TEXTURE_2D, formats[i])))
1779 {
1780 if (count < outsize)
1781 Codes[count] = formats[i];
1782 ++count;
1783 }
1784 }
1785 if(NumCodes) {
1786 TRACE("Returning %u FourCC codes\n", count);
1787 *NumCodes = count;
1788 }
1789
1790 return DD_OK;
1791}
GLuint GLuint GLsizei count
Definition: gl.h:1545
unsigned char size_t * outsize
Definition: jpeglib.h:981
@ WINED3DFMT_DXT2
Definition: wined3d.h:240
@ WINED3DFMT_NVHS
Definition: wined3d.h:252
@ WINED3DFMT_DXT1
Definition: wined3d.h:239
@ WINED3DFMT_DXT3
Definition: wined3d.h:241
@ WINED3DFMT_DXT4
Definition: wined3d.h:242
@ WINED3DFMT_NVHU
Definition: wined3d.h:251
@ WINED3DFMT_YV12
Definition: wined3d.h:238
@ WINED3DFMT_DXT5
Definition: wined3d.h:243
@ WINED3DFMT_YUY2
Definition: wined3d.h:237
@ WINED3DFMT_UYVY
Definition: wined3d.h:236
@ WINED3DFMT_ATI2N
Definition: wined3d.h:248

Referenced by ddraw1_GetFourCCCodes(), ddraw2_GetFourCCCodes(), and ddraw4_GetFourCCCodes().

◆ ddraw7_GetGDISurface()

static HRESULT WINAPI ddraw7_GetGDISurface ( IDirectDraw7 iface,
IDirectDrawSurface7 **  GDISurface 
)
static

Definition at line 2302 of file ddraw.c.

2303{
2304 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
2305
2306 TRACE("iface %p, surface %p.\n", iface, GDISurface);
2307
2309
2310 if (!(*GDISurface = &ddraw->primary->IDirectDrawSurface7_iface))
2311 {
2312 WARN("Primary not created yet.\n");
2314 return DDERR_NOTFOUND;
2315 }
2316 IDirectDrawSurface7_AddRef(*GDISurface);
2317
2319
2320 return DD_OK;
2321}

Referenced by ddraw1_GetGDISurface(), ddraw2_GetGDISurface(), and ddraw4_GetGDISurface().

◆ ddraw7_GetMonitorFrequency()

static HRESULT WINAPI ddraw7_GetMonitorFrequency ( IDirectDraw7 iface,
DWORD frequency 
)
static

Definition at line 1820 of file ddraw.c.

1821{
1822 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
1824 HRESULT hr;
1825
1826 TRACE("iface %p, frequency %p.\n", iface, frequency);
1827
1831 if (FAILED(hr))
1832 {
1833 WARN("Failed to get display mode, hr %#x.\n", hr);
1834 return hr;
1835 }
1836
1837 *frequency = mode.refresh_rate;
1838
1839 return DD_OK;
1840}

Referenced by ddraw1_GetMonitorFrequency(), ddraw2_GetMonitorFrequency(), and ddraw4_GetMonitorFrequency().

◆ ddraw7_GetScanLine()

static HRESULT WINAPI ddraw7_GetScanLine ( IDirectDraw7 iface,
DWORD Scanline 
)
static

Definition at line 2218 of file ddraw.c.

2219{
2220 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
2221 struct wined3d_raster_status raster_status;
2222 HRESULT hr;
2223
2224 TRACE("iface %p, line %p.\n", iface, Scanline);
2225
2229 if (FAILED(hr))
2230 {
2231 WARN("Failed to get raster status, hr %#x.\n", hr);
2232 return hr;
2233 }
2234
2235 *Scanline = raster_status.scan_line;
2236
2237 if (raster_status.in_vblank)
2239
2240 return DD_OK;
2241}
#define DDERR_VERTICALBLANKINPROGRESS
Definition: ddraw.h:131
HRESULT CDECL wined3d_get_adapter_raster_status(const struct wined3d *wined3d, UINT adapter_idx, struct wined3d_raster_status *raster_status)
Definition: directx.c:4994

Referenced by ddraw1_GetScanLine(), ddraw2_GetScanLine(), and ddraw4_GetScanLine().

◆ ddraw7_GetSurfaceFromDC()

static HRESULT WINAPI ddraw7_GetSurfaceFromDC ( IDirectDraw7 iface,
HDC  dc,
IDirectDrawSurface7 **  surface 
)
static

Definition at line 2706 of file ddraw.c.

2708{
2709 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
2710 struct ddraw_surface *surface_impl;
2711
2712 TRACE("iface %p, dc %p, surface %p.\n", iface, dc, surface);
2713
2714 if (!surface)
2715 return E_INVALIDARG;
2716
2717 if (!dc)
2718 goto done;
2719
2722 {
2723 if (surface_impl->dc != dc)
2724 continue;
2725
2726 TRACE("Found surface %p for dc %p.\n", surface_impl, dc);
2727 *surface = &surface_impl->IDirectDrawSurface7_iface;
2728 IDirectDrawSurface7_AddRef(*surface);
2730 return DD_OK;
2731 }
2733
2734done:
2735 TRACE("No surface found for dc %p.\n", dc);
2736 *surface = NULL;
2737 return DDERR_NOTFOUND;
2738}
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
struct list surface_list_entry

Referenced by ddraw4_GetSurfaceFromDC().

◆ ddraw7_GetVerticalBlankStatus()

static HRESULT WINAPI ddraw7_GetVerticalBlankStatus ( IDirectDraw7 iface,
BOOL status 
)
static

Definition at line 1869 of file ddraw.c.

1870{
1871 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
1872 struct wined3d_raster_status raster_status;
1873 HRESULT hr;
1874
1875 TRACE("iface %p, status %p.\n", iface, status);
1876
1877 if(!status)
1878 return DDERR_INVALIDPARAMS;
1879
1883 if (FAILED(hr))
1884 {
1885 WARN("Failed to get raster status, hr %#x.\n", hr);
1886 return hr;
1887 }
1888
1889 *status = raster_status.in_vblank;
1890
1891 return DD_OK;
1892}

Referenced by ddraw1_GetVerticalBlankStatus(), ddraw2_GetVerticalBlankStatus(), and ddraw4_GetVerticalBlankStatus().

◆ ddraw7_Initialize()

static HRESULT WINAPI ddraw7_Initialize ( IDirectDraw7 iface,
GUID guid 
)
static

Definition at line 2032 of file ddraw.c.

2033{
2034 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
2035
2036 TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
2037
2040
2041 /* FIXME: To properly take the GUID into account we should call
2042 * ddraw_init() here instead of in DDRAW_Create(). */
2043 if (guid)
2044 FIXME("Ignoring guid %s.\n", debugstr_guid(guid));
2045
2047 return DD_OK;
2048}
#define DDRAW_INITIALIZED
Definition: ddraw_private.h:54

Referenced by ddraw1_Initialize(), ddraw2_Initialize(), and ddraw4_Initialize().

◆ ddraw7_QueryInterface()

static HRESULT WINAPI ddraw7_QueryInterface ( IDirectDraw7 iface,
REFIID  riid,
void **  out 
)
static

Definition at line 128 of file ddraw.c.

129{
130 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
131
132 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
133
134 if (!riid)
135 {
136 *out = NULL;
137 return DDERR_INVALIDPARAMS;
138 }
139
140 /* The refcount unit test revealed that an IDirect3D7 interface can only
141 * be queried from a DirectDraw object that was created as an IDirectDraw7
142 * interface. The older interfaces can query any IDirect3D version except
143 * 7, because they are all initially created as IDirectDraw. This isn't
144 * really crucial behavior, and messy to implement with the common
145 * creation function, so it has been left out here. */
146 if (IsEqualGUID(&IID_IDirectDraw7, riid)
148 {
150 TRACE("Returning IDirectDraw7 interface %p.\n", *out);
151 }
152 else if (IsEqualGUID(&IID_IDirectDraw4, riid))
153 {
155 TRACE("Returning IDirectDraw4 interface %p.\n", *out);
156 }
157 else if (IsEqualGUID(&IID_IDirectDraw2, riid))
158 {
160 TRACE("Returning IDirectDraw2 interface %p.\n", *out);
161 }
162 else if (IsEqualGUID(&IID_IDirectDraw, riid))
163 {
165 TRACE("Returning IDirectDraw interface %p.\n", *out);
166 }
167 else if (IsEqualGUID(&IID_IDirect3D7, riid))
168 {
169 ddraw->d3dversion = 7;
171 TRACE("Returning Direct3D7 interface %p.\n", *out);
172 }
173 else if (IsEqualGUID(&IID_IDirect3D3, riid))
174 {
175 ddraw->d3dversion = 3;
177 TRACE("Returning Direct3D3 interface %p.\n", *out);
178 }
179 else if (IsEqualGUID(&IID_IDirect3D2, riid))
180 {
181 ddraw->d3dversion = 2;
183 TRACE("Returning Direct3D2 interface %p.\n", *out);
184 }
185 else if (IsEqualGUID(&IID_IDirect3D, riid))
186 {
187 ddraw->d3dversion = 1;
189 TRACE("Returning Direct3D interface %p.\n", *out);
190 }
191 /* Unknown interface */
192 else
193 {
194 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
195 *out = NULL;
196 return E_NOINTERFACE;
197 }
198
199 IUnknown_AddRef((IUnknown *)*out);
200 return S_OK;
201}
const GUID IID_IUnknown
static FILE * out
Definition: regtests2xml.c:44
IDirectDraw2 IDirectDraw2_iface
Definition: ddraw_private.h:81
IDirect3D IDirect3D_iface
Definition: ddraw_private.h:86
IDirectDraw4 IDirectDraw4_iface
Definition: ddraw_private.h:80
IDirect3D2 IDirect3D2_iface
Definition: ddraw_private.h:85
IDirectDraw IDirectDraw_iface
Definition: ddraw_private.h:82
#define E_NOINTERFACE
Definition: winerror.h:2364

Referenced by d3d1_QueryInterface(), d3d2_QueryInterface(), d3d3_QueryInterface(), d3d7_QueryInterface(), ddraw1_QueryInterface(), ddraw2_QueryInterface(), and ddraw4_QueryInterface().

◆ ddraw7_Release()

static ULONG WINAPI ddraw7_Release ( IDirectDraw7 iface)
static

Definition at line 459 of file ddraw.c.

460{
461 struct ddraw *This = impl_from_IDirectDraw7(iface);
463
464 TRACE("%p decreasing refcount to %u.\n", This, ref);
465
466 if (!ref && !InterlockedDecrement(&This->numIfaces))
468
469 return ref;
470}

Referenced by d3d7_Release().

◆ ddraw7_RestoreAllSurfaces()

static HRESULT WINAPI ddraw7_RestoreAllSurfaces ( IDirectDraw7 iface)
static

Definition at line 2775 of file ddraw.c.

2776{
2777 TRACE("iface %p.\n", iface);
2778
2779 return IDirectDraw7_EnumSurfaces(iface, DDENUMSURFACES_ALL | DDENUMSURFACES_DOESEXIST,
2781}
static HRESULT CALLBACK restore_callback(IDirectDrawSurface7 *surface, DDSURFACEDESC2 *desc, void *context)
Definition: ddraw.c:2767

Referenced by ddraw4_RestoreAllSurfaces().

◆ ddraw7_RestoreDisplayMode()

static HRESULT WINAPI ddraw7_RestoreDisplayMode ( IDirectDraw7 iface)
static

Definition at line 678 of file ddraw.c.

679{
680 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
681 HRESULT hr;
682
683 TRACE("iface %p.\n", iface);
684
686
688 {
690 return DD_OK;
691 }
692
694 {
697 }
698
700 ddraw->flags &= ~DDRAW_RESTORE_MODE;
701
703
705
706 return hr;
707}
@ DDRAW_DEVICE_STATE_NOT_RESTORED
Definition: ddraw_private.h:73
@ DDRAW_DEVICE_STATE_OK
Definition: ddraw_private.h:71
#define DDRAW_RESTORE_MODE
Definition: ddraw_private.h:56
static const struct ddraw * exclusive_ddraw
Definition: ddraw.c:33
#define InterlockedCompareExchange
Definition: interlocked.h:104
#define DDERR_NOEXCLUSIVEMODE
Definition: ddraw.h:93
LONG device_state
Definition: ddraw_private.h:95
HRESULT CDECL wined3d_set_adapter_display_mode(struct wined3d *wined3d, UINT adapter_idx, const struct wined3d_display_mode *mode)
Definition: directx.c:4840

Referenced by ddraw1_RestoreDisplayMode(), ddraw2_RestoreDisplayMode(), ddraw4_RestoreDisplayMode(), and ddraw_set_cooperative_level().

◆ ddraw7_SetCooperativeLevel()

static HRESULT WINAPI ddraw7_SetCooperativeLevel ( IDirectDraw7 iface,
HWND  window,
DWORD  flags 
)
static

Definition at line 1022 of file ddraw.c.

1023{
1024 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
1025
1026 TRACE("iface %p, window %p, flags %#x.\n", iface, window, flags);
1027
1029}

◆ ddraw7_SetDisplayMode()

static HRESULT WINAPI ddraw7_SetDisplayMode ( IDirectDraw7 iface,
DWORD  width,
DWORD  height,
DWORD  bpp,
DWORD  refresh_rate,
DWORD  flags 
)
static

Definition at line 1084 of file ddraw.c.

1086{
1087 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
1090 HRESULT hr;
1091
1092 TRACE("iface %p, width %u, height %u, bpp %u, refresh_rate %u, flags %#x.\n",
1093 iface, width, height, bpp, refresh_rate, flags);
1094
1095 if (force_refresh_rate != 0)
1096 {
1097 TRACE("ForceRefreshRate overriding passed-in refresh rate (%u Hz) to %u Hz\n",
1100 }
1101
1103
1105 {
1107 return DDERR_NOEXCLUSIVEMODE;
1108 }
1109
1110 if (!width || !height)
1111 {
1112 /* It looks like Need for Speed Porsche Unleashed expects DD_OK here. */
1114 return DD_OK;
1115 }
1116
1117 switch (bpp)
1118 {
1119 case 8: format = WINED3DFMT_P8_UINT; break;
1120 case 15: format = WINED3DFMT_B5G5R5X1_UNORM; break;
1121 case 16: format = WINED3DFMT_B5G6R5_UNORM; break;
1122 case 24: format = WINED3DFMT_B8G8R8_UNORM; break;
1123 case 32: format = WINED3DFMT_B8G8R8X8_UNORM; break;
1124 default: format = WINED3DFMT_UNKNOWN; break;
1125 }
1126
1127 mode.width = width;
1128 mode.height = height;
1129 mode.refresh_rate = refresh_rate;
1130 mode.format_id = format;
1131 mode.scanline_ordering = WINED3D_SCANLINE_ORDERING_UNKNOWN;
1132
1133 /* TODO: The possible return values from msdn suggest that the screen mode
1134 * can't be changed if a surface is locked or some drawing is in progress. */
1136 {
1137 if (ddraw->primary)
1138 {
1139 DDSURFACEDESC2 *surface_desc = &ddraw->primary->surface_desc;
1140
1142 surface_desc->dwWidth, surface_desc->dwHeight, mode.format_id, WINED3D_MULTISAMPLE_NONE, 0)))
1143 ERR("Failed to resize buffers, hr %#x.\n", hr);
1144 else
1145 ddrawformat_from_wined3dformat(&ddraw->primary->surface_desc.u4.ddpfPixelFormat, mode.format_id);
1146 }
1148#ifdef __REACTOS__
1151#endif
1152 }
1153
1155
1157
1158 switch (hr)
1159 {
1161 default: return hr;
1162 }
1163}
DWORD force_refresh_rate
Definition: main.c:41
#define DDERR_UNSUPPORTED
Definition: ddraw.h:127
struct wined3d_swapchain * wined3d_swapchain
HWND dest_window
Definition: format.c:58
HRESULT CDECL wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapchain, unsigned int buffer_count, unsigned int width, unsigned int height, enum wined3d_format_id format_id, enum wined3d_multisample_type multisample_type, unsigned int multisample_quality)
Definition: swapchain.c:1200
@ WINED3D_MULTISAMPLE_NONE
Definition: wined3d.h:554
#define WINED3DERR_NOTAVAILABLE
Definition: wined3d.h:46
@ WINED3DFMT_B5G5R5X1_UNORM
Definition: wined3d.h:109
@ WINED3DFMT_UNKNOWN
Definition: wined3d.h:107
@ WINED3DFMT_B8G8R8_UNORM
Definition: wined3d.h:108
#define SWP_NOACTIVATE
Definition: winuser.h:1245
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define HWND_TOP
Definition: winuser.h:1210
#define SWP_SHOWWINDOW
Definition: winuser.h:1251

Referenced by ddraw1_SetDisplayMode(), ddraw2_SetDisplayMode(), and ddraw4_SetDisplayMode().

◆ ddraw7_StartModeTest()

static HRESULT WINAPI ddraw7_StartModeTest ( IDirectDraw7 iface,
SIZE Modes,
DWORD  NumModes,
DWORD  Flags 
)
static

Definition at line 2814 of file ddraw.c.

2815{
2816 FIXME("iface %p, modes %p, mode_count %u, flags %#x partial stub!\n",
2817 iface, Modes, NumModes, Flags);
2818
2819 /* This looks sane */
2820 if( (!Modes) || (NumModes == 0) ) return DDERR_INVALIDPARAMS;
2821
2822 /* DDSMT_ISTESTREQUIRED asks if a mode test is necessary.
2823 * As it is not, DDERR_TESTFINISHED is returned
2824 * (hopefully that's correct
2825 *
2826 if(Flags & DDSMT_ISTESTREQUIRED) return DDERR_TESTFINISHED;
2827 * well, that value doesn't (yet) exist in the wine headers, so ignore it
2828 */
2829
2830 return DD_OK;
2831}
static const VBE_MODE Modes[VBE_MODE_COUNT]
Definition: vbe.c:189

◆ ddraw7_TestCooperativeLevel()

static HRESULT WINAPI ddraw7_TestCooperativeLevel ( IDirectDraw7 iface)
static

Definition at line 2270 of file ddraw.c.

2271{
2272 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
2273
2274 TRACE("iface %p.\n", iface);
2275
2277}
@ DDRAW_DEVICE_STATE_LOST
Definition: ddraw_private.h:72

Referenced by ddraw4_TestCooperativeLevel().

◆ ddraw7_WaitForVerticalBlank()

static HRESULT WINAPI ddraw7_WaitForVerticalBlank ( IDirectDraw7 iface,
DWORD  Flags,
HANDLE  event 
)
static

Definition at line 2171 of file ddraw.c.

2172{
2173 static BOOL hide;
2174
2175 TRACE("iface %p, flags %#x, event %p.\n", iface, Flags, event);
2176
2177 /* This function is called often, so print the fixme only once */
2178 if(!hide)
2179 {
2180 FIXME("iface %p, flags %#x, event %p stub!\n", iface, Flags, event);
2181 hide = TRUE;
2182 }
2183
2184 /* MSDN says DDWAITVB_BLOCKBEGINEVENT is not supported */
2186 return DDERR_UNSUPPORTED; /* unchecked */
2187
2188 return DD_OK;
2189}
#define DDWAITVB_BLOCKBEGINEVENT
Definition: ddraw.h:650

Referenced by ddraw1_WaitForVerticalBlank(), ddraw2_WaitForVerticalBlank(), and ddraw4_WaitForVerticalBlank().

◆ ddraw_attach_d3d_device()

static HRESULT ddraw_attach_d3d_device ( struct ddraw ddraw,
struct wined3d_swapchain_desc swapchain_desc 
)
static

Definition at line 566 of file ddraw.c.

568{
569 HWND window = swapchain_desc->device_window;
570 HRESULT hr;
571
572 TRACE("ddraw %p.\n", ddraw);
573
574 if (!window || window == GetDesktopWindow())
575 {
576 window = CreateWindowExA(0, DDRAW_WINDOW_CLASS_NAME, "Hidden D3D Window",
578 NULL, NULL, NULL, NULL);
579 if (!window)
580 {
581 ERR("Failed to create window, last error %#x.\n", GetLastError());
582 return E_FAIL;
583 }
584
585 ShowWindow(window, SW_HIDE); /* Just to be sure */
586 WARN("No window for the Direct3DDevice, created hidden window %p.\n", window);
587
588 swapchain_desc->device_window = window;
589 }
590 else
591 {
592 TRACE("Using existing window %p for Direct3D rendering.\n", window);
593 }
595
596 /* Set this NOW, otherwise creating the depth stencil surface will cause a
597 * recursive loop until ram or emulated video memory is full. */
599 hr = wined3d_device_init_3d(ddraw->wined3d_device, swapchain_desc);
600 if (FAILED(hr))
601 {
602 ddraw->flags &= ~DDRAW_D3D_INITIALIZED;
603 return hr;
604 }
605
606 ddraw->declArraySize = 2;
607 if (!(ddraw->decls = heap_alloc_zero(ddraw->declArraySize * sizeof(*ddraw->decls))))
608 {
609 ERR("Error allocating an array for the converted vertex decls.\n");
610 ddraw->declArraySize = 0;
612 return E_OUTOFMEMORY;
613 }
614
615 TRACE("Successfully initialized 3D.\n");
616
617 return DD_OK;
618}
#define DDRAW_WINDOW_CLASS_NAME
#define E_FAIL
Definition: ddrawi.h:102
HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
Definition: device.c:1195
HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, struct wined3d_swapchain_desc *swapchain_desc)
Definition: device.c:1061
#define WS_DISABLED
Definition: pedump.c:621
HWND d3d_window
struct FvfToDecl * decls
UINT declArraySize
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define SW_HIDE
Definition: winuser.h:771
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define SM_CYSCREEN
Definition: winuser.h:963
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
#define SM_CXSCREEN
Definition: winuser.h:962
int WINAPI GetSystemMetrics(_In_ int)

Referenced by ddraw_create_swapchain().

◆ ddraw_create_swapchain()

static HRESULT ddraw_create_swapchain ( struct ddraw ddraw,
HWND  window,
BOOL  windowed 
)
static

Definition at line 620 of file ddraw.c.

621{
622 struct wined3d_swapchain_desc swapchain_desc;
625
627 {
628 ERR("Failed to get display mode.\n");
629 return hr;
630 }
631
632 memset(&swapchain_desc, 0, sizeof(swapchain_desc));
633 swapchain_desc.backbuffer_width = mode.width;
634 swapchain_desc.backbuffer_height = mode.height;
635 swapchain_desc.backbuffer_format = mode.format_id;
636 swapchain_desc.backbuffer_usage = WINED3DUSAGE_RENDERTARGET;
637 swapchain_desc.swap_effect = WINED3D_SWAP_EFFECT_COPY;
638 swapchain_desc.device_window = window;
639 swapchain_desc.windowed = windowed;
640 swapchain_desc.flags = WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH;
641
642 if (!(ddraw->flags & DDRAW_NO3D))
643 hr = ddraw_attach_d3d_device(ddraw, &swapchain_desc);
644 else
645 hr = wined3d_device_init_gdi(ddraw->wined3d_device, &swapchain_desc);
646
647 if (FAILED(hr))
648 {
649 ERR("Failed to create swapchain, hr %#x.\n", hr);
650 return hr;
651 }
652
654 {
655 ERR("Failed to get swapchain.\n");
656 return DDERR_INVALIDPARAMS;
657 }
658
661
662 if (ddraw->primary && ddraw->primary->palette)
664
665 return DD_OK;
666}
#define DDRAW_NO3D
Definition: ddraw_private.h:57
static void ddraw_set_swapchain_window(struct ddraw *ddraw, HWND window)
static HRESULT ddraw_attach_d3d_device(struct ddraw *ddraw, struct wined3d_swapchain_desc *swapchain_desc)
Definition: ddraw.c:566
struct wined3d_swapchain *CDECL wined3d_device_get_swapchain(const struct wined3d_device *device, UINT swapchain_idx)
Definition: device.c:533
HRESULT CDECL wined3d_device_init_gdi(struct wined3d_device *device, struct wined3d_swapchain_desc *swapchain_desc)
Definition: device.c:1147
void CDECL wined3d_swapchain_set_palette(struct wined3d_swapchain *swapchain, struct wined3d_palette *palette)
Definition: swapchain.c:296
ULONG CDECL wined3d_swapchain_incref(struct wined3d_swapchain *swapchain)
Definition: swapchain.c:104
#define WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH
Definition: wined3d.h:883
@ WINED3D_SWAP_EFFECT_COPY
Definition: wined3d.h:529
#define WINED3DUSAGE_RENDERTARGET
Definition: wined3d.h:899

Referenced by ddraw_set_cooperative_level().

◆ ddraw_d3dcaps1_from_7()

void ddraw_d3dcaps1_from_7 ( D3DDEVICEDESC caps1,
D3DDEVICEDESC7 caps7 
)

Definition at line 1196 of file ddraw.c.

1197{
1198 memset(caps1, 0, sizeof(*caps1));
1199 caps1->dwSize = sizeof(*caps1);
1200 caps1->dwFlags = D3DDD_COLORMODEL
1211 caps1->dcmColorModel = D3DCOLOR_RGB;
1212 caps1->dwDevCaps = caps7->dwDevCaps;
1213 caps1->dtcTransformCaps.dwSize = sizeof(caps1->dtcTransformCaps);
1215 caps1->bClipping = TRUE;
1216 caps1->dlcLightingCaps.dwSize = sizeof(caps1->dlcLightingCaps);
1223 caps1->dpcLineCaps = caps7->dpcLineCaps;
1224 caps1->dpcTriCaps = caps7->dpcTriCaps;
1227 caps1->dwMaxBufferSize = 0;
1228 caps1->dwMaxVertexCount = 65536;
1229 caps1->dwMinTextureWidth = caps7->dwMinTextureWidth;
1230 caps1->dwMinTextureHeight = caps7->dwMinTextureHeight;
1231 caps1->dwMaxTextureWidth = caps7->dwMaxTextureWidth;
1232 caps1->dwMaxTextureHeight = caps7->dwMaxTextureHeight;
1233 caps1->dwMinStippleWidth = 1;
1234 caps1->dwMinStippleHeight = 1;
1235 caps1->dwMaxStippleWidth = 32;
1236 caps1->dwMaxStippleHeight = 32;
1237 caps1->dwMaxTextureRepeat = caps7->dwMaxTextureRepeat;
1239 caps1->dwMaxAnisotropy = caps7->dwMaxAnisotropy;
1240 caps1->dvGuardBandLeft = caps7->dvGuardBandLeft;
1241 caps1->dvGuardBandTop = caps7->dvGuardBandTop;
1242 caps1->dvGuardBandRight = caps7->dvGuardBandRight;
1243 caps1->dvGuardBandBottom = caps7->dvGuardBandBottom;
1244 caps1->dvExtentsAdjust = caps7->dvExtentsAdjust;
1245 caps1->dwStencilCaps = caps7->dwStencilCaps;
1246 caps1->dwFVFCaps = caps7->dwFVFCaps;
1247 caps1->dwTextureOpCaps = caps7->dwTextureOpCaps;
1250}
#define D3DDD_LIGHTINGCAPS
Definition: d3dcaps.h:108
#define D3DDD_MAXBUFFERSIZE
Definition: d3dcaps.h:114
#define D3DDD_LINECAPS
Definition: d3dcaps.h:110
#define D3DDD_DEVICEZBUFFERBITDEPTH
Definition: d3dcaps.h:113
#define D3DLIGHTCAPS_DIRECTIONAL
Definition: d3dcaps.h:20
#define D3DDD_COLORMODEL
Definition: d3dcaps.h:105
#define D3DLIGHTCAPS_POINT
Definition: d3dcaps.h:18
#define D3DDD_DEVICERENDERBITDEPTH
Definition: d3dcaps.h:112
#define D3DLIGHTCAPS_SPOT
Definition: d3dcaps.h:19
#define D3DDD_TRANSFORMCAPS
Definition: d3dcaps.h:107
#define D3DDD_TRICAPS
Definition: d3dcaps.h:111
#define D3DDD_DEVCAPS
Definition: d3dcaps.h:106
#define D3DDD_BCLIPPING
Definition: d3dcaps.h:109
#define D3DTRANSFORMCAPS_CLIP
Definition: d3dcaps.h:15
#define D3DDD_MAXVERTEXCOUNT
Definition: d3dcaps.h:115
#define D3DLIGHTINGMODEL_RGB
Definition: d3dcaps.h:16
#define D3DLIGHTCAPS_PARALLELPOINT
Definition: dump.c:16
D3DPRIMCAPS dpcTriCaps
Definition: d3dcaps.h:360
WORD wMaxSimultaneousTextures
Definition: d3dcaps.h:379
DWORD dwMaxTextureAspectRatio
Definition: d3dcaps.h:368
DWORD dwMaxTextureHeight
Definition: d3dcaps.h:366
DWORD dwFVFCaps
Definition: d3dcaps.h:376
D3DPRIMCAPS dpcLineCaps
Definition: d3dcaps.h:359
DWORD dwMinTextureHeight
Definition: d3dcaps.h:364
DWORD dwMaxAnisotropy
Definition: d3dcaps.h:369
DWORD dwDeviceRenderBitDepth
Definition: d3dcaps.h:361
DWORD dwStencilCaps
Definition: d3dcaps.h:375
DWORD dwMaxActiveLights
Definition: d3dcaps.h:380
DWORD dwMaxTextureRepeat
Definition: d3dcaps.h:367
DWORD dwDeviceZBufferBitDepth
Definition: d3dcaps.h:362
DWORD dwTextureOpCaps
Definition: d3dcaps.h:377
D3DVALUE dvGuardBandRight
Definition: d3dcaps.h:372
D3DVALUE dvGuardBandBottom
Definition: d3dcaps.h:373
WORD wMaxTextureBlendStages
Definition: d3dcaps.h:378
D3DVALUE dvGuardBandTop
Definition: d3dcaps.h:371
DWORD dwMinTextureWidth
Definition: d3dcaps.h:363
D3DVALUE dvExtentsAdjust
Definition: d3dcaps.h:374
DWORD dwMaxTextureWidth
Definition: d3dcaps.h:365
D3DVALUE dvGuardBandLeft
Definition: d3dcaps.h:370
DWORD dwMaxStippleWidth
Definition: d3dcaps.h:334
D3DVALUE dvGuardBandTop
Definition: d3dcaps.h:343
DWORD dwDeviceZBufferBitDepth
Definition: d3dcaps.h:328
DWORD dwSize
Definition: d3dcaps.h:318
DWORD dwMaxTextureWidth
Definition: d3dcaps.h:333
D3DTRANSFORMCAPS dtcTransformCaps
Definition: d3dcaps.h:322
DWORD dwStencilCaps
Definition: d3dcaps.h:347
BOOL bClipping
Definition: d3dcaps.h:323
D3DVALUE dvGuardBandRight
Definition: d3dcaps.h:344
DWORD dwMaxTextureAspectRatio
Definition: d3dcaps.h:340
DWORD dwMaxTextureRepeat
Definition: d3dcaps.h:339
DWORD dwDeviceRenderBitDepth
Definition: d3dcaps.h:327
DWORD dwMaxBufferSize
Definition: d3dcaps.h:329
DWORD dwMaxVertexCount
Definition: d3dcaps.h:330
DWORD dwMaxStippleHeight
Definition: d3dcaps.h:335
DWORD dwDevCaps
Definition: d3dcaps.h:321
DWORD dwMaxTextureHeight
Definition: d3dcaps.h:333
WORD wMaxTextureBlendStages
Definition: d3dcaps.h:350
D3DVALUE dvExtentsAdjust
Definition: d3dcaps.h:346
DWORD dwMaxAnisotropy
Definition: d3dcaps.h:341
DWORD dwMinStippleWidth
Definition: d3dcaps.h:334
DWORD dwMinStippleHeight
Definition: d3dcaps.h:335
DWORD dwTextureOpCaps
Definition: d3dcaps.h:349
DWORD dwMinTextureWidth
Definition: d3dcaps.h:332
D3DVALUE dvGuardBandBottom
Definition: d3dcaps.h:345
D3DVALUE dvGuardBandLeft
Definition: d3dcaps.h:342
DWORD dwMinTextureHeight
Definition: d3dcaps.h:332
WORD wMaxSimultaneousTextures
Definition: d3dcaps.h:351
DWORD dwFVFCaps
Definition: d3dcaps.h:348
D3DLIGHTINGCAPS dlcLightingCaps
Definition: d3dcaps.h:324
DWORD dwNumLights
Definition: d3dcaps.h:259
DWORD dwLightingModel
Definition: d3dcaps.h:258

Referenced by d3d3_EnumDevices(), d3d3_FindDevice(), and d3d_device3_GetCaps().

◆ ddraw_destroy()

static void ddraw_destroy ( struct ddraw This)
static

Definition at line 423 of file ddraw.c.

424{
425 IDirectDraw7_SetCooperativeLevel(&This->IDirectDraw7_iface, NULL, DDSCL_NORMAL);
426 IDirectDraw7_RestoreDisplayMode(&This->IDirectDraw7_iface);
427
428 /* Destroy the device window if we created one */
429 if(This->devicewindow != 0)
430 {
431 TRACE(" (%p) Destroying the device window %p\n", This, This->devicewindow);
432 DestroyWindow(This->devicewindow);
433 This->devicewindow = 0;
434 }
435
437 list_remove(&This->ddraw_list_entry);
439
440 if (This->wined3d_swapchain)
442 wined3d_device_decref(This->wined3d_device);
443 wined3d_decref(This->wined3d);
444
445 if (This->d3ddevice)
446 This->d3ddevice->ddraw = NULL;
447
448 /* Now free the object */
450}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void ddraw_destroy_swapchain(struct ddraw *ddraw)
Definition: ddraw.c:368
ULONG CDECL wined3d_device_decref(struct wined3d_device *device)
Definition: device.c:472
ULONG CDECL wined3d_decref(struct wined3d *wined3d)
Definition: directx.c:465
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by ddraw1_Release(), ddraw2_Release(), ddraw4_Release(), and ddraw7_Release().

◆ ddraw_destroy_swapchain()

static void ddraw_destroy_swapchain ( struct ddraw ddraw)
static

Definition at line 368 of file ddraw.c.

369{
370 TRACE("Destroying the swapchain.\n");
371
374
375 if (!(ddraw->flags & DDRAW_NO3D))
376 {
377 UINT i;
378
379 for (i = 0; i < ddraw->numConvertedDecls; ++i)
380 {
382 }
385
387 {
388 ERR("Failed to uninit 3D.\n");
389 }
390 else
391 {
392 /* Free the d3d window if one was created. */
394 {
395 TRACE("Destroying the hidden render window %p.\n", ddraw->d3d_window);
397 ddraw->d3d_window = 0;
398 }
399 }
400
401 ddraw->flags &= ~DDRAW_D3D_INITIALIZED;
402 }
403 else
404 {
406 }
407
409
410 TRACE("Swapchain destroyed.\n");
411}
HRESULT CDECL wined3d_device_uninit_gdi(struct wined3d_device *device)
Definition: device.c:1265
unsigned int UINT
Definition: ndis.h:50
UINT numConvertedDecls
ULONG CDECL wined3d_swapchain_decref(struct wined3d_swapchain *swapchain)
Definition: swapchain.c:113
ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration *declaration)

Referenced by ddraw_destroy(), and ddraw_set_cooperative_level().

◆ ddraw_find_decl()

struct wined3d_vertex_declaration * ddraw_find_decl ( struct ddraw This,
DWORD  fvf 
)

Definition at line 4801 of file ddraw.c.

4802{
4803 struct wined3d_vertex_declaration *pDecl = NULL;
4804 HRESULT hr;
4805 int p, low, high; /* deliberately signed */
4806 struct FvfToDecl *convertedDecls = This->decls;
4807
4808 TRACE("Searching for declaration for fvf %08x... ", fvf);
4809
4810 low = 0;
4811 high = This->numConvertedDecls - 1;
4812 while(low <= high) {
4813 p = (low + high) >> 1;
4814 TRACE("%d ", p);
4815 if(convertedDecls[p].fvf == fvf) {
4816 TRACE("found %p\n", convertedDecls[p].decl);
4817 return convertedDecls[p].decl;
4818 } else if(convertedDecls[p].fvf < fvf) {
4819 low = p + 1;
4820 } else {
4821 high = p - 1;
4822 }
4823 }
4824 TRACE("not found. Creating and inserting at position %d.\n", low);
4825
4828 if (hr != S_OK) return NULL;
4829
4830 if (This->declArraySize == This->numConvertedDecls)
4831 {
4832 unsigned int grow = max(This->declArraySize / 2, 8);
4833
4834 if (!(convertedDecls = heap_realloc(convertedDecls,
4835 (This->numConvertedDecls + grow) * sizeof(*convertedDecls))))
4836 {
4838 return NULL;
4839 }
4840 This->decls = convertedDecls;
4841 This->declArraySize += grow;
4842 }
4843
4844 memmove(convertedDecls + low + 1, convertedDecls + low, sizeof(convertedDecls[0]) * (This->numConvertedDecls - low));
4845 convertedDecls[low].decl = pDecl;
4846 convertedDecls[low].fvf = fvf;
4847 This->numConvertedDecls++;
4848
4849 TRACE("Returning %p. %d decls in array\n", pDecl, This->numConvertedDecls);
4850 return pDecl;
4851}
const struct wined3d_parent_ops ddraw_null_wined3d_parent_ops
Definition: ddraw.c:83
GLfloat GLfloat p
Definition: glext.h:8902
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
struct wined3d_vertex_declaration * decl
Definition: ddraw_private.h:51
DWORD fvf
Definition: d3d8_private.h:87
#define max(a, b)
Definition: svc.c:63
HRESULT CDECL wined3d_vertex_declaration_create_from_fvf(struct wined3d_device *device, DWORD fvf, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_vertex_declaration **declaration)

Referenced by d3d_device7_DrawIndexedPrimitive(), d3d_device7_DrawIndexedPrimitiveStrided(), d3d_device7_DrawPrimitive(), d3d_device7_DrawPrimitiveStrided(), and d3d_vertex_buffer_create().

◆ ddraw_from_device_parent()

static struct ddraw * ddraw_from_device_parent ( struct wined3d_device_parent device_parent)
inlinestatic

Definition at line 4853 of file ddraw.c.

4854{
4855 return CONTAINING_RECORD(device_parent, struct ddraw, device_parent);
4856}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by device_parent_activate(), device_parent_create_swapchain(), device_parent_create_swapchain_texture(), device_parent_mode_changed(), and device_parent_surface_created().

◆ ddraw_frontbuffer_destroyed()

static void STDMETHODCALLTYPE ddraw_frontbuffer_destroyed ( void parent)
static

Definition at line 4981 of file ddraw.c.

4982{
4983 struct ddraw *ddraw = parent;
4985}
r parent
Definition: btrfs.c:3010
struct wined3d_texture * wined3d_frontbuffer
Definition: ddraw_private.h:99

◆ ddraw_get_d3dcaps()

HRESULT ddraw_get_d3dcaps ( const struct ddraw ddraw,
D3DDEVICEDESC7 caps 
)

Definition at line 1252 of file ddraw.c.

1253{
1254 WINED3DCAPS wined3d_caps;
1255 HRESULT hr;
1256
1257 TRACE("ddraw %p, caps %p.\n", ddraw, caps);
1258
1259 memset(&wined3d_caps, 0, sizeof(wined3d_caps));
1260
1264 if (FAILED(hr))
1265 {
1266 WARN("Failed to get device caps, hr %#x.\n", hr);
1267 return hr;
1268 }
1269
1270 caps->dwDevCaps = wined3d_caps.DevCaps;
1271 caps->dpcLineCaps.dwMiscCaps = wined3d_caps.PrimitiveMiscCaps;
1272 caps->dpcLineCaps.dwRasterCaps = wined3d_caps.RasterCaps;
1273 caps->dpcLineCaps.dwZCmpCaps = wined3d_caps.ZCmpCaps;
1274 caps->dpcLineCaps.dwSrcBlendCaps = wined3d_caps.SrcBlendCaps;
1275 caps->dpcLineCaps.dwDestBlendCaps = wined3d_caps.DestBlendCaps;
1276 caps->dpcLineCaps.dwAlphaCmpCaps = wined3d_caps.AlphaCmpCaps;
1277 caps->dpcLineCaps.dwShadeCaps = wined3d_caps.ShadeCaps;
1278 caps->dpcLineCaps.dwTextureCaps = wined3d_caps.TextureCaps;
1281
1282 caps->dwMaxTextureWidth = wined3d_caps.MaxTextureWidth;
1283 caps->dwMaxTextureHeight = wined3d_caps.MaxTextureHeight;
1284
1285 caps->dwMaxTextureRepeat = wined3d_caps.MaxTextureRepeat;
1287 caps->dwMaxAnisotropy = wined3d_caps.MaxAnisotropy;
1288 caps->dvMaxVertexW = wined3d_caps.MaxVertexW;
1289
1290 caps->dvGuardBandLeft = wined3d_caps.GuardBandLeft;
1291 caps->dvGuardBandTop = wined3d_caps.GuardBandTop;
1292 caps->dvGuardBandRight = wined3d_caps.GuardBandRight;
1293 caps->dvGuardBandBottom = wined3d_caps.GuardBandBottom;
1294
1295 caps->dvExtentsAdjust = wined3d_caps.ExtentsAdjust;
1296 caps->dwStencilCaps = wined3d_caps.StencilCaps;
1297
1298 caps->dwFVFCaps = wined3d_caps.FVFCaps;
1299 caps->dwTextureOpCaps = wined3d_caps.TextureOpCaps;
1300
1301 caps->dwVertexProcessingCaps = wined3d_caps.VertexProcessingCaps;
1302 caps->dwMaxActiveLights = wined3d_caps.MaxActiveLights;
1303
1304 /* Remove all non-d3d7 caps */
1305 caps->dwDevCaps &= (
1313
1314 caps->dwStencilCaps &= (
1318
1319 /* FVF caps ?*/
1320
1321 caps->dwTextureOpCaps &= (
1330
1331 caps->dwVertexProcessingCaps &= (
1334
1335 caps->dpcLineCaps.dwMiscCaps &= (
1339
1340 caps->dpcLineCaps.dwRasterCaps &= (
1349
1350 caps->dpcLineCaps.dwZCmpCaps &= (
1354
1355 caps->dpcLineCaps.dwSrcBlendCaps &= (
1361
1362 caps->dpcLineCaps.dwDestBlendCaps &= (
1368
1369 caps->dpcLineCaps.dwAlphaCmpCaps &= (
1373
1374 caps->dpcLineCaps.dwShadeCaps &= (
1382
1383 caps->dpcLineCaps.dwTextureCaps &= (
1388
1396
1400
1402 {
1403 /* DirectX7 always has the np2 flag set, no matter what the card
1404 * supports. Some old games (Rollcage) check the caps incorrectly.
1405 * If wined3d supports nonpow2 textures it also has np2 conditional
1406 * support. */
1408 }
1409
1410 /* Fill the missing members, and do some fixup */
1411 caps->dpcLineCaps.dwSize = sizeof(caps->dpcLineCaps);
1420 caps->dpcLineCaps.dwStippleWidth = 32;
1421 caps->dpcLineCaps.dwStippleHeight = 32;
1422 /* Use the same for the TriCaps */
1423 caps->dpcTriCaps = caps->dpcLineCaps;
1424
1427 caps->dwMinTextureWidth = 1;
1428 caps->dwMinTextureHeight = 1;
1429
1430 /* Convert DWORDs safely to WORDs */
1431 caps->wMaxTextureBlendStages = min(wined3d_caps.MaxTextureBlendStages, 0xffff);
1432 caps->wMaxSimultaneousTextures = min(wined3d_caps.MaxSimultaneousTextures, 0xffff);
1434 caps->wMaxVertexBlendMatrices = min(wined3d_caps.MaxVertexBlendMatrices, 0xffff);
1435
1436 caps->deviceGUID = IID_IDirect3DTnLHalDevice;
1437
1438 caps->dwReserved1 = 0;
1439 caps->dwReserved2 = 0;
1440 caps->dwReserved3 = 0;
1441 caps->dwReserved4 = 0;
1442
1443 return DD_OK;
1444}
#define D3DPCMPCAPS_EQUAL
Definition: d3d8caps.h:90
#define D3DPRASTERCAPS_ANTIALIASEDGES
Definition: d3d8caps.h:77
#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR
Definition: d3d8caps.h:171
#define D3DDEVCAPS_EXECUTESYSTEMMEMORY
Definition: d3d8caps.h:36
#define D3DTEXOPCAPS_MODULATE2X
Definition: d3d8caps.h:156
#define D3DTEXOPCAPS_ADDSIGNED2X
Definition: d3d8caps.h:160
#define D3DPTADDRESSCAPS_MIRROR
Definition: d3d8caps.h:139
#define D3DPBLENDCAPS_SRCCOLOR
Definition: d3d8caps.h:98
#define D3DDEVCAPS_CANRENDERAFTERFLIP
Definition: d3d8caps.h:43
#define D3DTEXOPCAPS_SELECTARG1
Definition: d3d8caps.h:153
#define D3DVTXPCAPS_LOCALVIEWER
Definition: d3d8caps.h:185
#define D3DPTEXTURECAPS_PROJECTED
Definition: d3d8caps.h:120
#define D3DTEXOPCAPS_BLENDCURRENTALPHA
Definition: d3d8caps.h:167
#define D3DPRASTERCAPS_WBUFFER
Definition: d3d8caps.h:83
#define D3DPBLENDCAPS_DESTCOLOR
Definition: d3d8caps.h:104
#define D3DTEXOPCAPS_ADDSMOOTH
Definition: d3d8caps.h:162
#define D3DDEVCAPS_HWTRANSFORMANDLIGHT
Definition: d3d8caps.h:48
#define D3DPTADDRESSCAPS_WRAP
Definition: d3d8caps.h:138
#define D3DPCMPCAPS_LESS
Definition: d3d8caps.h:89
#define D3DPMISCCAPS_CULLNONE
Definition: d3d8caps.h:58
#define D3DPTFILTERCAPS_MAGFAFLATCUBIC
Definition: d3d8caps.h:136
#define D3DPTFILTERCAPS_MIPFLINEAR
Definition: d3d8caps.h:132
#define D3DPMISCCAPS_CULLCW
Definition: d3d8caps.h:59
#define D3DDEVCAPS_TEXTUREVIDEOMEMORY
Definition: d3d8caps.h:41
#define D3DTEXOPCAPS_ADDSIGNED
Definition: d3d8caps.h:159
#define D3DDEVCAPS_DRAWPRIMITIVES2
Definition: d3d8caps.h:45
#define D3DPBLENDCAPS_INVSRCCOLOR
Definition: d3d8caps.h:99
#define D3DPBLENDCAPS_ZERO
Definition: d3d8caps.h:96
#define D3DSTENCILCAPS_DECR
Definition: d3d8caps.h:151
#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM
Definition: d3d8caps.h:166
#define D3DDEVCAPS_TEXTURESYSTEMMEMORY
Definition: d3d8caps.h:40
#define D3DPTFILTERCAPS_MINFANISOTROPIC
Definition: d3d8caps.h:130
#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE
Definition: d3d8caps.h:117
#define D3DPBLENDCAPS_INVDESTCOLOR
Definition: d3d8caps.h:105
#define D3DTEXOPCAPS_SUBTRACT
Definition: d3d8caps.h:161
#define D3DPBLENDCAPS_INVDESTALPHA
Definition: d3d8caps.h:103
#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA
Definition: d3d8caps.h:170
#define D3DSTENCILCAPS_INVERT
Definition: d3d8caps.h:149
#define D3DVTXPCAPS_MATERIALSOURCE7
Definition: d3d8caps.h:182
#define D3DPTFILTERCAPS_MINFLINEAR
Definition: d3d8caps.h:129
#define D3DPTEXTURECAPS_SQUAREONLY
Definition: d3d8caps.h:116
#define D3DDEVCAPS_DRAWPRIMITIVES2EX
Definition: d3d8caps.h:47
#define D3DPTFILTERCAPS_MAGFANISOTROPIC
Definition: d3d8caps.h:135
#define D3DPTEXTURECAPS_ALPHAPALETTE
Definition: d3d8caps.h:118
#define D3DPSHADECAPS_COLORGOURAUDRGB
Definition: d3d8caps.h:109
#define D3DPRASTERCAPS_ZBUFFERLESSHSR
Definition: d3d8caps.h:80
#define D3DPBLENDCAPS_SRCALPHASAT
Definition: d3d8caps.h:106
#define D3DPBLENDCAPS_BOTHSRCALPHA
Definition: d3d8caps.h:107
#define D3DDEVCAPS_EXECUTEVIDEOMEMORY
Definition: d3d8caps.h:37
#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE
Definition: d3d8caps.h:174
#define D3DPRASTERCAPS_WFOG
Definition: d3d8caps.h:84
#define D3DPTADDRESSCAPS_BORDER
Definition: d3d8caps.h:141
#define D3DPTADDRESSCAPS_INDEPENDENTUV
Definition: d3d8caps.h:142
#define D3DPSHADECAPS_FOGGOURAUD
Definition: d3d8caps.h:112
#define D3DPTEXTURECAPS_ALPHA
Definition: d3d8caps.h:115
#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES
Definition: d3d8caps.h:46
#define D3DTEXOPCAPS_DISABLE
Definition: d3d8caps.h:152
#define D3DPSHADECAPS_SPECULARGOURAUDRGB
Definition: d3d8caps.h:110
#define D3DPMISCCAPS_CULLCCW
Definition: d3d8caps.h:60
#define D3DTEXOPCAPS_SELECTARG2
Definition: d3d8caps.h:154
#define D3DPMISCCAPS_LINEPATTERNREP
Definition: d3d8caps.h:57
#define D3DPCMPCAPS_NOTEQUAL
Definition: d3d8caps.h:93
#define D3DSTENCILCAPS_DECRSAT
Definition: d3d8caps.h:148
#define D3DDEVCAPS_DRAWPRIMTLVERTEX
Definition: d3d8caps.h:42
#define D3DPRASTERCAPS_ANISOTROPY
Definition: d3d8caps.h:82
#define D3DVTXPCAPS_DIRECTIONALLIGHTS
Definition: d3d8caps.h:183
#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY
Definition: d3d8caps.h:38
#define D3DPBLENDCAPS_INVSRCALPHA
Definition: d3d8caps.h:101
#define D3DSTENCILCAPS_ZERO
Definition: d3d8caps.h:145
#define D3DPRASTERCAPS_ZFOG
Definition: d3d8caps.h:85
#define D3DPCMPCAPS_GREATER
Definition: d3d8caps.h:92
#define D3DPBLENDCAPS_DESTALPHA
Definition: d3d8caps.h:102
#define D3DTEXOPCAPS_BLENDTEXTUREALPHA
Definition: d3d8caps.h:164
#define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC
Definition: d3d8caps.h:137
#define D3DSTENCILCAPS_INCR
Definition: d3d8caps.h:150
#define D3DTEXOPCAPS_MODULATE
Definition: d3d8caps.h:155
#define D3DPRASTERCAPS_PAT
Definition: d3d8caps.h:73
#define D3DTEXOPCAPS_BUMPENVMAP
Definition: d3d8caps.h:173
#define D3DPCMPCAPS_ALWAYS
Definition: d3d8caps.h:95
#define D3DPRASTERCAPS_FOGRANGE
Definition: d3d8caps.h:81
#define D3DPSHADECAPS_ALPHAGOURAUDBLEND
Definition: d3d8caps.h:111
#define D3DPBLENDCAPS_SRCALPHA
Definition: d3d8caps.h:100
#define D3DDEVCAPS_HWRASTERIZATION
Definition: d3d8caps.h:50
#define D3DPBLENDCAPS_ONE
Definition: d3d8caps.h:97
#define D3DTEXOPCAPS_PREMODULATE
Definition: d3d8caps.h:168
#define D3DPRASTERCAPS_FOGVERTEX
Definition: d3d8caps.h:75
#define D3DTEXOPCAPS_BLENDFACTORALPHA
Definition: d3d8caps.h:165
#define D3DSTENCILCAPS_INCRSAT
Definition: d3d8caps.h:147
#define D3DPCMPCAPS_LESSEQUAL
Definition: d3d8caps.h:91
#define D3DPTFILTERCAPS_MAGFLINEAR
Definition: d3d8caps.h:134
#define D3DPTADDRESSCAPS_CLAMP
Definition: d3d8caps.h:140
#define D3DPTFILTERCAPS_MINFPOINT
Definition: d3d8caps.h:128
#define D3DPTEXTURECAPS_CUBEMAP
Definition: d3d8caps.h:121
#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM
Definition: d3d8caps.h:44
#define D3DVTXPCAPS_TEXGEN
Definition: d3d8caps.h:181
#define D3DTEXOPCAPS_DOTPRODUCT3
Definition: d3d8caps.h:175
#define D3DPBLENDCAPS_BOTHINVSRCALPHA
Definition: d3d8caps.h:108
#define D3DPCMPCAPS_NEVER
Definition: d3d8caps.h:88
#define D3DDEVCAPS_CANBLTSYSTONONLOCAL
Definition: d3d8caps.h:49
#define D3DPRASTERCAPS_FOGTABLE
Definition: d3d8caps.h:76
#define D3DSTENCILCAPS_KEEP
Definition: d3d8caps.h:144
#define D3DPTFILTERCAPS_MIPFPOINT
Definition: d3d8caps.h:131
#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY
Definition: d3d8caps.h:39
#define D3DPMISCCAPS_MASKZ
Definition: d3d8caps.h:56
#define D3DPCMPCAPS_GREATEREQUAL
Definition: d3d8caps.h:94
#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR
Definition: d3d8caps.h:169
#define D3DPRASTERCAPS_ZTEST
Definition: d3d8caps.h:74
#define D3DVTXPCAPS_POSITIONALLIGHTS
Definition: d3d8caps.h:184
#define D3DPRASTERCAPS_ZBIAS
Definition: d3d8caps.h:79
#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA
Definition: d3d8caps.h:172
#define D3DTEXOPCAPS_ADD
Definition: d3d8caps.h:158
#define D3DSTENCILCAPS_REPLACE
Definition: d3d8caps.h:146
#define D3DPTFILTERCAPS_MAGFPOINT
Definition: d3d8caps.h:133
#define D3DPRASTERCAPS_MIPMAPLODBIAS
Definition: d3d8caps.h:78
#define D3DTEXOPCAPS_MODULATE4X
Definition: d3d8caps.h:157
#define D3DPRASTERCAPS_DITHER
Definition: d3d8caps.h:72
#define D3DMAXUSERCLIPPLANES
Definition: d3d8types.h:75
#define D3DPTBLENDCAPS_COPY
Definition: d3dcaps.h:99
#define D3DPTBLENDCAPS_MODULATEALPHA
Definition: d3dcaps.h:96
#define D3DPRASTERCAPS_ROP2
Definition: d3dcaps.h:30
#define D3DPTFILTERCAPS_LINEAR
Definition: d3dcaps.h:88
#define D3DPSHADECAPS_SPECULARFLATMONO
Definition: d3dcaps.h:66
#define D3DPTFILTERCAPS_LINEARMIPNEAREST
Definition: d3dcaps.h:91
#define D3DPTBLENDCAPS_MODULATEMASK
Definition: d3dcaps.h:98
#define D3DDEVCAPS_FLOATTLVERTEX
Definition: d3dcaps.h:116
#define D3DPTBLENDCAPS_MODULATE
Definition: d3dcaps.h:94
#define D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT
Definition: d3dcaps.h:159
#define D3DPRASTERCAPS_STIPPLE
Definition: d3dcaps.h:38
#define D3DPTEXTURECAPS_BORDER
Definition: d3dcaps.h:85
#define D3DPTFILTERCAPS_NEAREST
Definition: d3dcaps.h:87
#define D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED
Definition: d3dcaps.h:75
#define D3DPTBLENDCAPS_DECALMASK
Definition: d3dcaps.h:97
#define D3DDEVCAPS_SORTDECREASINGZ
Definition: d3dcaps.h:118
#define D3DPTEXTURECAPS_TRANSPARENCY
Definition: d3dcaps.h:84
#define D3DPSHADECAPS_SPECULARGOURAUDMONO
Definition: d3dcaps.h:68
#define D3DPSHADECAPS_ALPHAPHONGBLEND
Definition: d3dcaps.h:76
#define D3DPSHADECAPS_COLORPHONGRGB
Definition: d3dcaps.h:65
#define D3DPSHADECAPS_ALPHAPHONGSTIPPLED
Definition: d3dcaps.h:77
#define D3DPMISCCAPS_CONFORMANT
Definition: d3dcaps.h:25
#define D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT
Definition: d3dcaps.h:160
#define D3DPTFILTERCAPS_LINEARMIPLINEAR
Definition: d3dcaps.h:92
#define D3DDEVCAPS_SORTEXACT
Definition: d3dcaps.h:119
#define D3DPTFILTERCAPS_MIPNEAREST
Definition: d3dcaps.h:89
#define D3DPSHADECAPS_SPECULARFLATRGB
Definition: d3dcaps.h:67
#define D3DVTXPCAPS_VERTEXFOG
Definition: d3dcaps.h:242
#define D3DPTEXTURECAPS_COLORKEYBLEND
Definition: d3dcaps.h:236
#define D3DPTBLENDCAPS_ADD
Definition: d3dcaps.h:167
#define D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT
Definition: d3dcaps.h:177
#define D3DPSHADECAPS_COLORFLATMONO
Definition: d3dcaps.h:60
#define D3DPRASTERCAPS_SUBPIXELX
Definition: d3dcaps.h:35
#define D3DPSHADECAPS_ALPHAFLATBLEND
Definition: d3dcaps.h:72
#define D3DPTBLENDCAPS_DECALALPHA
Definition: d3dcaps.h:95
#define D3DPRASTERCAPS_XOR
Definition: d3dcaps.h:31
#define D3DPSHADECAPS_ALPHAFLATSTIPPLED
Definition: d3dcaps.h:73
#define D3DPMISCCAPS_MASKPLANES
Definition: d3dcaps.h:22
#define D3DPRASTERCAPS_SUBPIXEL
Definition: d3dcaps.h:34
#define D3DPSHADECAPS_FOGFLAT
Definition: d3dcaps.h:78
#define D3DPSHADECAPS_FOGPHONG
Definition: d3dcaps.h:80
#define D3DPSHADECAPS_COLORPHONGMONO
Definition: d3dcaps.h:64
#define D3DPSHADECAPS_COLORGOURAUDMONO
Definition: d3dcaps.h:62
#define D3DPSHADECAPS_SPECULARPHONGMONO
Definition: d3dcaps.h:70
#define D3DPSHADECAPS_SPECULARPHONGRGB
Definition: d3dcaps.h:71
#define D3DPSHADECAPS_COLORFLATRGB
Definition: d3dcaps.h:61
#define D3DPTBLENDCAPS_DECAL
Definition: d3dcaps.h:93
#define D3DDEVCAPS_SORTINCREASINGZ
Definition: d3dcaps.h:117
#define D3DPTFILTERCAPS_MIPLINEAR
Definition: d3dcaps.h:90
#define DDBD_24
Definition: ddraw.h:472
#define DDBD_32
Definition: ddraw.h:473
#define DDBD_16
Definition: ddraw.h:471
WORD wMaxUserClipPlanes
Definition: d3dcaps.h:383
DWORD dwReserved2
Definition: d3dcaps.h:387
DWORD dwVertexProcessingCaps
Definition: d3dcaps.h:385
DWORD dwReserved4
Definition: d3dcaps.h:389
DWORD dwReserved1
Definition: d3dcaps.h:386
WORD wMaxVertexBlendMatrices
Definition: d3dcaps.h:384
DWORD dwReserved3
Definition: d3dcaps.h:388
D3DVALUE dvMaxVertexW
Definition: d3dcaps.h:381
DWORD dwZCmpCaps
Definition: d3dcaps.h:267
DWORD dwMiscCaps
Definition: d3dcaps.h:265
DWORD dwDestBlendCaps
Definition: d3dcaps.h:269
DWORD dwAlphaCmpCaps
Definition: d3dcaps.h:270
DWORD dwRasterCaps
Definition: d3dcaps.h:266
DWORD dwTextureBlendCaps
Definition: d3dcaps.h:274
DWORD dwStippleWidth
Definition: d3dcaps.h:276
DWORD dwShadeCaps
Definition: d3dcaps.h:271
DWORD dwSize
Definition: d3dcaps.h:264
DWORD dwStippleHeight
Definition: d3dcaps.h:277
DWORD dwTextureAddressCaps
Definition: d3dcaps.h:275
DWORD dwTextureFilterCaps
Definition: d3dcaps.h:273
DWORD dwSrcBlendCaps
Definition: d3dcaps.h:268
DWORD DevCaps
Definition: wined3d.h:1895
DWORD MaxTextureAspectRatio
Definition: wined3d.h:1915
DWORD ShadeCaps
Definition: wined3d.h:1902
DWORD PrimitiveMiscCaps
Definition: wined3d.h:1896
float GuardBandRight
Definition: wined3d.h:1921
DWORD TextureFilterCaps
Definition: wined3d.h:1904
DWORD MaxTextureHeight
Definition: wined3d.h:1912
DWORD MaxAnisotropy
Definition: wined3d.h:1916
DWORD MaxTextureWidth
Definition: wined3d.h:1911
float MaxVertexW
Definition: wined3d.h:1917
DWORD AlphaCmpCaps
Definition: wined3d.h:1901
DWORD TextureAddressCaps
Definition: wined3d.h:1907
float GuardBandBottom
Definition: wined3d.h:1922
DWORD MaxTextureRepeat
Definition: wined3d.h:1914
DWORD StencilCaps
Definition: wined3d.h:1925
DWORD MaxUserClipPlanes
Definition: wined3d.h:1934
DWORD VertexProcessingCaps
Definition: wined3d.h:1932
DWORD TextureCaps
Definition: wined3d.h:1903
DWORD MaxTextureBlendStages
Definition: wined3d.h:1929
DWORD DestBlendCaps
Definition: wined3d.h:1900
float ExtentsAdjust
Definition: wined3d.h:1924
float GuardBandLeft
Definition: wined3d.h:1919
DWORD TextureOpCaps
Definition: wined3d.h:1928
DWORD MaxVertexBlendMatrices
Definition: wined3d.h:1935
DWORD ZCmpCaps
Definition: wined3d.h:1898
DWORD MaxSimultaneousTextures
Definition: wined3d.h:1930
float GuardBandTop
Definition: wined3d.h:1920
DWORD FVFCaps
Definition: wined3d.h:1927
DWORD RasterCaps
Definition: wined3d.h:1897
DWORD SrcBlendCaps
Definition: wined3d.h:1899
DWORD MaxActiveLights
Definition: wined3d.h:1933
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

Referenced by d3d3_EnumDevices(), d3d3_FindDevice(), d3d7_EnumDevices(), d3d_device3_GetCaps(), and d3d_device7_GetCaps().

◆ ddraw_init()

HRESULT ddraw_init ( struct ddraw ddraw,
DWORD  flags,
enum wined3d_device_type  device_type 
)

Definition at line 5052 of file ddraw.c.

5053{
5054 WINED3DCAPS caps;
5055 HRESULT hr;
5056
5061 ddraw->IDirect3D_iface.lpVtbl = &d3d1_vtbl;
5062 ddraw->IDirect3D2_iface.lpVtbl = &d3d2_vtbl;
5063 ddraw->IDirect3D3_iface.lpVtbl = &d3d3_vtbl;
5064 ddraw->IDirect3D7_iface.lpVtbl = &d3d7_vtbl;
5066 ddraw->numIfaces = 1;
5067 ddraw->ref7 = 1;
5068
5070 if (!(ddraw->wined3d = wined3d_create(flags)))
5071 {
5073 if (!(ddraw->wined3d = wined3d_create(flags)))
5074 {
5075 WARN("Failed to create a wined3d object.\n");
5076 return E_FAIL;
5077 }
5078 }
5079
5081 {
5082 ERR("Failed to get device caps, hr %#x.\n", hr);
5084 return E_FAIL;
5085 }
5086
5087 if (!(caps.ddraw_caps.caps & WINEDDCAPS_3D))
5088 {
5089 WARN("Created a wined3d object without 3D support.\n");
5091 }
5092
5095 {
5096 WARN("Failed to create a wined3d device, hr %#x.\n", hr);
5098 return hr;
5099 }
5100
5102
5103 return DD_OK;
5104}
static void list_init(struct list_entry *head)
Definition: list.h:51
#define DDRAW_WINED3D_FLAGS
Definition: ddraw_private.h:64
device_type
static const struct IDirect3D3Vtbl d3d3_vtbl
Definition: ddraw.c:4734
static const struct IDirect3D7Vtbl d3d7_vtbl
Definition: ddraw.c:4720
static const struct IDirect3D2Vtbl d3d2_vtbl
Definition: ddraw.c:4752
static const struct IDirectDraw2Vtbl ddraw2_vtbl
Definition: ddraw.c:4660
static const struct IDirectDraw7Vtbl ddraw7_vtbl
Definition: ddraw.c:4583
static const struct IDirect3DVtbl d3d1_vtbl
Definition: ddraw.c:4767
static const struct wined3d_device_parent_ops ddraw_wined3d_device_parent_ops
Definition: ddraw.c:5041
static const struct IDirectDraw4Vtbl ddraw4_vtbl
Definition: ddraw.c:4623
static struct IDirectDrawVtbl ddraw1_vtbl
Definition: ddraw.c:4691
LONG ref7
Definition: ddraw_private.h:90
LONG numIfaces
Definition: ddraw_private.h:90
struct wined3d_device_parent device_parent
Definition: ddraw_private.h:87
HRESULT CDECL wined3d_device_create(struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, HWND focus_window, DWORD flags, BYTE surface_alignment, struct wined3d_device_parent *device_parent, struct wined3d_device **device)
Definition: directx.c:6244
#define WINED3D_NO3D
Definition: wined3d.h:1316
#define WINEDDCAPS_3D
Definition: wined3d.h:1495
struct wined3d *CDECL wined3d_create(DWORD flags)
Definition: wined3d_main.c:97

Referenced by DDRAW_Create().

◆ ddraw_match_surface_desc()

static BOOL ddraw_match_surface_desc ( const DDSURFACEDESC2 requested,
const DDSURFACEDESC2 provided 
)
static

Definition at line 3130 of file ddraw.c.

3131{
3132 struct compare_info
3133 {
3134 DWORD flag;
3136 size_t size;
3137 };
3138
3139#define CMP(FLAG, FIELD) \
3140 { DDSD_##FLAG, offsetof(DDSURFACEDESC2, FIELD), \
3141 sizeof(((DDSURFACEDESC2 *)(NULL))->FIELD) }
3142
3143 static const struct compare_info compare[] =
3144 {
3145 CMP(ALPHABITDEPTH, dwAlphaBitDepth),
3146 CMP(BACKBUFFERCOUNT, u5.dwBackBufferCount),
3147 CMP(CAPS, ddsCaps),
3148 CMP(CKDESTBLT, ddckCKDestBlt),
3149 CMP(CKDESTOVERLAY, u3 /* ddckCKDestOverlay */),
3150 CMP(CKSRCBLT, ddckCKSrcBlt),
3151 CMP(CKSRCOVERLAY, ddckCKSrcOverlay),
3153 CMP(LINEARSIZE, u1 /* dwLinearSize */),
3154 CMP(LPSURFACE, lpSurface),
3155 CMP(MIPMAPCOUNT, u2 /* dwMipMapCount */),
3156 CMP(PITCH, u1 /* lPitch */),
3157 /* PIXELFORMAT: manual */
3158 CMP(REFRESHRATE, u2 /* dwRefreshRate */),
3159 CMP(TEXTURESTAGE, dwTextureStage),
3160 CMP(WIDTH, dwWidth),
3161 /* ZBUFFERBITDEPTH: "obsolete" */
3162 };
3163
3164#undef CMP
3165
3166 unsigned int i;
3167
3168 if ((requested->dwFlags & provided->dwFlags) != requested->dwFlags)
3169 return FALSE;
3170
3171 for (i=0; i < ARRAY_SIZE(compare); i++)
3172 {
3173 if (requested->dwFlags & compare[i].flag
3174 && memcmp((const char *)provided + compare[i].offset,
3175 (const char *)requested + compare[i].offset,
3176 compare[i].size) != 0)
3177 return FALSE;
3178 }
3179
3180 if (requested->dwFlags & DDSD_PIXELFORMAT)
3181 {
3183 &provided->u4.ddpfPixelFormat))
3184 return FALSE;
3185 }
3186
3187 return TRUE;
3188}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define WIDTH
Definition: d3dtest.c:13
#define HEIGHT
Definition: d3dtest.c:14
static BOOL Main_DirectDraw_DDPIXELFORMAT_Match(const DDPIXELFORMAT *requested, const DDPIXELFORMAT *provided)
Definition: ddraw.c:3085
#define CMP(FLAG, FIELD)
static const WCHAR dwWidth[]
Definition: provider.c:62
static const WCHAR dwHeight[]
Definition: provider.c:63
__kernel_ptrdiff_t ptrdiff_t
Definition: linux.h:247
GLsizeiptr size
Definition: glext.h:5919
GLdouble GLdouble u2
Definition: glext.h:8308
GLdouble u1
Definition: glext.h:8308
GLintptr offset
Definition: glext.h:5920
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean flag
Definition: glfuncs.h:52
#define CAPS
Definition: kerberos.c:274
static BYTE u3[]
Definition: msg.c:580
static BYTE u5[]
Definition: msg.c:590
DWORD dwAlphaBitDepth
Definition: ddraw.h:3
static int compare_info(LCID lcid, DWORD flags, char *buff, const char *cmp, BOOL exact)
Definition: locale.c:122
Definition: bug.cpp:8

Referenced by ddraw7_EnumSurfaces().

◆ ddraw_null_wined3d_object_destroyed()

static void STDMETHODCALLTYPE ddraw_null_wined3d_object_destroyed ( void parent)
static

Definition at line 81 of file ddraw.c.

81{}

◆ ddraw_set_cooperative_level()

static HRESULT ddraw_set_cooperative_level ( struct ddraw ddraw,
HWND  window,
DWORD  cooplevel,
BOOL  restore_mode_on_normal 
)
static

Definition at line 778 of file ddraw.c.

780{
781 struct wined3d_rendertarget_view *rtv = NULL, *dsv = NULL;
782 struct wined3d_stateblock *stateblock;
783 BOOL restore_state = FALSE;
784 HRESULT hr;
785
786 TRACE("ddraw %p, window %p, flags %#x, restore_mode_on_normal %x.\n", ddraw, window, cooplevel,
787 restore_mode_on_normal);
789
791
793 {
794 WARN("Recursive call, returning DD_OK.\n");
795 hr = DD_OK;
796 goto done;
797 }
799
800 /* Tests suggest that we need one of them: */
801 if(!(cooplevel & (DDSCL_SETFOCUSWINDOW |
804 {
805 TRACE("Incorrect cooplevel flags, returning DDERR_INVALIDPARAMS\n");
807 goto done;
808 }
809
810 if ((cooplevel & DDSCL_CREATEDEVICEWINDOW) && !(cooplevel & DDSCL_EXCLUSIVE))
811 {
812 WARN("DDSCL_CREATEDEVICEWINDOW requires DDSCL_EXCLUSIVE.\n");
814 goto done;
815 }
816
817 /* Handle those levels first which set various hwnds */
818 if ((cooplevel & DDSCL_SETFOCUSWINDOW) && !(cooplevel & DDSCL_CREATEDEVICEWINDOW))
819 {
820 /* This isn't compatible with a lot of flags */
821 if (cooplevel & (DDSCL_MULTITHREADED
830 {
831 WARN("Called with incompatible flags, returning DDERR_INVALIDPARAMS.\n");
833 goto done;
834 }
835
837 goto done;
838 }
839
840 if (cooplevel & DDSCL_EXCLUSIVE)
841 {
842 if (!(cooplevel & DDSCL_FULLSCREEN) || !(window || (cooplevel & DDSCL_CREATEDEVICEWINDOW)))
843 {
844 WARN("DDSCL_EXCLUSIVE requires DDSCL_FULLSCREEN and a window.\n");
846 goto done;
847 }
848
849 if (cooplevel & DDSCL_CREATEDEVICEWINDOW)
850 {
851 HWND device_window;
852
853 if (!ddraw->focuswindow && !(cooplevel & DDSCL_SETFOCUSWINDOW))
854 {
855 WARN("No focus window set.\n");
857 goto done;
858 }
859
860 device_window = CreateWindowExA(0, DDRAW_WINDOW_CLASS_NAME, "DirectDrawDeviceWnd",
862 NULL, NULL, NULL, NULL);
863 if (!device_window)
864 {
865 ERR("Failed to create window, last error %#x.\n", GetLastError());
866 hr = E_FAIL;
867 goto done;
868 }
869
870 ShowWindow(device_window, SW_SHOW);
871 TRACE("Created a device window %p.\n", device_window);
872
873 /* Native apparently leaks the created device window if setting the
874 * focus window below fails. */
876 ddraw->devicewindow = device_window;
877
878 if (cooplevel & DDSCL_SETFOCUSWINDOW)
879 {
880 if (!window)
881 {
883 goto done;
884 }
885
887 goto done;
888 }
889
890 window = device_window;
891 }
892 }
893 else
894 {
899 }
900
902 {
905
906 if (cooplevel & DDSCL_FULLSCREEN)
907 {
908 struct wined3d_display_mode display_mode;
909
912 display_mode.width, display_mode.height);
913 }
914 }
915
916 if ((cooplevel & DDSCL_EXCLUSIVE) && exclusive_window != window)
917 {
920 }
921
924
926 {
927 if (!(ddraw->flags & DDRAW_NO3D))
928 {
929 restore_state = TRUE;
930
932 {
933 ERR("Failed to create stateblock, hr %#x.\n", hr);
934 goto done;
935 }
936
937 wined3d_stateblock_capture(stateblock);
939 /* Rendering to ddraw->wined3d_frontbuffer. */
941 rtv = NULL;
942 else if (rtv)
944
947 }
948
950 }
951
953 ERR("Failed to create swapchain, hr %#x.\n", hr);
954
955 if (restore_state)
956 {
957 if (dsv)
958 {
961 }
962
963 if (rtv)
964 {
967 }
968
969 wined3d_stateblock_apply(stateblock);
970 wined3d_stateblock_decref(stateblock);
971 }
972
973 if (!(cooplevel & DDSCL_EXCLUSIVE) && (ddraw->cooperative_level & DDSCL_EXCLUSIVE)
974 && restore_mode_on_normal)
975 {
977 if (FAILED(hr))
978 ERR("RestoreDisplayMode failed\n");
979 }
980
982 && (window != ddraw->dest_window || !(cooplevel & DDSCL_EXCLUSIVE)))
984
985 if ((cooplevel & DDSCL_EXCLUSIVE)
987 {
989 if (FAILED(hr))
990 {
991 ERR("Failed to acquire focus window, hr %#x.\n", hr);
992 goto done;
993 }
994 }
995
996 /* Unhandled flags */
997 if (cooplevel & DDSCL_ALLOWREBOOT)
998 WARN("Unhandled flag DDSCL_ALLOWREBOOT, harmless\n");
999 if (cooplevel & DDSCL_ALLOWMODEX)
1000 WARN("Unhandled flag DDSCL_ALLOWMODEX, harmless\n");
1001 if (cooplevel & DDSCL_FPUSETUP)
1002 WARN("Unhandled flag DDSCL_FPUSETUP, harmless\n");
1003
1004 if (cooplevel & DDSCL_EXCLUSIVE)
1006 else if (exclusive_ddraw == ddraw)
1008
1009 /* Store the cooperative_level */
1010 ddraw->cooperative_level = cooplevel;
1012
1013 TRACE("SetCooperativeLevel returning DD_OK\n");
1014 hr = DD_OK;
1015done:
1016 ddraw->flags &= ~DDRAW_SCL_RECURSIVE;
1018
1019 return hr;
1020}
#define DDRAW_SCL_RECURSIVE
Definition: ddraw_private.h:59
void DDRAW_dump_cooperativelevel(DWORD cooplevel) DECLSPEC_HIDDEN
Definition: utils.c:968
static HRESULT ddraw_create_swapchain(struct ddraw *ddraw, HWND window, BOOL windowed)
Definition: ddraw.c:620
static HWND exclusive_window
Definition: ddraw.c:34
static HRESULT ddraw_set_focus_window(struct ddraw *ddraw, HWND window)
Definition: ddraw.c:551
HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device, unsigned int view_idx, struct wined3d_rendertarget_view *view, BOOL set_viewport)
Definition: device.c:4468
struct wined3d_rendertarget_view *CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device, unsigned int view_idx)
Definition: device.c:4447
void CDECL wined3d_device_setup_fullscreen_window(struct wined3d_device *device, HWND window, UINT w, UINT h)
Definition: device.c:853
HRESULT CDECL wined3d_device_acquire_focus_window(struct wined3d_device *device, HWND window)
Definition: device.c:938
void CDECL wined3d_device_restore_fullscreen_window(struct wined3d_device *device, HWND window, const RECT *window_rect)
Definition: device.c:885
void CDECL wined3d_device_set_multithreaded(struct wined3d_device *device)
Definition: device.c:1290
void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view)
Definition: device.c:4524
void CDECL wined3d_device_release_focus_window(struct wined3d_device *device)
Definition: device.c:954
struct wined3d_rendertarget_view *CDECL wined3d_device_get_depth_stencil_view(const struct wined3d_device *device)
Definition: device.c:4461
ULONG CDECL wined3d_rendertarget_view_incref(struct wined3d_rendertarget_view *view)
Definition: view.c:318
void *CDECL wined3d_rendertarget_view_get_sub_resource_parent(const struct wined3d_rendertarget_view *view)
Definition: view.c:376
ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *view)
Definition: view.c:348
#define WS_POPUP
Definition: pedump.c:616
#define DDSCL_SETDEVICEWINDOW
Definition: ddraw.h:539
#define DDSCL_SETFOCUSWINDOW
Definition: ddraw.h:538
#define DDSCL_FPUPRESERVE
Definition: ddraw.h:543
#define DDSCL_MULTITHREADED
Definition: ddraw.h:541
#define DDERR_NOHWND
Definition: ddraw.h:143
#define DDSCL_ALLOWREBOOT
Definition: ddraw.h:533
#define DDERR_NOFOCUSWINDOW
Definition: ddraw.h:169
#define DDSCL_CREATEDEVICEWINDOW
Definition: ddraw.h:540
#define DDSCL_FPUSETUP
Definition: ddraw.h:542
#define DDSCL_ALLOWMODEX
Definition: ddraw.h:537
#define DDSCL_FULLSCREEN
Definition: ddraw.h:532
HWND devicewindow
HWND focuswindow
ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock)
Definition: stateblock.c:552
void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock)
Definition: stateblock.c:684
HRESULT CDECL wined3d_stateblock_create(struct wined3d_device *device, enum wined3d_stateblock_type type, struct wined3d_stateblock **stateblock)
Definition: stateblock.c:1372
void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
Definition: stateblock.c:965
@ WINED3D_SBT_ALL
Definition: wined3d.h:767
#define SW_SHOW
Definition: winuser.h:778

Referenced by ddraw1_SetCooperativeLevel(), ddraw2_SetCooperativeLevel(), ddraw4_SetCooperativeLevel(), and ddraw7_SetCooperativeLevel().

◆ ddraw_set_focus_window()

static HRESULT ddraw_set_focus_window ( struct ddraw ddraw,
HWND  window 
)
static

Definition at line 551 of file ddraw.c.

552{
553 /* FIXME: This looks wrong, exclusive mode should imply a destination
554 * window. */
556 {
557 TRACE("Setting DDSCL_SETFOCUSWINDOW with an already set window, returning DDERR_HWNDALREADYSET.\n");
559 }
560
562
563 return DD_OK;
564}
#define DDERR_HWNDALREADYSET
Definition: ddraw.h:145

Referenced by ddraw_set_cooperative_level().

◆ ddraw_update_lost_surfaces()

void ddraw_update_lost_surfaces ( struct ddraw ddraw)

Definition at line 4918 of file ddraw.c.

4919{
4920 struct ddraw_surface *surface;
4921
4923 return;
4924
4926 {
4927 surface->is_lost = TRUE;
4928 }
4930}

Referenced by ddraw_surface7_Restore(), and device_parent_surface_created().

◆ device_parent_activate()

static void CDECL device_parent_activate ( struct wined3d_device_parent device_parent,
BOOL  activate 
)
static

Definition at line 4901 of file ddraw.c.

4902{
4904
4905 TRACE("device_parent %p, activate %#x.\n", device_parent, activate);
4906
4907 if (!activate)
4908 {
4911 }
4912 else
4913 {
4915 }
4916}
static struct ddraw * ddraw_from_device_parent(struct wined3d_device_parent *device_parent)
Definition: ddraw.c:4853

◆ device_parent_create_swapchain()

static HRESULT CDECL device_parent_create_swapchain ( struct wined3d_device_parent device_parent,
struct wined3d_swapchain_desc desc,
struct wined3d_swapchain **  swapchain 
)
static

Definition at line 5020 of file ddraw.c.

5022{
5024 HRESULT hr;
5025
5026 TRACE("device_parent %p, desc %p, swapchain %p.\n", device_parent, desc, swapchain);
5027
5029 {
5030 ERR("Swapchain already created.\n");
5031 return E_FAIL;
5032 }
5033
5035 &ddraw_null_wined3d_parent_ops, swapchain)))
5036 WARN("Failed to create swapchain, hr %#x.\n", hr);
5037
5038 return hr;
5039}
HRESULT CDECL wined3d_swapchain_create(struct wined3d_device *device, struct wined3d_swapchain_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_swapchain **swapchain)
Definition: swapchain.c:1023

◆ device_parent_create_swapchain_texture()

static HRESULT CDECL device_parent_create_swapchain_texture ( struct wined3d_device_parent device_parent,
void container_parent,
const struct wined3d_resource_desc desc,
DWORD  texture_flags,
struct wined3d_texture **  texture 
)
static

Definition at line 4992 of file ddraw.c.

4995{
4997 HRESULT hr;
4998
4999 TRACE("device_parent %p, container_parent %p, desc %p, texture flags %#x, texture %p.\n",
5000 device_parent, container_parent, desc, texture_flags, texture);
5001
5003 {
5004 ERR("Frontbuffer already created.\n");
5005 return E_FAIL;
5006 }
5007
5010 {
5011 WARN("Failed to create texture, hr %#x.\n", hr);
5012 return hr;
5013 }
5014
5016
5017 return hr;
5018}
static const struct wined3d_parent_ops ddraw_frontbuffer_parent_ops
Definition: ddraw.c:4987
HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct wined3d_resource_desc *desc, UINT layer_count, UINT level_count, DWORD flags, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture)
Definition: texture.c:3511
GLenum GLuint texture
Definition: glext.h:6295
#define WINED3D_TEXTURE_CREATE_MAPPABLE
Definition: wined3d.h:1558

◆ device_parent_mode_changed()

static void CDECL device_parent_mode_changed ( struct wined3d_device_parent device_parent)
static

Definition at line 4868 of file ddraw.c.

4869{
4871 MONITORINFO monitor_info;
4872 HMONITOR monitor;
4873 RECT *r;
4874
4875 TRACE("device_parent %p.\n", device_parent);
4876
4878 {
4879 TRACE("Nothing to resize.\n");
4880 return;
4881 }
4882
4883 monitor = MonitorFromWindow(ddraw->swapchain_window, MONITOR_DEFAULTTOPRIMARY);
4884 monitor_info.cbSize = sizeof(monitor_info);
4885 if (!GetMonitorInfoW(monitor, &monitor_info))
4886 {
4887 ERR("Failed to get monitor info.\n");
4888 return;
4889 }
4890
4891 r = &monitor_info.rcMonitor;
4892 TRACE("Resizing window %p to %s.\n", ddraw->swapchain_window, wine_dbgstr_rect(r));
4893
4894 if (!SetWindowPos(ddraw->swapchain_window, HWND_TOP, r->left, r->top,
4895 r->right - r->left, r->bottom - r->top, SWP_SHOWWINDOW | SWP_NOACTIVATE))
4896 ERR("Failed to resize window.\n");
4897
4899}
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
HMONITOR WINAPI MonitorFromWindow(HWND, DWORD)
HWND swapchain_window
RECT rcMonitor
Definition: winuser.h:3788
DWORD cbSize
Definition: winuser.h:3787
BOOL WINAPI GetMonitorInfoW(_In_ HMONITOR, _Inout_ LPMONITORINFO)

◆ device_parent_surface_created()

static HRESULT CDECL device_parent_surface_created ( struct wined3d_device_parent device_parent,
struct wined3d_texture wined3d_texture,
unsigned int  sub_resource_idx,
void **  parent,
const struct wined3d_parent_ops **  parent_ops 
)
static

Definition at line 4932 of file ddraw.c.

4935{
4938
4939 TRACE("device_parent %p, wined3d_texture %p, sub_resource_idx %u, parent %p, parent_ops %p.\n",
4940 device_parent, wined3d_texture, sub_resource_idx, parent, parent_ops);
4941
4942 /* We have a swapchain or wined3d internal texture. */
4944 {
4945 *parent = NULL;
4946 *parent_ops = &ddraw_null_wined3d_parent_ops;
4947
4948 return DD_OK;
4949 }
4950
4951 if (!(ddraw_surface = heap_alloc_zero(sizeof(*ddraw_surface))))
4952 {
4953 ERR("Failed to allocate surface memory.\n");
4955 }
4956
4959
4962
4963 TRACE("Created ddraw surface %p.\n", ddraw_surface);
4964
4965 return DD_OK;
4966}
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN
Definition: surface.c:6432
void ddraw_update_lost_surfaces(struct ddraw *ddraw)
Definition: ddraw.c:4918
void *CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture)
Definition: texture.c:1121
#define DDERR_OUTOFVIDEOMEMORY
Definition: ddraw.h:112
unsigned int sub_resource_idx

◆ device_parent_volume_created()

static HRESULT CDECL device_parent_volume_created ( struct wined3d_device_parent device_parent,
struct wined3d_texture wined3d_texture,
unsigned int  sub_resource_idx,
void **  parent,
const struct wined3d_parent_ops **  parent_ops 
)
static

Definition at line 4968 of file ddraw.c.

4971{
4972 TRACE("device_parent %p, texture %p, sub_resource_idx %u, parent %p, parent_ops %p.\n",
4973 device_parent, wined3d_texture, sub_resource_idx, parent, parent_ops);
4974
4975 *parent = NULL;
4976 *parent_ops = &ddraw_null_wined3d_parent_ops;
4977
4978 return DD_OK;
4979}

◆ device_parent_wined3d_device_created()

static void CDECL device_parent_wined3d_device_created ( struct wined3d_device_parent device_parent,
struct wined3d_device device 
)
static

Definition at line 4858 of file ddraw.c.

4860{
4861 TRACE("device_parent %p, device %p.\n", device_parent, device);
4862}

◆ DirectDrawCreateClipper()

HRESULT WINAPI DirectDrawCreateClipper ( DWORD  flags,
IDirectDrawClipper **  clipper,
IUnknown outer_unknown 
)

Definition at line 3414 of file ddraw.c.

3415{
3416 struct ddraw_clipper *object;
3417 HRESULT hr;
3418
3419 TRACE("flags %#x, clipper %p, outer_unknown %p.\n",
3420 flags, clipper, outer_unknown);
3421
3422 if (outer_unknown)
3423 return CLASS_E_NOAGGREGATION;
3424
3426
3427 if (!(object = heap_alloc_zero(sizeof(*object))))
3428 {
3430 return E_OUTOFMEMORY;
3431 }
3432
3433 hr = ddraw_clipper_init(object);
3434 if (FAILED(hr))
3435 {
3436 WARN("Failed to initialize clipper, hr %#x.\n", hr);
3437 heap_free(object);
3439 return hr;
3440 }
3441
3442 TRACE("Created clipper %p.\n", object);
3443 *clipper = &object->IDirectDrawClipper_iface;
3445
3446 return DD_OK;
3447}
HRESULT ddraw_clipper_init(struct ddraw_clipper *clipper)
Definition: clipper.c:321

Referenced by ddraw7_CreateClipper().

◆ enum_zbuffer()

HRESULT CALLBACK enum_zbuffer ( DDPIXELFORMAT format,
void ctx 
)

Definition at line 1446 of file ddraw.c.

1447{
1448 DDCAPS *caps = ctx;
1449
1450 switch (format->u1.dwZBufferBitDepth)
1451 {
1452 case 8:
1453 caps->dwZBufferBitDepths |= DDBD_8;
1454 break;
1455 case 16:
1456 caps->dwZBufferBitDepths |= DDBD_16;
1457 break;
1458 case 24:
1459 caps->dwZBufferBitDepths |= DDBD_24;
1460 break;
1461 case 32:
1462 caps->dwZBufferBitDepths |= DDBD_32;
1463 break;
1464 }
1465 return D3DENUMRET_OK;
1466}
#define DDBD_8
Definition: ddraw.h:470

Referenced by ddraw7_GetCaps().

◆ EnumDisplayModesCallbackThunk()

static HRESULT CALLBACK EnumDisplayModesCallbackThunk ( DDSURFACEDESC2 surface_desc,
void context 
)
static

Definition at line 2398 of file ddraw.c.

2399{
2400 struct displaymodescallback_context *cbcontext = context;
2402
2403 DDSD2_to_DDSD(surface_desc, &desc);
2404 return cbcontext->func(&desc, cbcontext->context);
2405}
void DDSD2_to_DDSD(const DDSURFACEDESC2 *in, DDSURFACEDESC *out) DECLSPEC_HIDDEN
Definition: utils.c:1262
LPDDENUMMODESCALLBACK func
Definition: ddraw.c:2394

Referenced by ddraw1_EnumDisplayModes(), and ddraw2_EnumDisplayModes().

◆ EnumSurfacesCallback2Thunk()

static HRESULT CALLBACK EnumSurfacesCallback2Thunk ( IDirectDrawSurface7 surface,
DDSURFACEDESC2 surface_desc,
void context 
)
static

Definition at line 3202 of file ddraw.c.

3204{
3205 struct ddraw_surface *surface_impl = impl_from_IDirectDrawSurface7(surface);
3206 struct surfacescallback2_context *cbcontext = context;
3207
3208 IDirectDrawSurface4_AddRef(&surface_impl->IDirectDrawSurface4_iface);
3209 IDirectDrawSurface7_Release(surface);
3210
3211 return cbcontext->func(&surface_impl->IDirectDrawSurface4_iface,
3212 surface_desc, cbcontext->context);
3213}
LPDDENUMSURFACESCALLBACK2 func
Definition: ddraw.c:3192

Referenced by ddraw4_EnumSurfaces().

◆ EnumSurfacesCallbackThunk()

static HRESULT CALLBACK EnumSurfacesCallbackThunk ( IDirectDrawSurface7 surface,
DDSURFACEDESC2 surface_desc,
void context 
)
static

Definition at line 3215 of file ddraw.c.

3217{
3218 struct ddraw_surface *surface_impl = impl_from_IDirectDrawSurface7(surface);
3219 struct surfacescallback_context *cbcontext = context;
3220
3221 IDirectDrawSurface_AddRef(&surface_impl->IDirectDrawSurface_iface);
3222 IDirectDrawSurface7_Release(surface);
3223
3224 return cbcontext->func(&surface_impl->IDirectDrawSurface_iface,
3225 (DDSURFACEDESC *)surface_desc, cbcontext->context);
3226}
LPDDENUMSURFACESCALLBACK func
Definition: ddraw.c:3198

Referenced by ddraw1_EnumSurfaces(), and ddraw2_EnumSurfaces().

◆ impl_from_IDirect3D()

static struct ddraw * impl_from_IDirect3D ( IDirect3D *  iface)
inlinestatic

Definition at line 108 of file ddraw.c.

109{
110 return CONTAINING_RECORD(iface, struct ddraw, IDirect3D_iface);
111}

Referenced by d3d1_AddRef(), d3d1_CreateLight(), d3d1_CreateMaterial(), d3d1_CreateViewport(), d3d1_EnumDevices(), d3d1_FindDevice(), d3d1_QueryInterface(), and d3d1_Release().

◆ impl_from_IDirect3D2()

static struct ddraw * impl_from_IDirect3D2 ( IDirect3D2 *  iface)
inlinestatic

◆ impl_from_IDirect3D3()

static struct ddraw * impl_from_IDirect3D3 ( IDirect3D3 *  iface)
inlinestatic

◆ impl_from_IDirect3D7()

static struct ddraw * impl_from_IDirect3D7 ( IDirect3D7 *  iface)
inlinestatic

◆ impl_from_IDirectDraw()

◆ impl_from_IDirectDraw2()

◆ impl_from_IDirectDraw4()

◆ impl_from_IDirectDraw7()

◆ Main_DirectDraw_DDPIXELFORMAT_Match()

static BOOL Main_DirectDraw_DDPIXELFORMAT_Match ( const DDPIXELFORMAT requested,
const DDPIXELFORMAT provided 
)
static

Definition at line 3085 of file ddraw.c.

3087{
3088 /* Some flags must be present in both or neither for a match. */
3089 static const DWORD must_match = DDPF_PALETTEINDEXED1 | DDPF_PALETTEINDEXED2
3092
3093 if ((requested->dwFlags & provided->dwFlags) != requested->dwFlags)
3094 return FALSE;
3095
3096 if ((requested->dwFlags & must_match) != (provided->dwFlags & must_match))
3097 return FALSE;
3098
3099 if (requested->dwFlags & DDPF_FOURCC)
3100 if (requested->dwFourCC != provided->dwFourCC)
3101 return FALSE;
3102
3105 if (requested->u1.dwRGBBitCount != provided->u1.dwRGBBitCount)
3106 return FALSE;
3107
3110 if (requested->u2.dwRBitMask != provided->u2.dwRBitMask)
3111 return FALSE;
3112
3114 if (requested->u3.dwGBitMask != provided->u3.dwGBitMask)
3115 return FALSE;
3116
3117 /* I could be wrong about the bumpmapping. MSDN docs are vague. */
3119 |DDPF_BUMPDUDV))
3120 if (requested->u4.dwBBitMask != provided->u4.dwBBitMask)
3121 return FALSE;
3122
3123 if (requested->dwFlags & (DDPF_ALPHAPIXELS|DDPF_ZPIXELS))
3124 if (requested->u5.dwRGBAlphaBitMask != provided->u5.dwRGBAlphaBitMask)
3125 return FALSE;
3126
3127 return TRUE;
3128}
#define DDPF_PALETTEINDEXED4
Definition: ddraw.h:504
#define DDPF_PALETTEINDEXED2
Definition: ddraw.h:513
#define DDPF_LUMINANCE
Definition: ddraw.h:517
#define DDPF_STENCILBUFFER
Definition: ddraw.h:515
#define DDPF_ALPHA
Definition: ddraw.h:502
#define DDPF_YUV
Definition: ddraw.h:510
#define DDPF_FOURCC
Definition: ddraw.h:503
#define DDPF_RGB
Definition: ddraw.h:507
#define DDPF_ZPIXELS
Definition: ddraw.h:514
#define DDPF_PALETTEINDEXED1
Definition: ddraw.h:512
#define DDPF_PALETTEINDEXED8
Definition: ddraw.h:506
#define DDPF_ALPHAPIXELS
Definition: ddraw.h:501
#define DDPF_BUMPDUDV
Definition: ddraw.h:519
DWORD dwBBitMask
Definition: ddraw.h:1106
DWORD dwFourCC
Definition: ddraw.h:1072
DWORD dwRBitMask
Definition: ddraw.h:1085
DWORD dwGBitMask
Definition: ddraw.h:1094
DWORD dwFlags
Definition: ddraw.h:1071
DWORD dwRGBAlphaBitMask
Definition: ddraw.h:1113

Referenced by ddraw_match_surface_desc().

◆ restore_callback()

static HRESULT CALLBACK restore_callback ( IDirectDrawSurface7 surface,
DDSURFACEDESC2 desc,
void context 
)
static

Definition at line 2767 of file ddraw.c.

2768{
2769 IDirectDrawSurface_Restore(surface);
2770 IDirectDrawSurface_Release(surface);
2771
2772 return DDENUMRET_OK;
2773}

Referenced by ddraw7_RestoreAllSurfaces().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ddraw  )

Variable Documentation

◆ d3d1_vtbl

const struct IDirect3DVtbl d3d1_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI d3d1_CreateViewport(IDirect3D *iface, IDirect3DViewport **viewport, IUnknown *outer_unknown)
Definition: ddraw.c:4123
static ULONG WINAPI d3d1_Release(IDirect3D *iface)
Definition: ddraw.c:538
static HRESULT WINAPI d3d1_CreateLight(IDirect3D *iface, IDirect3DLight **light, IUnknown *outer_unknown)
Definition: ddraw.c:3975
static HRESULT WINAPI d3d1_QueryInterface(IDirect3D *iface, REFIID riid, void **object)
Definition: ddraw.c:257
static HRESULT WINAPI d3d1_CreateMaterial(IDirect3D *iface, IDirect3DMaterial **material, IUnknown *outer_unknown)
Definition: ddraw.c:4048
static HRESULT WINAPI d3d1_Initialize(IDirect3D *iface, REFIID riid)
Definition: ddraw.c:2077
static HRESULT WINAPI d3d1_EnumDevices(IDirect3D *iface, LPD3DENUMDEVICESCALLBACK callback, void *context)
Definition: ddraw.c:3911
static HRESULT WINAPI d3d1_FindDevice(IDirect3D *iface, D3DFINDDEVICESEARCH *fds, D3DFINDDEVICERESULT *fdr)
Definition: ddraw.c:4223
static ULONG WINAPI d3d1_AddRef(IDirect3D *iface)
Definition: ddraw.c:359

Definition at line 4767 of file ddraw.c.

Referenced by ddraw_init().

◆ d3d2_vtbl

const struct IDirect3D2Vtbl d3d2_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI d3d2_EnumDevices(IDirect3D2 *iface, LPD3DENUMDEVICESCALLBACK callback, void *context)
Definition: ddraw.c:3902
static ULONG WINAPI d3d2_AddRef(IDirect3D2 *iface)
Definition: ddraw.c:350
static HRESULT WINAPI d3d2_CreateDevice(IDirect3D2 *iface, REFCLSID riid, IDirectDrawSurface *surface, IDirect3DDevice2 **device)
Definition: ddraw.c:4307
static HRESULT WINAPI d3d2_FindDevice(IDirect3D2 *iface, D3DFINDDEVICESEARCH *fds, D3DFINDDEVICERESULT *fdr)
Definition: ddraw.c:4214
static HRESULT WINAPI d3d2_CreateViewport(IDirect3D2 *iface, IDirect3DViewport2 **viewport, IUnknown *outer_unknown)
Definition: ddraw.c:4113
static HRESULT WINAPI d3d2_CreateLight(IDirect3D2 *iface, IDirect3DLight **light, IUnknown *outer_unknown)
Definition: ddraw.c:3966
static ULONG WINAPI d3d2_Release(IDirect3D2 *iface)
Definition: ddraw.c:529
static HRESULT WINAPI d3d2_CreateMaterial(IDirect3D2 *iface, IDirect3DMaterial2 **material, IUnknown *outer_unknown)
Definition: ddraw.c:4027
static HRESULT WINAPI d3d2_QueryInterface(IDirect3D2 *iface, REFIID riid, void **object)
Definition: ddraw.c:248

Definition at line 4752 of file ddraw.c.

Referenced by ddraw_init().

◆ d3d3_vtbl

const struct IDirect3D3Vtbl d3d3_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI d3d3_CreateMaterial(IDirect3D3 *iface, IDirect3DMaterial3 **material, IUnknown *outer_unknown)
Definition: ddraw.c:4004
static HRESULT WINAPI d3d3_EvictManagedTextures(IDirect3D3 *iface)
Definition: ddraw.c:4571
static ULONG WINAPI d3d3_AddRef(IDirect3D3 *iface)
Definition: ddraw.c:341
static HRESULT WINAPI d3d3_EnumZBufferFormats(IDirect3D3 *iface, REFCLSID device_iid, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
Definition: ddraw.c:4534
static HRESULT WINAPI d3d3_CreateDevice(IDirect3D3 *iface, REFCLSID riid, IDirectDrawSurface4 *surface, IDirect3DDevice3 **device, IUnknown *outer_unknown)
Definition: ddraw.c:4278
static HRESULT WINAPI d3d3_QueryInterface(IDirect3D3 *iface, REFIID riid, void **object)
Definition: ddraw.c:239
static HRESULT WINAPI d3d3_CreateVertexBuffer(IDirect3D3 *iface, D3DVERTEXBUFFERDESC *desc, IDirect3DVertexBuffer **vertex_buffer, DWORD flags, IUnknown *outer_unknown)
Definition: ddraw.c:4376
static ULONG WINAPI d3d3_Release(IDirect3D3 *iface)
Definition: ddraw.c:520

Definition at line 4734 of file ddraw.c.

Referenced by ddraw_init().

◆ d3d7_vtbl

const struct IDirect3D7Vtbl d3d7_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBACK7 callback, void *context)
Definition: ddraw.c:3734
static ULONG WINAPI d3d7_Release(IDirect3D7 *iface)
Definition: ddraw.c:511
static HRESULT WINAPI d3d7_CreateVertexBuffer(IDirect3D7 *iface, D3DVERTEXBUFFERDESC *desc, IDirect3DVertexBuffer7 **vertex_buffer, DWORD flags)
Definition: ddraw.c:4352
static HRESULT WINAPI d3d7_QueryInterface(IDirect3D7 *iface, REFIID riid, void **object)
Definition: ddraw.c:230
static ULONG WINAPI d3d7_AddRef(IDirect3D7 *iface)
Definition: ddraw.c:332
static HRESULT WINAPI d3d7_CreateDevice(IDirect3D7 *iface, REFCLSID riid, IDirectDrawSurface7 *surface, IDirect3DDevice7 **device)
Definition: ddraw.c:4253

Definition at line 4720 of file ddraw.c.

Referenced by ddraw_init().

◆ ddraw1_vtbl

struct IDirectDrawVtbl ddraw1_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI ddraw1_DuplicateSurface(IDirectDraw *iface, IDirectDrawSurface *src, IDirectDrawSurface **dst)
Definition: ddraw.c:3697
static HRESULT WINAPI ddraw1_RestoreDisplayMode(IDirectDraw *iface)
Definition: ddraw.c:727
static HRESULT WINAPI ddraw1_WaitForVerticalBlank(IDirectDraw *iface, DWORD flags, HANDLE event)
Definition: ddraw.c:2209
static HRESULT WINAPI ddraw1_GetScanLine(IDirectDraw *iface, DWORD *line)
Definition: ddraw.c:2261
static HRESULT WINAPI ddraw1_GetDisplayMode(IDirectDraw *iface, DDSURFACEDESC *surface_desc)
Definition: ddraw.c:1723
static HRESULT WINAPI ddraw1_EnumSurfaces(IDirectDraw *iface, DWORD flags, DDSURFACEDESC *surface_desc, void *context, LPDDENUMSURFACESCALLBACK callback)
Definition: ddraw.c:3381
static HRESULT WINAPI ddraw1_GetMonitorFrequency(IDirectDraw *iface, DWORD *frequency)
Definition: ddraw.c:1860
static HRESULT WINAPI ddraw1_GetFourCCCodes(IDirectDraw *iface, DWORD *codes_count, DWORD *codes)
Definition: ddraw.c:1811
static HRESULT WINAPI ddraw1_CreateClipper(IDirectDraw *iface, DWORD flags, IDirectDrawClipper **clipper, IUnknown *outer_unknown)
Definition: ddraw.c:3486
static HRESULT WINAPI ddraw1_GetVerticalBlankStatus(IDirectDraw *iface, BOOL *status)
Definition: ddraw.c:1912
static HRESULT WINAPI ddraw1_CreateSurface(IDirectDraw *iface, DDSURFACEDESC *surface_desc, IDirectDrawSurface **surface, IUnknown *outer_unknown)
Definition: ddraw.c:3023
static HRESULT WINAPI ddraw1_FlipToGDISurface(IDirectDraw *iface)
Definition: ddraw.c:2145
static HRESULT WINAPI ddraw1_SetCooperativeLevel(IDirectDraw *iface, HWND window, DWORD flags)
Definition: ddraw.c:1049
static HRESULT WINAPI ddraw1_Compact(IDirectDraw *iface)
Definition: ddraw.c:1636
static HRESULT WINAPI ddraw1_CreatePalette(IDirectDraw *iface, DWORD flags, PALETTEENTRY *entries, IDirectDrawPalette **palette, IUnknown *outer_unknown)
Definition: ddraw.c:3600
static HRESULT WINAPI ddraw1_Initialize(IDirectDraw *iface, GUID *guid)
Definition: ddraw.c:2068
static HRESULT WINAPI ddraw1_GetGDISurface(IDirectDraw *iface, IDirectDrawSurface **surface)
Definition: ddraw.c:2369
static HRESULT WINAPI ddraw1_GetCaps(IDirectDraw *iface, DDCAPS *driver_caps, DDCAPS *hel_caps)
Definition: ddraw.c:1593
static HRESULT WINAPI ddraw1_QueryInterface(IDirectDraw *iface, REFIID riid, void **object)
Definition: ddraw.c:221
static HRESULT WINAPI ddraw1_EnumDisplayModes(IDirectDraw *iface, DWORD flags, DDSURFACEDESC *surface_desc, void *context, LPDDENUMMODESCALLBACK callback)
Definition: ddraw.c:2573
static HRESULT WINAPI ddraw1_SetDisplayMode(IDirectDraw *iface, DWORD width, DWORD height, DWORD bpp)
Definition: ddraw.c:1187

Definition at line 4691 of file ddraw.c.

Referenced by ddraw_init().

◆ ddraw2_vtbl

const struct IDirectDraw2Vtbl ddraw2_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI ddraw2_GetScanLine(IDirectDraw2 *iface, DWORD *line)
Definition: ddraw.c:2252
static HRESULT WINAPI ddraw2_DuplicateSurface(IDirectDraw2 *iface, IDirectDrawSurface *src, IDirectDrawSurface **dst)
Definition: ddraw.c:3674
static HRESULT WINAPI ddraw2_EnumDisplayModes(IDirectDraw2 *iface, DWORD flags, DDSURFACEDESC *surface_desc, void *context, LPDDENUMMODESCALLBACK callback)
Definition: ddraw.c:2555
static HRESULT WINAPI ddraw2_GetFourCCCodes(IDirectDraw2 *iface, DWORD *codes_count, DWORD *codes)
Definition: ddraw.c:1802
static ULONG WINAPI ddraw2_Release(IDirectDraw2 *iface)
Definition: ddraw.c:485
static HRESULT WINAPI ddraw2_SetCooperativeLevel(IDirectDraw2 *iface, HWND window, DWORD flags)
Definition: ddraw.c:1040
static ULONG WINAPI ddraw2_AddRef(IDirectDraw2 *iface)
Definition: ddraw.c:308
static HRESULT WINAPI ddraw2_Initialize(IDirectDraw2 *iface, GUID *guid)
Definition: ddraw.c:2059
static HRESULT WINAPI ddraw2_EnumSurfaces(IDirectDraw2 *iface, DWORD flags, DDSURFACEDESC *surface_desc, void *context, LPDDENUMSURFACESCALLBACK callback)
Definition: ddraw.c:3363
static HRESULT WINAPI ddraw2_QueryInterface(IDirectDraw2 *iface, REFIID riid, void **object)
Definition: ddraw.c:212
static HRESULT WINAPI ddraw2_GetDisplayMode(IDirectDraw2 *iface, DDSURFACEDESC *surface_desc)
Definition: ddraw.c:1711
static HRESULT WINAPI ddraw2_CreatePalette(IDirectDraw2 *iface, DWORD flags, PALETTEENTRY *entries, IDirectDrawPalette **palette, IUnknown *outer_unknown)
Definition: ddraw.c:3580
static HRESULT WINAPI ddraw2_GetGDISurface(IDirectDraw2 *iface, IDirectDrawSurface **surface)
Definition: ddraw.c:2346
static HRESULT WINAPI ddraw2_FlipToGDISurface(IDirectDraw2 *iface)
Definition: ddraw.c:2136
static HRESULT WINAPI ddraw2_SetDisplayMode(IDirectDraw2 *iface, DWORD width, DWORD height, DWORD bpp, DWORD refresh_rate, DWORD flags)
Definition: ddraw.c:1176
static HRESULT WINAPI ddraw2_GetVerticalBlankStatus(IDirectDraw2 *iface, BOOL *status)
Definition: ddraw.c:1903
static HRESULT WINAPI ddraw2_GetAvailableVidMem(IDirectDraw2 *iface, DDSCAPS *caps, DWORD *total, DWORD *free)
Definition: ddraw.c:2006
static HRESULT WINAPI ddraw2_GetCaps(IDirectDraw2 *iface, DDCAPS *driver_caps, DDCAPS *hel_caps)
Definition: ddraw.c:1584
static HRESULT WINAPI ddraw2_RestoreDisplayMode(IDirectDraw2 *iface)
Definition: ddraw.c:718
static HRESULT WINAPI ddraw2_GetMonitorFrequency(IDirectDraw2 *iface, DWORD *frequency)
Definition: ddraw.c:1851
static HRESULT WINAPI ddraw2_CreateClipper(IDirectDraw2 *iface, DWORD flags, IDirectDrawClipper **clipper, IUnknown *outer_unknown)
Definition: ddraw.c:3475
static HRESULT WINAPI ddraw2_WaitForVerticalBlank(IDirectDraw2 *iface, DWORD flags, HANDLE event)
Definition: ddraw.c:2200
static HRESULT WINAPI ddraw2_Compact(IDirectDraw2 *iface)
Definition: ddraw.c:1627
static HRESULT WINAPI ddraw2_CreateSurface(IDirectDraw2 *iface, DDSURFACEDESC *surface_desc, IDirectDrawSurface **surface, IUnknown *outer_unknown)
Definition: ddraw.c:2959

Definition at line 4660 of file ddraw.c.

Referenced by ddraw_init().

◆ ddraw4_vtbl

const struct IDirectDraw4Vtbl ddraw4_vtbl
static

Definition at line 4623 of file ddraw.c.

Referenced by ddraw_init().

◆ ddraw7_vtbl

const struct IDirectDraw7Vtbl ddraw7_vtbl
static

Definition at line 4583 of file ddraw.c.

Referenced by ddraw_init().

◆ ddraw_frontbuffer_parent_ops

const struct wined3d_parent_ops ddraw_frontbuffer_parent_ops
static
Initial value:
=
{
}
static void STDMETHODCALLTYPE ddraw_frontbuffer_destroyed(void *parent)
Definition: ddraw.c:4981

Definition at line 4987 of file ddraw.c.

Referenced by device_parent_create_swapchain_texture().

◆ ddraw_null_wined3d_parent_ops

◆ ddraw_wined3d_device_parent_ops

const struct wined3d_device_parent_ops ddraw_wined3d_device_parent_ops
static
Initial value:
=
{
}
static void CDECL device_parent_mode_changed(struct wined3d_device_parent *device_parent)
Definition: ddraw.c:4868
static void CDECL device_parent_activate(struct wined3d_device_parent *device_parent, BOOL activate)
Definition: ddraw.c:4901
static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent *device_parent, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, void **parent, const struct wined3d_parent_ops **parent_ops)
Definition: ddraw.c:4932
static HRESULT CDECL device_parent_volume_created(struct wined3d_device_parent *device_parent, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, void **parent, const struct wined3d_parent_ops **parent_ops)
Definition: ddraw.c:4968
static HRESULT CDECL device_parent_create_swapchain(struct wined3d_device_parent *device_parent, struct wined3d_swapchain_desc *desc, struct wined3d_swapchain **swapchain)
Definition: ddraw.c:5020
static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_device_parent *device_parent, void *container_parent, const struct wined3d_resource_desc *desc, DWORD texture_flags, struct wined3d_texture **texture)
Definition: ddraw.c:4992
static void CDECL device_parent_wined3d_device_created(struct wined3d_device_parent *device_parent, struct wined3d_device *device)
Definition: ddraw.c:4858

Definition at line 5041 of file ddraw.c.

Referenced by ddraw_init().

◆ device_list7

struct enum_device_entry device_list7[]
static
Initial value:
=
{
{
"WINE Direct3D7 Hardware Transform and Lighting acceleration using WineD3D",
"Wine D3D7 T&L HAL",
&IID_IDirect3DTnLHalDevice,
0,
},
{
"WINE Direct3D7 Hardware acceleration using WineD3D",
"Direct3D HAL",
&IID_IDirect3DHALDevice,
0,
},
{
"WINE Direct3D7 RGB Software Emulation using WineD3D",
"Wine D3D7 RGB",
&IID_IDirect3DRGBDevice,
},
}

Referenced by d3d7_EnumDevices().

◆ deviceidentifier

const DDDEVICEIDENTIFIER2 deviceidentifier
static
Initial value:
=
{
"vga.dll",
"DirectDraw HAL",
{ { 0x00010001, 0x00010001 } },
0, 0, 0, 0,
{0xa8373c10,0x7ac4,0x4deb, {0x84,0x9a,0x00,0x98,0x44,0xd0,0x8b,0x2d}},
0
}

Definition at line 37 of file ddraw.c.

Referenced by ddraw7_GetDeviceIdentifier().

◆ exclusive_ddraw

const struct ddraw* exclusive_ddraw
static

◆ exclusive_window

HWND exclusive_window
static

Definition at line 34 of file ddraw.c.

Referenced by ddraw_set_cooperative_level(), and device_parent_activate().