dxgi: Replace dxgi_cs with wined3d_mutex.
[wine/multimedia.git] / dlls / dxgi / dxgi_private.h
blob035af743f1fba4d46c53c020ffb0f6ce09df5e97
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 "dxgi.h"
34 #ifdef DXGI_INIT_GUID
35 #include "initguid.h"
36 #endif
37 #include "wine/wined3d.h"
38 #include "wine/winedxgi.h"
40 /* Layered device */
41 enum dxgi_device_layer_id
43 DXGI_DEVICE_LAYER_DEBUG1 = 0x8,
44 DXGI_DEVICE_LAYER_THREAD_SAFE = 0x10,
45 DXGI_DEVICE_LAYER_DEBUG2 = 0x20,
46 DXGI_DEVICE_LAYER_SWITCH_TO_REF = 0x30,
47 DXGI_DEVICE_LAYER_D3D10_DEVICE = 0xffffffff,
50 struct layer_get_size_args
52 DWORD unknown0;
53 DWORD unknown1;
54 DWORD *unknown2;
55 DWORD *unknown3;
56 IDXGIAdapter *adapter;
57 WORD interface_major;
58 WORD interface_minor;
59 WORD version_build;
60 WORD version_revision;
63 struct dxgi_device_layer
65 enum dxgi_device_layer_id id;
66 HRESULT (WINAPI *init)(enum dxgi_device_layer_id id, DWORD *count, DWORD *values);
67 UINT (WINAPI *get_size)(enum dxgi_device_layer_id id, struct layer_get_size_args *args, DWORD unknown0);
68 HRESULT (WINAPI *create)(enum dxgi_device_layer_id id, void **layer_base, DWORD unknown0,
69 void *device_object, REFIID riid, void **device_layer);
72 /* TRACE helper functions */
73 const char *debug_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN;
75 DXGI_FORMAT dxgi_format_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN;
76 enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN;
77 void dxgi_sample_desc_from_wined3d(DXGI_SAMPLE_DESC *desc,
78 enum wined3d_multisample_type wined3d_type, unsigned int wined3d_quality) DECLSPEC_HIDDEN;
79 void wined3d_sample_desc_from_dxgi(enum wined3d_multisample_type *wined3d_type,
80 unsigned int *wined3d_quality, const DXGI_SAMPLE_DESC *dxgi_desc) DECLSPEC_HIDDEN;
81 HRESULT dxgi_get_private_data(struct wined3d_private_store *store,
82 REFGUID guid, UINT *data_size, void *data) DECLSPEC_HIDDEN;
83 HRESULT dxgi_set_private_data(struct wined3d_private_store *store,
84 REFGUID guid, UINT data_size, const void *data) DECLSPEC_HIDDEN;
85 HRESULT dxgi_set_private_data_interface(struct wined3d_private_store *store,
86 REFGUID guid, const IUnknown *object) DECLSPEC_HIDDEN;
88 /* IDXGIFactory */
89 struct dxgi_factory
91 IDXGIFactory1 IDXGIFactory1_iface;
92 LONG refcount;
93 struct wined3d_private_store private_store;
94 struct wined3d *wined3d;
95 UINT adapter_count;
96 IDXGIAdapter1 **adapters;
97 BOOL extended;
98 HWND device_window;
101 HRESULT dxgi_factory_create(REFIID riid, void **factory, BOOL extended) DECLSPEC_HIDDEN;
102 HWND dxgi_factory_get_device_window(struct dxgi_factory *factory) DECLSPEC_HIDDEN;
103 struct dxgi_factory *unsafe_impl_from_IDXGIFactory1(IDXGIFactory1 *iface) DECLSPEC_HIDDEN;
105 /* IDXGIDevice */
106 struct dxgi_device
108 IWineDXGIDevice IWineDXGIDevice_iface;
109 IUnknown *child_layer;
110 LONG refcount;
111 struct wined3d_private_store private_store;
112 struct wined3d_device *wined3d_device;
113 IDXGIFactory1 *factory;
116 HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *layer,
117 IDXGIFactory *factory, IDXGIAdapter *adapter) DECLSPEC_HIDDEN;
119 /* IDXGIOutput */
120 struct dxgi_output
122 IDXGIOutput IDXGIOutput_iface;
123 LONG refcount;
124 struct wined3d_private_store private_store;
125 struct dxgi_adapter *adapter;
128 void dxgi_output_init(struct dxgi_output *output, struct dxgi_adapter *adapter) DECLSPEC_HIDDEN;
130 /* IDXGIAdapter */
131 struct dxgi_adapter
133 IDXGIAdapter1 IDXGIAdapter1_iface;
134 struct dxgi_factory *parent;
135 LONG refcount;
136 struct wined3d_private_store private_store;
137 UINT ordinal;
138 IDXGIOutput *output;
141 HRESULT dxgi_adapter_init(struct dxgi_adapter *adapter, struct dxgi_factory *parent, UINT ordinal) DECLSPEC_HIDDEN;
142 struct dxgi_adapter *unsafe_impl_from_IDXGIAdapter1(IDXGIAdapter1 *iface) DECLSPEC_HIDDEN;
144 /* IDXGISwapChain */
145 struct dxgi_swapchain
147 IDXGISwapChain IDXGISwapChain_iface;
148 LONG refcount;
149 struct wined3d_private_store private_store;
150 struct wined3d_swapchain *wined3d_swapchain;
153 HRESULT dxgi_swapchain_init(struct dxgi_swapchain *swapchain, struct dxgi_device *device,
154 struct wined3d_swapchain_desc *desc) DECLSPEC_HIDDEN;
156 /* IDXGISurface */
157 struct dxgi_surface
159 IDXGISurface IDXGISurface_iface;
160 IUnknown IUnknown_iface;
161 IUnknown *outer_unknown;
162 LONG refcount;
163 struct wined3d_private_store private_store;
164 IDXGIDevice *device;
165 struct wined3d_resource *wined3d_resource;
168 HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device,
169 IUnknown *outer, struct wined3d_resource *wined3d_resource) DECLSPEC_HIDDEN;
171 #endif /* __WINE_DXGI_PRIVATE_H */