[CLIPBRD]: Comment out the #pragma once in the precompiled header, because it makes...
[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 HRESULT dxgi_get_private_data(struct wined3d_private_store *store,
86 REFGUID guid, UINT *data_size, void *data) DECLSPEC_HIDDEN;
87 HRESULT dxgi_set_private_data(struct wined3d_private_store *store,
88 REFGUID guid, UINT data_size, const void *data) DECLSPEC_HIDDEN;
89 HRESULT dxgi_set_private_data_interface(struct wined3d_private_store *store,
90 REFGUID guid, const IUnknown *object) DECLSPEC_HIDDEN;
91
92 /* IDXGIFactory */
93 struct dxgi_factory
94 {
95 IDXGIFactory1 IDXGIFactory1_iface;
96 LONG refcount;
97 struct wined3d_private_store private_store;
98 struct wined3d *wined3d;
99 UINT adapter_count;
100 IDXGIAdapter1 **adapters;
101 BOOL extended;
102 HWND device_window;
103 };
104
105 HRESULT dxgi_factory_create(REFIID riid, void **factory, BOOL extended) DECLSPEC_HIDDEN;
106 HWND dxgi_factory_get_device_window(struct dxgi_factory *factory) DECLSPEC_HIDDEN;
107 struct dxgi_factory *unsafe_impl_from_IDXGIFactory1(IDXGIFactory1 *iface) DECLSPEC_HIDDEN;
108
109 /* IDXGIDevice */
110 struct dxgi_device
111 {
112 IWineDXGIDevice IWineDXGIDevice_iface;
113 IUnknown *child_layer;
114 LONG refcount;
115 struct wined3d_private_store private_store;
116 struct wined3d_device *wined3d_device;
117 IDXGIFactory1 *factory;
118 };
119
120 HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *layer,
121 IDXGIFactory *factory, IDXGIAdapter *adapter) DECLSPEC_HIDDEN;
122
123 /* IDXGIOutput */
124 struct dxgi_output
125 {
126 IDXGIOutput IDXGIOutput_iface;
127 LONG refcount;
128 struct wined3d_private_store private_store;
129 struct dxgi_adapter *adapter;
130 };
131
132 void dxgi_output_init(struct dxgi_output *output, struct dxgi_adapter *adapter) DECLSPEC_HIDDEN;
133
134 /* IDXGIAdapter */
135 struct dxgi_adapter
136 {
137 IDXGIAdapter1 IDXGIAdapter1_iface;
138 struct dxgi_factory *parent;
139 LONG refcount;
140 struct wined3d_private_store private_store;
141 UINT ordinal;
142 IDXGIOutput *output;
143 };
144
145 HRESULT dxgi_adapter_init(struct dxgi_adapter *adapter, struct dxgi_factory *parent, UINT ordinal) DECLSPEC_HIDDEN;
146 struct dxgi_adapter *unsafe_impl_from_IDXGIAdapter1(IDXGIAdapter1 *iface) DECLSPEC_HIDDEN;
147
148 /* IDXGISwapChain */
149 struct dxgi_swapchain
150 {
151 IDXGISwapChain IDXGISwapChain_iface;
152 LONG refcount;
153 struct wined3d_private_store private_store;
154 struct wined3d_swapchain *wined3d_swapchain;
155 };
156
157 HRESULT dxgi_swapchain_init(struct dxgi_swapchain *swapchain, struct dxgi_device *device,
158 struct wined3d_swapchain_desc *desc) DECLSPEC_HIDDEN;
159
160 /* IDXGISurface */
161 struct dxgi_surface
162 {
163 IDXGISurface IDXGISurface_iface;
164 IUnknown IUnknown_iface;
165 IUnknown *outer_unknown;
166 LONG refcount;
167 struct wined3d_private_store private_store;
168 IDXGIDevice *device;
169
170 DXGI_SURFACE_DESC desc;
171 };
172
173 HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device,
174 IUnknown *outer, const DXGI_SURFACE_DESC *desc) DECLSPEC_HIDDEN;
175
176 #endif /* __WINE_DXGI_PRIVATE_H */