// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
namespace SharpDX.Direct3D9
{
public partial struct PresentParameters
{
///
/// Initializes a new instance of the struct.
///
/// Width of the back buffer.
/// Height of the back buffer.
public PresentParameters(int backBufferWidth, int backBufferHeight) : this(backBufferWidth, backBufferHeight, Format.X8R8G8B8, 1, MultisampleType.None, 0, Direct3D9.SwapEffect.Discard, IntPtr.Zero, true, true, Format.D24X8, Direct3D9.PresentFlags.None, 0, PresentInterval.Default|PresentInterval.Immediate)
{
}
///
/// Initializes a new instance of the struct.
///
/// Width of the back buffer.
/// Height of the back buffer.
/// The back buffer format.
/// The back buffer count.
/// Type of the multi sample.
/// The multi sample quality.
/// The swap effect.
/// The device window handle.
/// if set to true [windowed].
/// if set to true [enable auto depth stencil].
/// The auto depth stencil format.
/// The present flags.
/// The full screen refresh rate in Hz.
/// The presentation interval.
public PresentParameters(int backBufferWidth, int backBufferHeight, Format backBufferFormat, int backBufferCount, MultisampleType multiSampleType, int multiSampleQuality, SwapEffect swapEffect, IntPtr deviceWindowHandle, bool windowed, bool enableAutoDepthStencil, Format autoDepthStencilFormat, PresentFlags presentFlags, int fullScreenRefreshRateInHz, PresentInterval presentationInterval)
{
BackBufferWidth = backBufferWidth;
BackBufferHeight = backBufferHeight;
BackBufferFormat = backBufferFormat;
BackBufferCount = backBufferCount;
MultiSampleType = multiSampleType;
MultiSampleQuality = multiSampleQuality;
SwapEffect = swapEffect;
DeviceWindowHandle = deviceWindowHandle;
Windowed = windowed;
EnableAutoDepthStencil = enableAutoDepthStencil;
AutoDepthStencilFormat = autoDepthStencilFormat;
PresentFlags = presentFlags;
FullScreenRefreshRateInHz = fullScreenRefreshRateInHz;
PresentationInterval = presentationInterval;
}
///
/// Init this structure to defaults
///
public void InitDefaults()
{
this.BackBufferWidth = 800;
this.BackBufferHeight = 600;
this.BackBufferFormat = Format.X8R8G8B8;
this.BackBufferCount = 1;
this.MultiSampleType = MultisampleType.None;
this.SwapEffect = SwapEffect.Discard;
this.DeviceWindowHandle = IntPtr.Zero;
this.Windowed = true;
this.EnableAutoDepthStencil = true;
this.AutoDepthStencilFormat = Format.D24X8;
this.PresentFlags = PresentFlags.None;
this.PresentationInterval = PresentInterval.Default | PresentInterval.Immediate;
}
}
}