/// <summary> /// Function to determine if two texture sampler states are equal or not. /// </summary> /// <param name="left">Left side to evaluate.</param> /// <param name="right">Right side to evaluate.</param> /// <returns>TRUE if equal, FALSE if not.</returns> public static bool Equals(ref GorgonTextureSamplerStates left, ref GorgonTextureSamplerStates right) { // ReSharper disable CompareOfFloatsByEqualityOperator return((GorgonColor.Equals(ref left.BorderColor, ref right.BorderColor)) && (left.ComparisonFunction == right.ComparisonFunction) && (left.DepthAddressing == right.DepthAddressing) && (left.HorizontalAddressing == right.HorizontalAddressing) && (left.MaxAnisotropy == right.MaxAnisotropy) && (left.MaxLOD == right.MaxLOD) && (left.MinLOD == right.MinLOD) && (left.MipLODBias == right.MipLODBias) && (left.TextureFilter == right.TextureFilter) && (left.VerticalAddressing == right.VerticalAddressing)); // ReSharper restore CompareOfFloatsByEqualityOperator }
/// <summary> /// Function to clear the render target view. /// </summary> /// <param name="color">Color used to clear the render target view.</param> /// <param name="deferred">[Optional] A deferred context to use when clearing the depth/stencil buffer.</param> /// <remarks>If the <paramref name="deferred"/> parameter is NULL (Nothing in VB.Net), the immediate context will be used to clear the render target. If it is non-NULL, then it /// will use the specified deferred context to clear the render target. /// <para>If you are using a deferred context, it is necessary to use that context to clear the render target because 2 threads may not access the same resource at the same time. /// Passing a separate deferred context will alleviate that.</para> /// </remarks> public void Clear(GorgonColor color, GorgonGraphics deferred = null) { if (deferred != null) { deferred.Context.ClearRenderTargetView(D3DView, color.SharpDXColor4); return; } Resource.Graphics.Context.ClearRenderTargetView(D3DView, color.SharpDXColor4); }
/// <summary> /// Function to clear the render target and an attached depth/stencil buffer. /// </summary> /// <param name="color">Color used to clear the render target.</param> /// <param name="depthValue">Value used to clear the depth buffer.</param> /// <param name="stencilValue">Value used to clear the stencil buffer.</param> /// <param name="deferred">[Optional] A deferred context to use when clearing the render target.</param> /// <remarks> /// This will only clear the default view for the render target. /// <para> /// If the <paramref name="deferred"/> parameter is NULL (Nothing in VB.Net), the immediate context will be used to clear the render target. If it is non-NULL, then it /// will use the specified deferred context to clear the render target. /// <para>If you are using a deferred context, it is necessary to use that context to clear the render target because 2 threads may not access the same resource at the same time. /// Passing a separate deferred context will alleviate that.</para> /// </para> /// </remarks> public void Clear(GorgonColor color, float depthValue, byte stencilValue, GorgonGraphics deferred = null) { _defaultRenderTargetView.Clear(color, deferred); if (DepthStencilBuffer == null) { return; } DepthStencilBuffer.Clear(depthValue, stencilValue, deferred); }
/// <summary> /// Function to reset the blending states. /// </summary> internal override void Reset() { base.Reset(); _blendFactor = GorgonColor.Transparent; _sampleMask = 0xFFFFFFFF; Graphics.Context.OutputMerger.BlendSampleMask = (int)_sampleMask; Graphics.Context.OutputMerger.BlendFactor = _blendFactor.SharpDXColor4; States = GorgonBlendStates.DefaultStates; }
/// <summary> /// Function to clear the render target and an attached depth/stencil buffer. /// </summary> /// <param name="color">Color used to clear the render target.</param> /// <param name="deferred">[Optional] A deferred context to use when clearing the render target.</param> /// <remarks> /// This will only clear the default view for the render target. /// <para> /// If the <paramref name="deferred"/> parameter is NULL (Nothing in VB.Net), the immediate context will be used to clear the render target. If it is non-NULL, then it /// will use the specified deferred context to clear the render target. /// <para>If you are using a deferred context, it is necessary to use that context to clear the render target because 2 threads may not access the same resource at the same time. /// Passing a separate deferred context will alleviate that.</para> /// </para> /// </remarks> public void Clear(GorgonColor color, GorgonGraphics deferred = null) { _defaultRenderTargetView.Clear(color, deferred); }
/// <summary> /// Function to read the brush elements in from a chunked file. /// </summary> /// <param name="chunk">Chunk reader used to read the data.</param> internal override void Read(GorgonChunkReader chunk) { HatchStyle = chunk.Read <HatchStyle>(); ForegroundColor = chunk.Read <GorgonColor>(); BackgroundColor = chunk.Read <GorgonColor>(); }
/// <summary> /// Function to clear the render target and an attached depth/stencil buffer. /// </summary> /// <param name="color">Color used to clear the render target.</param> /// <param name="depthValue">Value used to clear the depth buffer.</param> /// <param name="stencilValue">Value used to clear the stencil buffer.</param> /// <param name="deferred">[Optional] A deferred context to use when clearing the render target.</param> /// <remarks> /// This will only clear the default render target view. /// <para> /// If the <paramref name="deferred"/> parameter is NULL (Nothing in VB.Net), the immediate context will be used to clear the render target. If it is non-NULL, then it /// will use the specified deferred context to clear the render target. /// <para>If you are using a deferred context, it is necessary to use that context to clear the render target because 2 threads may not access the same resource at the same time. /// Passing a separate deferred context will alleviate that.</para> /// </para> /// </remarks> public void Clear(GorgonColor color, float depthValue, byte stencilValue, GorgonGraphics deferred = null) { _renderTarget.Clear(color, depthValue, stencilValue, deferred); }
/// <summary> /// Function to clear the render target. /// </summary> /// <param name="color">Color used to clear the render target.</param> /// <param name="deferred">[Optional] A deferred context to use when clearing the render target.</param> /// <remarks> /// This will only clear the default render target view. Any attached depth/stencil buffer will remain untouched. /// <para> /// If the <paramref name="deferred"/> parameter is NULL (Nothing in VB.Net), the immediate context will be used to clear the render target. If it is non-NULL, then it /// will use the specified deferred context to clear the render target. /// <para>If you are using a deferred context, it is necessary to use that context to clear the render target because 2 threads may not access the same resource at the same time. /// Passing a separate deferred context will alleviate that.</para> /// </para> /// </remarks> public void Clear(GorgonColor color, GorgonGraphics deferred = null) { _renderTarget.Clear(color, deferred); }
/// <summary> /// Initializes a new instance of the <see cref="GorgonGlyphSolidBrush"/> class. /// </summary> public GorgonGlyphSolidBrush() { Color = GorgonColor.White; }
/// <summary> /// Function to read the brush elements in from a chunked file. /// </summary> /// <param name="chunk">Chunk reader used to read the data.</param> internal override void Read(GorgonChunkReader chunk) { Color = chunk.Read <GorgonColor>(); }