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
25 #include "DeviceChildDxgi.h"
\r
33 value class FrameStatistics;
\r
34 value class ModeDescription;
\r
35 value class SwapChainDescription;
\r
38 /// Holds one or more surfaces that store rendered data prior to presenting
\r
39 /// that data to an output.
\r
41 /// <unmanaged>IDXGISwapChain</unmanaged>
\r
42 public ref class SwapChain : DeviceChild
\r
44 COMOBJECT(IDXGISwapChain, SwapChain);
\r
48 /// Gets the swap chain's description.
\r
50 property SwapChainDescription Description
\r
52 SwapChainDescription get();
\r
56 /// Get performance statistics about the last render frame.
\r
58 property DXGI::FrameStatistics FrameStatistics
\r
60 DXGI::FrameStatistics get();
\r
64 /// Gets the number of times this swap chain's Present method has been called.
\r
66 property int PresentCount
\r
72 /// Gets the output (the display monitor) that contains the majority of the client area of the target window.
\r
74 property Output^ ContainingOutput
\r
80 /// Gets or sets a value indicating whether the swap chain is rendering in full screen mode.
\r
82 property bool IsFullScreen
\r
85 void set(bool value);
\r
89 /// Initializes a new instance of the <see cref="SwapChain"/> class.
\r
91 /// <param name="factory">The factory used to create the swap chain.</param>
\r
92 /// <param name="device">The device used to present images to the swap chain.</param>
\r
93 /// <param name="description">Swap chain properties.</param>
\r
94 SwapChain( Factory^ factory, ComObject^ device, SwapChainDescription description );
\r
97 /// Releases all resources used by the <see cref="SwapChain"/>.
\r
99 virtual ~SwapChain();
\r
102 /// Gets the full screen state.
\r
104 /// <param name="isFullScreen">Receives a value indicating if the swap chain is running in full screen mode.</param>
\r
105 /// <param name="target">Receives the full screen output if the swap chain is in full screen mode. Otherwise ignored.</param>
\r
106 /// <returns>A <see cref="SlimDX::Result"/> object describing the result of the operation.</returns>
\r
107 Result GetFullScreenState( [Out] bool% isFullScreen, [Out] Output^% target );
\r
110 /// Sets the full screen state.
\r
112 /// <param name="isFullScreen">Set to true for full screen mode, false for windowed mode.</param>
\r
113 /// <param name="target">If the current display mode is full screen, this parameter must be the
\r
114 /// output containing the swap chain; otherwise, this parameter is ignored. If you set this parameter
\r
115 /// to null, DXGI will choose the output based on the swap-chain's device and the output window's placement.</param>
\r
116 /// <returns>A <see cref="SlimDX::Result"/> object describing the result of the operation.</returns>
\r
117 Result SetFullScreenState( bool isFullScreen, Output^ target );
\r
120 /// Changes the swap chain's back buffer size, format, and count.
\r
122 /// <param name="count">The new back buffer count.</param>
\r
123 /// <param name="width">The new back buffer width.</param>
\r
124 /// <param name="height">The new back buffer height.</param>
\r
125 /// <param name="format">The new back buffer format.</param>
\r
126 /// <param name="flags">Flags controlling swap chain functionality.</param>
\r
127 /// <returns>A <see cref="SlimDX::Result"/> object describing the result of the operation.</returns>
\r
128 Result ResizeBuffers( int count, int width, int height, Format format, SwapChainFlags flags );
\r
131 /// Changes the output target's size.
\r
133 /// <param name="description">Properties of the new output display mode.</param>
\r
134 /// <returns>A <see cref="SlimDX::Result"/> object describing the result of the operation.</returns>
\r
135 Result ResizeTarget( ModeDescription description );
\r
138 /// Presents a rendered image to the attached output.
\r
140 /// <param name="syncInterval">Specified how to synchronize the presentation with the vertical blank interrupt. 0
\r
141 /// indicates that presentation should occur immediately, without synchronization. Any other value indicates that
\r
142 /// presentation should be synchonized with the specified next vertical blank.</param>
\r
143 /// <param name="flags">Flags controlling presentation behavior.</param>
\r
144 /// <returns>A <see cref="SlimDX::Result"/> object describing the result of the operation.</returns>
\r
145 Result Present( int syncInterval, PresentFlags flags );
\r