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