2 * Copyright (c) 2007-2010 SlimDX Group
\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
11 * The above copyright notice and this permission notice shall be included in
\r
12 * all copies or substantial portions of the Software.
\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
26 #include "Direct3DEx.h"
\r
27 #include "DisplayModeEx.h"
\r
29 using System::Runtime::InteropServices::OutAttribute;
\r
36 ref class ResultCode;
\r
39 public enum class DeviceState : System::Int32
\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
50 public enum class ResourceResidency : System::Int32
\r
53 ResidentInSharedMemory = S_RESIDENT_IN_SHARED_MEMORY,
\r
54 NotResident = S_NOT_RESIDENT
\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
63 /// <unmanaged>IDirect3DDevice9Ex</unmanaged>
\r
64 public ref class DeviceEx : Device
\r
66 COMOBJECT(IDirect3DDevice9Ex, DeviceEx);
\r
69 void Internal_Constructor( Direct3DEx^ direct3D, int adapter, DeviceType deviceType, System::IntPtr controlHandle,
\r
70 CreateFlags createFlags, D3DDISPLAYMODEEX* fullscreenDisplayMode, ... array<PresentParameters^>^ presentParameters );
\r
74 /// Initializes a new instance of the <see cref="SlimDX::Direct3D9::DeviceEx"/> class.
\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
86 /// Initializes a new instance of the <see cref="SlimDX::Direct3D9::DeviceEx"/> class.
\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
99 /// Initializes a new instance of the <see cref="SlimDX::Direct3D9::DeviceEx"/> class.
\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
111 /// Initializes a new instance of the <see cref="SlimDX::Direct3D9::DeviceEx"/> class.
\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
123 property int GpuThreadPriority
\r
126 void set( int priority );
\r
129 property int MaximumFrameLatency
\r
132 void set( int maxLatency );
\r
136 /// Reports the current cooperative-level status of the Direct3D device for a windowed or full-screen application.
\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
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
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
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
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
166 /// Retrieves the display mode's spatial resolution, color resolution, and refresh frequency.
\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
174 /// Retrieves the display mode's spatial resolution, color resolution, refresh frequency, and rotation settings.
\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
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
188 /// Resets the device.
\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
196 /// Resets the device.
\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
205 /// Suspend execution of the calling thread until the next vertical blank signal.
\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
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
214 literal int ConvolutionMaxWidth = D3DCONVOLUTIONMONO_MAXWIDTH;
\r
215 literal int ConvolutionMaxHeight = D3DCONVOLUTIONMONO_MAXHEIGHT;
\r