OSDN Git Service

9567c5a178bcde47a7fd96fee47c2437149c7e47
[dtxmania/dtxmania.git] / SlimDXc_Jun2010(VC++2008) / source / direct3d9 / DeviceEx.h
1 /*\r
2 * Copyright (c) 2007-2010 SlimDX Group\r
3\r
4 * Permission is hereby granted, free of charge, to any person obtaining a copy\r
5 * of this software and associated documentation files (the "Software"), to deal\r
6 * in the Software without restriction, including without limitation the rights\r
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
8 * copies of the Software, and to permit persons to whom the Software is\r
9 * furnished to do so, subject to the following conditions:\r
10\r
11 * The above copyright notice and this permission notice shall be included in\r
12 * all copies or substantial portions of the Software.\r
13\r
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
20 * THE SOFTWARE.\r
21 */\r
22 #pragma once\r
23 \r
24 #include "Device.h"\r
25 \r
26 #include "Direct3DEx.h"\r
27 #include "DisplayModeEx.h"\r
28 \r
29 using System::Runtime::InteropServices::OutAttribute;\r
30 \r
31 namespace SlimDX\r
32 {\r
33         namespace Direct3D9\r
34         {\r
35 #ifdef XMLDOCS\r
36                 ref class ResultCode;\r
37 #endif\r
38 \r
39                 public enum class DeviceState : System::Int32\r
40                 {\r
41                         Ok = D3D_OK,\r
42                         DeviceLost = D3DERR_DEVICELOST,\r
43                         DeviceHung = D3DERR_DEVICEHUNG,\r
44                         DeviceRemoved = D3DERR_DEVICEREMOVED,\r
45                         OutOfVideoMemory = D3DERR_OUTOFVIDEOMEMORY,\r
46                         PresentModeChanged = S_PRESENT_MODE_CHANGED,\r
47                         PresentOccluded = S_PRESENT_OCCLUDED\r
48                 };\r
49 \r
50                 public enum class ResourceResidency : System::Int32\r
51                 {\r
52                         Resident = S_OK,\r
53                         ResidentInSharedMemory = S_RESIDENT_IN_SHARED_MEMORY,\r
54                         NotResident = S_NOT_RESIDENT\r
55                 };\r
56 \r
57                 ref class Resource;\r
58 \r
59                 /// <summary>\r
60                 /// Applications use the methods of DeviceEx to render primitives, create resources, work with\r
61                 /// system-level variables, adjust gamma ramp levels, work with palettes, and create shaders.\r
62                 /// </summary>\r
63                 /// <unmanaged>IDirect3DDevice9Ex</unmanaged>\r
64                 public ref class DeviceEx : Device\r
65                 {\r
66                         COMOBJECT(IDirect3DDevice9Ex, DeviceEx);\r
67 \r
68                 private:\r
69                         void Internal_Constructor( Direct3DEx^ direct3D, int adapter, DeviceType deviceType, System::IntPtr controlHandle,\r
70                                 CreateFlags createFlags, D3DDISPLAYMODEEX* fullscreenDisplayMode, ... array<PresentParameters^>^ presentParameters );\r
71 \r
72                 public:\r
73                         /// <summary>\r
74                         /// Initializes a new instance of the <see cref="SlimDX::Direct3D9::DeviceEx"/> class.\r
75                         /// </summary>\r
76                         /// <param name="direct3D">The Direct3DEx instance to create the device from.</param>\r
77                         /// <param name="adapter">Ordinal number that denotes the display adapter.</param>\r
78                         /// <param name="deviceType">Denotes the desired device type. If the desired device type is not available, device creation will fail.</param>\r
79                         /// <param name="controlHandle">Specifies the target window for Direct3D rendering.</param>\r
80                         /// <param name="createFlags">Combination of one or more options that control device creation.</param>\r
81                         /// <param name="presentParameters">Describes the presentation parameters for the device being created.</param>\r
82                         DeviceEx( Direct3DEx^ direct3D, int adapter, DeviceType deviceType, System::IntPtr controlHandle,\r
83                                 CreateFlags createFlags, PresentParameters^ presentParameters );\r
84 \r
85                         /// <summary>\r
86                         /// Initializes a new instance of the <see cref="SlimDX::Direct3D9::DeviceEx"/> class.\r
87                         /// </summary>\r
88                         /// <param name="direct3D">The Direct3D instance to create the device from.</param>\r
89                         /// <param name="adapter">Ordinal number that denotes the display adapter.</param>\r
90                         /// <param name="deviceType">Denotes the desired device type. If the desired device type is not available, device creation will fail.</param>\r
91                         /// <param name="controlHandle">Specifies the target window for Direct3D rendering.</param>\r
92                         /// <param name="createFlags">Combination of one or more options that control device creation.</param>\r
93                         /// <param name="presentParameters">Describes the presentation parameters for the device being created.</param>\r
94                         /// <param name="fullScreenDisplayMode">The display mode for when the device is set to fullscreen.</param>\r
95                         DeviceEx( Direct3DEx^ direct3D, int adapter, DeviceType deviceType, System::IntPtr controlHandle,\r
96                                 CreateFlags createFlags, PresentParameters^ presentParameters, DisplayModeEx fullScreenDisplayMode );\r
97 \r
98                         /// <summary>\r
99                         /// Initializes a new instance of the <see cref="SlimDX::Direct3D9::DeviceEx"/> class.\r
100                         /// </summary>\r
101                         /// <param name="direct3D">The Direct3DEx instance to create the device from.</param>\r
102                         /// <param name="adapter">Ordinal number that denotes the display adapter.</param>\r
103                         /// <param name="deviceType">Denotes the desired device type. If the desired device type is not available, device creation will fail.</param>\r
104                         /// <param name="controlHandle">Specifies the target window for Direct3D rendering.</param>\r
105                         /// <param name="createFlags">Combination of one or more options that control device creation.</param>\r
106                         /// <param name="presentParameters">Describes the presentation parameters for the device being created.</param>\r
107                         DeviceEx( Direct3DEx^ direct3D, int adapter, DeviceType deviceType, System::IntPtr controlHandle,\r
108                                 CreateFlags createFlags, array<PresentParameters^>^ presentParameters );\r
109 \r
110                         /// <summary>\r
111                         /// Initializes a new instance of the <see cref="SlimDX::Direct3D9::DeviceEx"/> class.\r
112                         /// </summary>\r
113                         /// <param name="direct3D">The Direct3D instance to create the device from.</param>\r
114                         /// <param name="adapter">Ordinal number that denotes the display adapter.</param>\r
115                         /// <param name="deviceType">Denotes the desired device type. If the desired device type is not available, device creation will fail.</param>\r
116                         /// <param name="controlHandle">Specifies the target window for Direct3D rendering.</param>\r
117                         /// <param name="createFlags">Combination of one or more options that control device creation.</param>\r
118                         /// <param name="presentParameters">Describes the presentation parameters for the device being created.</param>\r
119                         /// <param name="fullScreenDisplayMode">The display mode for when the device is set to fullscreen.</param>\r
120                         DeviceEx( Direct3DEx^ direct3D, int adapter, DeviceType deviceType, System::IntPtr controlHandle,\r
121                                 CreateFlags createFlags, array<PresentParameters^>^ presentParameters, array<DisplayModeEx>^ fullScreenDisplayMode );\r
122 \r
123                         property int GpuThreadPriority\r
124                         {\r
125                                 int get();\r
126                                 void set( int priority );\r
127                         };\r
128 \r
129                         property int MaximumFrameLatency\r
130                         {\r
131                                 int get();\r
132                                 void set( int maxLatency );\r
133                         };\r
134 \r
135                         /// <summary>\r
136                         /// Reports the current cooperative-level status of the Direct3D device for a windowed or full-screen application.\r
137                         /// </summary>\r
138                         /// <param name="windowHandle">The destination window handle to check for occlusion. This parameter may be IntPtr.Zero</param>\r
139                         /// <returns>The current status of this device.</returns>\r
140                         /// <remarks>This method replaces the <see cref="SlimDX::Direct3D9::Device" />.TestCooperativeLevel function,\r
141                         /// which always returns <see cref="SlimDX::Direct3D9::ResultCode" />.Success in Direct3D 9Ex applications.</remarks>\r
142                         /// <unmanaged>IDirect3DDevice9Ex::CheckDeviceState</unmanaged>\r
143                         DeviceState CheckDeviceState( System::IntPtr windowHandle );\r
144 \r
145                         /// <summary>\r
146                         /// Checks a resource to determine if it is likely that it will cause a large stall at\r
147                         /// Draw time because the system must make the resource GPU-accessible.\r
148                         /// </summary>\r
149                         /// <param name="resource">An resource to check the residency status of.</param>\r
150                         /// <returns>See the DirectX documentation.</returns>\r
151                         /// <remarks>See the DirectX documentation.</remarks>\r
152                         /// <unmanaged>IDirect3DDevice9Ex::CheckResourceResidency</unmanaged>\r
153                         ResourceResidency CheckResourceResidency( Resource^ resource );\r
154 \r
155                         /// <summary>\r
156                         /// Checks an array of resources to determine if it is likely that they will cause a large stall at\r
157                         /// Draw time because the system must make the resources GPU-accessible.\r
158                         /// </summary>\r
159                         /// <param name="resources">An array of resources to check the residency status of.</param>\r
160                         /// <returns>See the DirectX documentation.</returns>\r
161                         /// <remarks>See the DirectX documentation.</remarks>\r
162                         /// <unmanaged>IDirect3DDevice9Ex::CheckResourceResidency</unmanaged>\r
163                         ResourceResidency CheckResourceResidency( array<Resource^>^ resources );\r
164 \r
165                         /// <summary>\r
166                         /// Retrieves the display mode's spatial resolution, color resolution, and refresh frequency.\r
167                         /// </summary>\r
168                         /// <param name="swapChain">The swap chain to retrieve display mode data about.</param>\r
169                         /// <returns>Extended display mode information about the adapter.</returns>\r
170                         /// <unmanaged>IDirect3DDevice9Ex::GetDisplayModeEx</unmanaged>\r
171                         DisplayModeEx GetDisplayModeEx( int swapChain );\r
172 \r
173                         /// <summary>\r
174                         /// Retrieves the display mode's spatial resolution, color resolution, refresh frequency, and rotation settings.\r
175                         /// </summary>\r
176                         /// <param name="swapChain">The swap chain to retrieve display mode data about.</param>\r
177                         /// <param name="rotation">Receives the rotation setting of the adapter.</param>\r
178                         /// <returns>Extended display mode information about the adapter.</returns>\r
179                         /// <unmanaged>IDirect3DDevice9Ex::GetDisplayModeEx</unmanaged>\r
180                         DisplayModeEx GetDisplayModeEx( int swapChain, [Out] DisplayRotation% rotation );\r
181 \r
182                         Result PresentEx( SlimDX::Direct3D9::Present flags );\r
183                         Result PresentEx( SlimDX::Direct3D9::Present flags, System::Drawing::Rectangle sourceRectangle, System::Drawing::Rectangle destinationRectangle );\r
184                         Result PresentEx( SlimDX::Direct3D9::Present flags, System::Drawing::Rectangle sourceRectangle, System::Drawing::Rectangle destinationRectangle, System::IntPtr windowOverride );\r
185                         Result PresentEx( SlimDX::Direct3D9::Present flags, System::Drawing::Rectangle sourceRectangle, System::Drawing::Rectangle destinationRectangle, System::IntPtr windowOverride, System::Drawing::Region^ region );\r
186 \r
187                         /// <summary>\r
188                         /// Resets the device.\r
189                         /// </summary>\r
190                         /// <param name="presentParameters">A set of new presentation parameters to apply to the device.</param>\r
191                         /// <returns>A <see cref="SlimDX::Result"/>Object describing the result of the operation.</returns>\r
192                         /// <unmanaged>IDirect3DDevice9Ex::ResetEx</unmanaged>\r
193                         Result ResetEx( PresentParameters^ presentParameters );\r
194 \r
195                         /// <summary>\r
196                         /// Resets the device.\r
197                         /// </summary>\r
198                         /// <param name="presentParameters">A set of new presentation parameters to apply to the device.</param>\r
199                         /// <param name="fullScreenDisplayMode">The properties of the desired display mode, when running fullscreen.</param>\r
200                         /// <returns>A <see cref="SlimDX::Result"/>Object describing the result of the operation.</returns>\r
201                         /// <unmanaged>IDirect3DDevice9Ex::ResetEx</unmanaged>\r
202                         Result ResetEx( PresentParameters^ presentParameters, DisplayModeEx fullScreenDisplayMode );\r
203 \r
204                         /// <summary>\r
205                         /// Suspend execution of the calling thread until the next vertical blank signal.\r
206                         /// </summary>\r
207                         /// <param name="swapChain">Zero based swap chain index to specify the target chain on a multihead card.</param>\r
208                         /// <unmanaged>IDirect3DDevice9Ex::WaitForVBlank</unmanaged>\r
209                         void WaitForVBlank( int swapChain );\r
210 \r
211                         Result SetConvolutionMonoKernel(int width, int height, array<float>^ rowWeights, array<float>^ columnWeights);\r
212                         Result ComposeRects(Surface^ source, Surface^ destination, int rectangleCount, VertexBuffer^ sourceRectangleDescriptors, VertexBuffer^ destinationRectangleDescriptors, ComposeRectOperation operation, int xOffset, int yOffset);\r
213 \r
214                         literal int ConvolutionMaxWidth = D3DCONVOLUTIONMONO_MAXWIDTH;\r
215                         literal int ConvolutionMaxHeight = D3DCONVOLUTIONMONO_MAXHEIGHT;\r
216                 };\r
217         }\r
218 }