dbghelp: Use CONTAINING_RECORD instead of reimplementing it.
[wine.git] / dlls / dxgi / dxgi_private.h
blob59b436bd85e0c900844d1785c69a9f11c0bea4cd
1 /*
2 * Copyright 2008 Henri Verbeet for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __WINE_DXGI_PRIVATE_H
20 #define __WINE_DXGI_PRIVATE_H
22 #include "wine/debug.h"
24 #include <assert.h>
26 #define COBJMACROS
27 #include "winbase.h"
28 #include "wingdi.h"
29 #include "winuser.h"
30 #include "objbase.h"
31 #include "winnls.h"
33 #include "d3d10_1.h"
34 #ifdef DXGI_INIT_GUID
35 #include "initguid.h"
36 #endif
37 #include "wine/wined3d.h"
38 #include "wine/winedxgi.h"
40 enum dxgi_frame_latency
42 DXGI_FRAME_LATENCY_DEFAULT = 3,
43 DXGI_FRAME_LATENCY_MAX = 16,
46 /* Layered device */
47 enum dxgi_device_layer_id
49 DXGI_DEVICE_LAYER_DEBUG1 = 0x8,
50 DXGI_DEVICE_LAYER_THREAD_SAFE = 0x10,
51 DXGI_DEVICE_LAYER_DEBUG2 = 0x20,
52 DXGI_DEVICE_LAYER_SWITCH_TO_REF = 0x30,
53 DXGI_DEVICE_LAYER_D3D10_DEVICE = 0xffffffff,
56 struct layer_get_size_args
58 DWORD unknown0;
59 DWORD unknown1;
60 DWORD *unknown2;
61 DWORD *unknown3;
62 IDXGIAdapter *adapter;
63 WORD interface_major;
64 WORD interface_minor;
65 WORD version_build;
66 WORD version_revision;
69 struct dxgi_device_layer
71 enum dxgi_device_layer_id id;
72 HRESULT (WINAPI *init)(enum dxgi_device_layer_id id, DWORD *count, DWORD *values);
73 UINT (WINAPI *get_size)(enum dxgi_device_layer_id id, struct layer_get_size_args *args, DWORD unknown0);
74 HRESULT (WINAPI *create)(enum dxgi_device_layer_id id, void **layer_base, DWORD unknown0,
75 void *device_object, REFIID riid, void **device_layer);
78 /* TRACE helper functions */
79 const char *debug_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN;
81 DXGI_FORMAT dxgi_format_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN;
82 enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN;
83 void dxgi_sample_desc_from_wined3d(DXGI_SAMPLE_DESC *desc,
84 enum wined3d_multisample_type wined3d_type, unsigned int wined3d_quality) DECLSPEC_HIDDEN;
85 void wined3d_sample_desc_from_dxgi(enum wined3d_multisample_type *wined3d_type,
86 unsigned int *wined3d_quality, const DXGI_SAMPLE_DESC *dxgi_desc) DECLSPEC_HIDDEN;
87 HRESULT dxgi_get_private_data(struct wined3d_private_store *store,
88 REFGUID guid, UINT *data_size, void *data) DECLSPEC_HIDDEN;
89 HRESULT dxgi_set_private_data(struct wined3d_private_store *store,
90 REFGUID guid, UINT data_size, const void *data) DECLSPEC_HIDDEN;
91 HRESULT dxgi_set_private_data_interface(struct wined3d_private_store *store,
92 REFGUID guid, const IUnknown *object) DECLSPEC_HIDDEN;
94 /* IDXGIFactory */
95 struct dxgi_factory
97 IDXGIFactory1 IDXGIFactory1_iface;
98 LONG refcount;
99 struct wined3d_private_store private_store;
100 struct wined3d *wined3d;
101 UINT adapter_count;
102 IDXGIAdapter1 **adapters;
103 BOOL extended;
104 HWND device_window;
107 HRESULT dxgi_factory_create(REFIID riid, void **factory, BOOL extended) DECLSPEC_HIDDEN;
108 HWND dxgi_factory_get_device_window(struct dxgi_factory *factory) DECLSPEC_HIDDEN;
109 struct dxgi_factory *unsafe_impl_from_IDXGIFactory1(IDXGIFactory1 *iface) DECLSPEC_HIDDEN;
111 /* IDXGIDevice */
112 struct dxgi_device
114 IWineDXGIDevice IWineDXGIDevice_iface;
115 IUnknown *child_layer;
116 LONG refcount;
117 struct wined3d_private_store private_store;
118 struct wined3d_device *wined3d_device;
119 IDXGIFactory1 *factory;
122 HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *layer,
123 IDXGIFactory *factory, IDXGIAdapter *adapter) DECLSPEC_HIDDEN;
125 /* IDXGIOutput */
126 struct dxgi_output
128 IDXGIOutput IDXGIOutput_iface;
129 LONG refcount;
130 struct wined3d_private_store private_store;
131 struct dxgi_adapter *adapter;
134 void dxgi_output_init(struct dxgi_output *output, struct dxgi_adapter *adapter) DECLSPEC_HIDDEN;
136 /* IDXGIAdapter */
137 struct dxgi_adapter
139 IDXGIAdapter1 IDXGIAdapter1_iface;
140 struct dxgi_factory *parent;
141 LONG refcount;
142 struct wined3d_private_store private_store;
143 UINT ordinal;
144 IDXGIOutput *output;
147 HRESULT dxgi_adapter_init(struct dxgi_adapter *adapter, struct dxgi_factory *parent, UINT ordinal) DECLSPEC_HIDDEN;
148 struct dxgi_adapter *unsafe_impl_from_IDXGIAdapter1(IDXGIAdapter1 *iface) DECLSPEC_HIDDEN;
150 /* IDXGISwapChain */
151 struct dxgi_swapchain
153 IDXGISwapChain IDXGISwapChain_iface;
154 LONG refcount;
155 struct wined3d_private_store private_store;
156 struct wined3d_swapchain *wined3d_swapchain;
159 HRESULT dxgi_swapchain_init(struct dxgi_swapchain *swapchain, struct dxgi_device *device,
160 struct wined3d_swapchain_desc *desc) DECLSPEC_HIDDEN;
162 /* IDXGISurface */
163 struct dxgi_surface
165 IDXGISurface IDXGISurface_iface;
166 IUnknown IUnknown_iface;
167 IUnknown *outer_unknown;
168 LONG refcount;
169 struct wined3d_private_store private_store;
170 IDXGIDevice *device;
171 struct wined3d_resource *wined3d_resource;
174 HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device,
175 IUnknown *outer, struct wined3d_resource *wined3d_resource) DECLSPEC_HIDDEN;
177 HRESULT dxgi_check_d3d10_support(struct dxgi_factory *factory, struct dxgi_adapter *adapter) DECLSPEC_HIDDEN;
179 #endif /* __WINE_DXGI_PRIVATE_H */