public SwapChainDescription CreateSwapChain(int PBufferCount, Usage PUsage, IntPtr PFormHandle, bool PIsWindowed, int PModeDescriptionWidth, int PModeDescriptionHeight, Rational PModeDescriptionRefreshRate, Format PModeDescriptionFormat, int PSampleDescriptionCount, int PSampleDescriptionQuality, SwapChainFlags PSwapChainFlags, SwapEffect PSwapEffect) { this._BufferCount = PBufferCount; this._Usage = PUsage; this._FormHandle = PFormHandle; this._IsWindowed = PIsWindowed; this._ModeDescriptionWidth = PModeDescriptionWidth; this._ModeDescriptionHeight = PModeDescriptionHeight; this._ModeDescriptionRefreshRate = PModeDescriptionRefreshRate; this._ModeDescriptionFormat = PModeDescriptionFormat; this._SampleDescriptionCount = PSampleDescriptionCount; this._SampleDescriptionQuality = PSampleDescriptionQuality; this._SwapChainFlags = PSwapChainFlags; this._SwapEffect = PSwapEffect; _SampleDescription = new SampleDescription(_SampleDescriptionCount, _SampleDescriptionQuality); _ModeDescription = new ModeDescription(_ModeDescriptionWidth, _ModeDescriptionHeight, _ModeDescriptionRefreshRate, _ModeDescriptionFormat); _SwapChainDesc = new SwapChainDescription() { BufferCount = _BufferCount, Usage = _Usage, OutputHandle = _FormHandle, IsWindowed = _IsWindowed, ModeDescription = _ModeDescription, SampleDescription = _SampleDescription, Flags = _SwapChainFlags, SwapEffect = _SwapEffect }; return(_SwapChainDesc); }
public SwapChainDescriptor(IntPtr windowHandle, int width, int height, bool isWindowed, bool vSync, SwapEffect swapEffect) { WindowHandle = windowHandle; Width = width; Height = height; IsWindowed = isWindowed; VSync = vSync; SwapEffect = swapEffect; }
public void InitDefaults() { AutoDepthStencilFormat = Format.D24X8; BackBufferWidth = 800; BackBufferHeight = 600; BackBufferFormat = Format.X8R8G8B8; BackBufferCount = 1; DeviceWindowHandle = IntPtr.Zero; EnableAutoDepthStencil = true; PresentFlags = PresentFlags.None; PresentationInterval = PresentInterval.Immediate; SwapEffect = SwapEffect.Discard; Windowed = true; }
public void Clear() { autoDepthStencilFormat = DepthFormat.Unknown; backBufferCount = 0; backBufferFormat = SurfaceFormat.Unknown; backBufferWidth = 320; backBufferHeight = 480; deviceWindowHandle = IntPtr.Zero; enableAutoDepthStencil = false; fullScreenRefreshRateInHz = 0; // isFullScreen = false; multiSampleQuality = 0; multiSampleType = MultiSampleType.None; swapEffect = SwapEffect.Default; this.DisplayOrientation = DisplayOrientation.Default; }
/// <summary> /// Initializes a new instance of the <see cref="PresentParameters"/> struct. /// </summary> /// <param name="backBufferWidth">Width of the back buffer.</param> /// <param name="backBufferHeight">Height of the back buffer.</param> /// <param name="backBufferFormat">The back buffer format.</param> /// <param name="backBufferCount">The back buffer count.</param> /// <param name="multiSampleType">Type of the multi sample.</param> /// <param name="multiSampleQuality">The multi sample quality.</param> /// <param name="swapEffect">The swap effect.</param> /// <param name="deviceWindowHandle">The device window handle.</param> /// <param name="windowed">if set to <c>true</c> [windowed].</param> /// <param name="enableAutoDepthStencil">if set to <c>true</c> [enable auto depth stencil].</param> /// <param name="autoDepthStencilFormat">The auto depth stencil format.</param> /// <param name="presentFlags">The present flags.</param> /// <param name="fullScreenRefreshRateInHz">The full screen refresh rate in hz.</param> /// <param name="presentationInterval">The presentation interval.</param> 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; }
public void Clear() { autoDepthStencilFormat = DepthFormat.Unknown; backBufferCount = 0; backBufferFormat = SurfaceFormat.Unknown; backBufferHeight = 0; backBufferWidth = 0; deviceWindowHandle = IntPtr.Zero; enableAutoDepthStencil = false; fullScreenRefreshRateInHz = 0; isFullScreen = false; multiSampleQuality = 0; multiSampleType = MultiSampleType.None; presentationInterval = PresentInterval.Default; presentOptions = PresentOptions.None; swapEffect = SwapEffect.Default; }
/// <summary> /// Initializes a new instance of the <see cref="PresentParameters"/> struct. /// </summary> /// <param name="backBufferWidth">Width of the back buffer.</param> /// <param name="backBufferHeight">Height of the back buffer.</param> /// <param name="backBufferFormat">The back buffer format.</param> /// <param name="backBufferCount">The back buffer count.</param> /// <param name="multiSampleType">Type of the multi sample.</param> /// <param name="multiSampleQuality">The multi sample quality.</param> /// <param name="swapEffect">The swap effect.</param> /// <param name="deviceWindowHandle">The device window handle.</param> /// <param name="windowed">if set to <c>true</c> [windowed].</param> /// <param name="enableAutoDepthStencil">if set to <c>true</c> [enable auto depth stencil].</param> /// <param name="autoDepthStencilFormat">The auto depth stencil format.</param> /// <param name="presentFlags">The present flags.</param> /// <param name="fullScreenRefreshRateInHz">The full screen refresh rate in Hz.</param> /// <param name="presentationInterval">The presentation interval.</param> 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; }
public void Clear() { autoDepthStencilFormat = DepthFormat.None; backBufferCount = 0; backBufferFormat = SurfaceFormat.Color; backBufferWidth = (int)(UIScreen.MainScreen.Bounds.Width * UIScreen.MainScreen.Scale); backBufferHeight = (int)(UIScreen.MainScreen.Bounds.Height * UIScreen.MainScreen.Scale); deviceWindowHandle = IntPtr.Zero; enableAutoDepthStencil = false; fullScreenRefreshRateInHz = 0; isFullScreen = UIApplication.SharedApplication.StatusBarHidden; depthStencilFormat = DepthFormat.None; multiSampleCount = 0; multiSampleQuality = 0; multiSampleType = MultiSampleType.None; swapEffect = SwapEffect.Default; this.DisplayOrientation = DisplayOrientation.Default; }
/// <summary> /// Create new instance of <see cref="SwapChainDescription1"/> struct. /// </summary> /// <param name="width"></param> /// <param name="height"></param> /// <param name="format"></param> /// <param name="stereo"></param> /// <param name="usage"></param> /// <param name="bufferCount"></param> /// <param name="scaling"></param> /// <param name="swapEffect"></param> /// <param name="alphaMode"></param> /// <param name="flags"></param> public SwapChainDescription1( int width, int height, Format format = Format.B8G8R8A8_UNorm, bool stereo = false, Usage usage = Usage.RenderTargetOutput, int bufferCount = 2, Scaling scaling = Scaling.None, SwapEffect swapEffect = SwapEffect.FlipDiscard, AlphaMode alphaMode = AlphaMode.Unspecified, SwapChainFlags flags = SwapChainFlags.None) { Width = width; Height = height; Format = format; Stereo = stereo; SampleDescription = new SampleDescription(1, 0); Usage = usage; BufferCount = bufferCount; Scaling = scaling; SwapEffect = swapEffect; AlphaMode = alphaMode; Flags = flags; }
/// <summary> /// Function to convert a Gorgon swap effect into a D3D swap effect. /// </summary> /// <param name="swapEffect">Swap effect to convert.</param> /// <returns>The D3D swap effect.</returns> internal static SharpDX.DXGI.SwapEffect Convert(SwapEffect swapEffect) { return(swapEffect == SwapEffect.Discard ? SharpDX.DXGI.SwapEffect.Discard : SharpDX.DXGI.SwapEffect.Sequential); }
/// <summary> /// /// </summary> /// <param name="wind"></param> /// <param name="swap"></param> /// <param name="BackBuffers"></param> /// <param name="BBWidth"></param> /// <param name="BBHeight"></param> /// <param name="BBFmt"></param> /// <returns></returns> public PresentParameters SetPParams(bool wind, SwapEffect swap, int BackBuffers, int BBWidth, int BBHeight, Format BBFmt) { return new PresentParameters { Windowed = wind, // Is our device going to be running in a windowed or full screen application? SwapEffect = swap, // How should we handle the refreshing of our application? BackBufferCount = BackBuffers, BackBufferHeight = BBHeight, BackBufferWidth = BBWidth, BackBufferFormat = BBFmt }; }
public SwapChainDescription CreateSwapChain(int PBufferCount, Usage PUsage, IntPtr PFormHandle, bool PIsWindowed, int PModeDescriptionWidth, int PModeDescriptionHeight, Rational PModeDescriptionRefreshRate, Format PModeDescriptionFormat, int PSampleDescriptionCount, int PSampleDescriptionQuality, SwapChainFlags PSwapChainFlags, SwapEffect PSwapEffect) { this._BufferCount = PBufferCount; this._Usage = PUsage; this._FormHandle = PFormHandle; this._IsWindowed = PIsWindowed; this._ModeDescriptionWidth = PModeDescriptionWidth; this._ModeDescriptionHeight = PModeDescriptionHeight; this._ModeDescriptionRefreshRate = PModeDescriptionRefreshRate; this._ModeDescriptionFormat = PModeDescriptionFormat; this._SampleDescriptionCount = PSampleDescriptionCount; this._SampleDescriptionQuality = PSampleDescriptionQuality; this._SwapChainFlags = PSwapChainFlags; this._SwapEffect = PSwapEffect; _SampleDescription = new SampleDescription(_SampleDescriptionCount, _SampleDescriptionQuality); _ModeDescription = new ModeDescription(_ModeDescriptionWidth, _ModeDescriptionHeight, _ModeDescriptionRefreshRate, _ModeDescriptionFormat); _SwapChainDesc = new SwapChainDescription() { BufferCount = _BufferCount, Usage=_Usage, OutputHandle=_FormHandle, IsWindowed=_IsWindowed, ModeDescription=_ModeDescription, SampleDescription=_SampleDescription, Flags=_SwapChainFlags, SwapEffect=_SwapEffect }; return _SwapChainDesc; }
/// <summary> /// Settaggio manuale di un Device fullscreen /// </summary> /// <param name="handle"></param> /// <param name="BackBufferHeight"></param> /// <param name="BackBufferWidth"></param> /// <param name="RefreshRateInHz"></param> /// <param name="BackBufferFormat"></param> /// <param name="BackBufferCount"></param> /// <param name="SwapEffect"></param> /// <param name="DeviceType"></param> /// <param name="CreateFlags"></param> /// <param name="MultiSample"></param> /// <returns></returns> public bool SetManualEngine(Control handle, int BackBufferHeight, int BackBufferWidth, int RefreshRateInHz, Format BackBufferFormat, int BackBufferCount, SwapEffect SwapEffect, Microsoft.DirectX.Direct3D.DeviceType DeviceType, CreateFlags CreateFlags, MultiSampleType MultiSample) { try { my_params_x.Windowed = false; my_params_x.BackBufferHeight = BackBufferHeight; my_params_x.BackBufferWidth = BackBufferWidth; my_params_x.BackBufferFormat = BackBufferFormat; my_params_x.FullScreenRefreshRateInHz = RefreshRateInHz; my_params_x.MultiSample = MultiSample; my_params_x.EnableAutoDepthStencil = true; my_params_x.AutoDepthStencilFormat = DepthFormat.D16; my_params_x.BackBufferCount = 1; my_params_x.SwapEffect = SwapEffect; device = new Microsoft.DirectX.Direct3D.Device(0, DeviceType, handle, CreateFlags, my_params_x); errorsToPrint = new PrintScreen("arial", 12); return true; } catch (DirectXException) { errorsToPrint = new PrintScreen("arial", 12); return false; } }
//Change card.effectType and this public Effect[] GetEffects(Card.EffectType[] effectNames) { Effect[] effects = new Effect[effectNames.Length]; for (int i = 0; i < effectNames.Length; i++) { switch (effectNames[i]) { case Card.EffectType.VitDamage: effects[i] = new VitDamageEffect(); break; case Card.EffectType.ShieldDamage: effects[i] = new ShieldDamageEffect(); break; case Card.EffectType.VitDamageAll: effects[i] = new VitDamageAll(); break; case Card.EffectType.ShieldDamageAll: effects[i] = new ShieldDamageAll(); break; case Card.EffectType.PiercingDamage: effects[i] = new PiercingDamageEffect(); break; case Card.EffectType.PiercingDamageAll: effects[i] = new PiercingDamageAll(); break; case Card.EffectType.SetKnockBackDamage: effects[i] = new SetKnockBackDamage(); break; case Card.EffectType.ForcedMovement: effects[i] = new ForcedMovementEffect(); break; case Card.EffectType.TauntEffect: effects[i] = new TauntEffect(); break; case Card.EffectType.GetMissingHealth: effects[i] = new GetMissingHealth(); break; case Card.EffectType.Buff: effects[i] = new ApplyBuffEffect(); break; case Card.EffectType.Cleanse: effects[i] = new CleanseEffect(); break; case Card.EffectType.CreateObject: effects[i] = new CreateObjectEffect(); break; case Card.EffectType.GetCurrentAttack: effects[i] = new GetCurrentAttackEffect(); break; case Card.EffectType.DrawCards: effects[i] = new DrawCardEffect(); break; case Card.EffectType.GetCurrentShield: effects[i] = new GetCurrentShield(); break; case Card.EffectType.GetBonusShield: effects[i] = new GetBonusArmorEffect(); break; case Card.EffectType.GetNumberOfTargetsInRangeEffect: effects[i] = new GetNumberOfTargetsInRangeEffect(); break; case Card.EffectType.GetDamageDoneEffect: effects[i] = new GetDamageDoneEffect(); break; case Card.EffectType.GetNumberOfCardsPlayedInTurn: effects[i] = new GetNumberOfCardsPlayedEffect(); break; case Card.EffectType.Swap: effects[i] = new SwapEffect(); break; case Card.EffectType.Teleport: effects[i] = new TeleportEffect(); break; case Card.EffectType.ManaGain: effects[i] = new ManaGainEffect(); break; case Card.EffectType.EnergyGain: effects[i] = new EnergyGainEffect(); break; case Card.EffectType.SetDuration: effects[i] = new SetDurationEffect(); break; case Card.EffectType.GetNumberInStack: effects[i] = new GetNumberInStackEffect(); break; case Card.EffectType.GravityEffect: effects[i] = new GravityEffect(); break; case Card.EffectType.CardCostReductionDrawn: effects[i] = new CardCostReductionDrawn(); break; case Card.EffectType.DrawManaCards: effects[i] = new DrawManaCardEffect(); break; case Card.EffectType.Sacrifice: effects[i] = new SacrificeEffect(); break; case Card.EffectType.GetNumberOfAttackers: effects[i] = new GetNumberOfAttackersEffect(); break; case Card.EffectType.ModifyTempValue: effects[i] = new ModifyTempValueEffect(); break; default: effects[i] = null; break; } } return(effects); }