1921e9a5ffb515d7f6b9bc1a8d87622940893aaf
[reactos.git] / reactos / dll / directx / wine / dxgi / dxgi_private.h
1 /*
2 * Copyright 2008 Henri Verbeet for CodeWeavers
3 *
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.
8 *
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.
13 *
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
17 */
18
19 #ifndef __WINE_DXGI_PRIVATE_H
20 #define __WINE_DXGI_PRIVATE_H
21
22 #include <wine/config.h>
23 #include <wine/port.h>
24
25 #include <stdarg.h>
26
27 #define WIN32_NO_STATUS
28 #define _INC_WINDOWS
29 #define COM_NO_WINDOWS_H
30
31 #define COBJMACROS
32
33 #include <windef.h>
34 #include <winbase.h>
35 #include <wingdi.h>
36 #include <winuser.h>
37 #include <objbase.h>
38 #include <winnls.h>
39
40 #include <wine/debug.h>
41 #include <wine/wined3d.h>
42 #include <wine/winedxgi.h>
43
44 WINE_DEFAULT_DEBUG_CHANNEL(dxgi);
45
46 extern CRITICAL_SECTION dxgi_cs DECLSPEC_HIDDEN;
47
48 /* Layered device */
49 enum dxgi_device_layer_id
50 {
51 DXGI_DEVICE_LAYER_DEBUG1 = 0x8,
52 DXGI_DEVICE_LAYER_THREAD_SAFE = 0x10,
53 DXGI_DEVICE_LAYER_DEBUG2 = 0x20,
54 DXGI_DEVICE_LAYER_SWITCH_TO_REF = 0x30,
55 DXGI_DEVICE_LAYER_D3D10_DEVICE = 0xffffffff,
56 };
57
58 struct layer_get_size_args
59 {
60 DWORD unknown0;
61 DWORD unknown1;
62 DWORD *unknown2;
63 DWORD *unknown3;
64 IDXGIAdapter *adapter;
65 WORD interface_major;
66 WORD interface_minor;
67 WORD version_build;
68 WORD version_revision;
69 };
70
71 struct dxgi_device_layer
72 {
73 enum dxgi_device_layer_id id;
74 HRESULT (WINAPI *init)(enum dxgi_device_layer_id id, DWORD *count, DWORD *values);
75 UINT (WINAPI *get_size)(enum dxgi_device_layer_id id, struct layer_get_size_args *args, DWORD unknown0);
76 HRESULT (WINAPI *create)(enum dxgi_device_layer_id id, void **layer_base, DWORD unknown0,
77 void *device_object, REFIID riid, void **device_layer);
78 };
79
80 /* TRACE helper functions */
81 const char *debug_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN;
82
83 DXGI_FORMAT dxgi_format_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN;
84 enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN;
85
86 /* IDXGIFactory */
87 struct dxgi_factory
88 {
89 IWineDXGIFactory IWineDXGIFactory_iface;
90 LONG refcount;
91 struct wined3d *wined3d;
92 UINT adapter_count;
93 IDXGIAdapter **adapters;
94 };
95
96 HRESULT dxgi_factory_init(struct dxgi_factory *factory) DECLSPEC_HIDDEN;
97
98 /* IDXGIDevice */
99 struct dxgi_device
100 {
101 IWineDXGIDevice IWineDXGIDevice_iface;
102 IUnknown *child_layer;
103 LONG refcount;
104 struct wined3d_device *wined3d_device;
105 IWineDXGIFactory *factory;
106 };
107
108 HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *layer,
109 IDXGIFactory *factory, IDXGIAdapter *adapter) DECLSPEC_HIDDEN;
110
111 /* IDXGIOutput */
112 struct dxgi_output
113 {
114 IDXGIOutput IDXGIOutput_iface;
115 LONG refcount;
116 struct dxgi_adapter *adapter;
117 };
118
119 void dxgi_output_init(struct dxgi_output *output, struct dxgi_adapter *adapter) DECLSPEC_HIDDEN;
120
121 /* IDXGIAdapter */
122 struct dxgi_adapter
123 {
124 IWineDXGIAdapter IWineDXGIAdapter_iface;
125 IWineDXGIFactory *parent;
126 LONG refcount;
127 UINT ordinal;
128 IDXGIOutput *output;
129 };
130
131 HRESULT dxgi_adapter_init(struct dxgi_adapter *adapter, IWineDXGIFactory *parent, UINT ordinal) DECLSPEC_HIDDEN;
132
133 /* IDXGISwapChain */
134 struct dxgi_swapchain
135 {
136 IDXGISwapChain IDXGISwapChain_iface;
137 LONG refcount;
138 struct wined3d_swapchain *wined3d_swapchain;
139 };
140
141 HRESULT dxgi_swapchain_init(struct dxgi_swapchain *swapchain, struct dxgi_device *device,
142 struct wined3d_swapchain_desc *desc) DECLSPEC_HIDDEN;
143
144 /* IDXGISurface */
145 struct dxgi_surface
146 {
147 IDXGISurface IDXGISurface_iface;
148 IUnknown IUnknown_iface;
149 IUnknown *outer_unknown;
150 LONG refcount;
151 IDXGIDevice *device;
152 };
153
154 HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device, IUnknown *outer) DECLSPEC_HIDDEN;
155
156 #endif /* __WINE_DXGI_PRIVATE_H */