public Pipeline CreateAPipeline(ResourceLayout[] resourceLayouts, ShaderSetDescription shaderSetDescription, OutputDescription outputDescription, BlendStateDescription blendStateDescription, bool depthTest, FaceCullMode faceCullMode = FaceCullMode.None, PolygonFillMode polygonFillMode = PolygonFillMode.Solid, FrontFace frontFaceWindingOrder = FrontFace.Clockwise) { var pipelineDescription = new GraphicsPipelineDescription() { BlendState = blendStateDescription, DepthStencilState = new DepthStencilStateDescription( depthTestEnabled: depthTest, depthWriteEnabled: depthTest, comparisonKind: ComparisonKind.LessEqual), RasterizerState = new RasterizerStateDescription( cullMode: faceCullMode, fillMode: polygonFillMode, frontFace: frontFaceWindingOrder, depthClipEnabled: depthTest, scissorTestEnabled: false ), PrimitiveTopology = PrimitiveTopology.TriangleList, ResourceLayouts = resourceLayouts, ShaderSet = shaderSetDescription, Outputs = outputDescription }; return(_components.Factory.CreateGraphicsPipeline(pipelineDescription)); }
public override void SetPolyFillMode(PolygonFillMode aMode) { BufferChunk chunk = new BufferChunk(128); chunk += GDI32.EMR_SETPOLYFILLMODE; chunk += (int)aMode; SendCommand(chunk); }
internal static VkPolygonMode VdToVkPolygonMode(PolygonFillMode fillMode) { switch (fillMode) { case PolygonFillMode.Solid: return VkPolygonMode.Fill; case PolygonFillMode.Wireframe: return VkPolygonMode.Line; default: throw Illegal.Value<PolygonFillMode>(); } }
/// <summary> /// Constructs a new RasterizerStateDescription. /// </summary> /// <param name="cullMode">Controls which face will be culled.</param> /// <param name="fillMode">Controls how the rasterizer fills polygons.</param> /// <param name="frontFace">Controls the winding order used to determine the front face of primitives.</param> /// <param name="depthClipEnabled">Controls whether depth clipping is enabled.</param> /// <param name="scissorTestEnabled">Controls whether the scissor test is enabled.</param> public RasterizerStateDescription( FaceCullMode cullMode, PolygonFillMode fillMode, FrontFace frontFace, bool depthClipEnabled, bool scissorTestEnabled) { CullMode = cullMode; FillMode = fillMode; FrontFace = frontFace; DepthClipEnabled = depthClipEnabled; ScissorTestEnabled = scissorTestEnabled; }
internal static FillMode VdToD3D11FillMode(PolygonFillMode fillMode) { switch (fillMode) { case PolygonFillMode.Solid: return(FillMode.Solid); case PolygonFillMode.Wireframe: return(FillMode.Wireframe); default: throw Illegal.Value <PolygonFillMode>(); } }
internal static MTLTriangleFillMode VdToMTLFillMode(PolygonFillMode fillMode) { switch (fillMode) { case PolygonFillMode.Solid: return(MTLTriangleFillMode.Fill); case PolygonFillMode.Wireframe: return(MTLTriangleFillMode.Lines); default: throw Illegal.Value <PolygonFillMode>(); } }
private static int TranslateFillMode(PolygonFillMode fillMode) { int nativeFillMode = 0; switch (fillMode) { case PolygonFillMode.Alternate: nativeFillMode = 1; break; case PolygonFillMode.NonZeroWinding: nativeFillMode = 2; break; } if (nativeFillMode == 0) { throw new ArgumentException("Unrecognized PolygonFillMode", nameof(fillMode)); } else { return(nativeFillMode); } }
public static Region CreateMultiplePolygon(IList <IList <Point> > polygons, PolygonFillMode fillMode) { var maxPointCount = (from shape in polygons select shape.Count).Sum(); var points = new Point[maxPointCount]; var endpoints = new List <int>(polygons.Count); int offset = 0; foreach (var shape in polygons) { shape.CopyTo(points, offset); offset += shape.Count; endpoints.Add(shape.Count); } var endpointArray = new int[endpoints.Count]; endpoints.CopyTo(endpointArray, 0); return(new Region(NativeMethods.CreatePolyPolygonRgn(points, endpointArray, maxPointCount, TranslateFillMode(fillMode)))); }
public static GDIRegion CreateFromPolygon(Point2I[] points, PolygonFillMode aMode, Guid uniqueID) { TOAPI.Types.POINT[] pts = new POINT[points.Length]; for (int i = 0; i < pts.Length; i++) { pts[i].X = points[i].x; pts[i].Y = points[i].y; } IntPtr regionHandle = GDI32.CreatePolygonRgn(pts, pts.Length, (int)aMode); GDIRegion newRegion = new GDIRegion(regionHandle, true, uniqueID); return newRegion; }
public IPipelineBuilder With(PolygonFillMode polygonFillMode) { rasterizer.FillMode = polygonFillMode; return(this); }
public virtual void SetPolyFillMode(PolygonFillMode fillMode) { GDI32.SetPolyFillMode(this, (int)fillMode); }
public virtual void SetPolyFillMode(PolygonFillMode fillMode) { DeviceContext.SetPolyFillMode(fillMode); }
public virtual void SetPolyFillMode(PolygonFillMode fillMode) { }
public static Region CreatePolygon(IList <Point> points, PolygonFillMode fillMode) { Point[] pointArray = new Point[points.Count]; points.CopyTo(pointArray, 0); return(new Region(NativeMethods.CreatePolygonRgn(pointArray, points.Count, TranslateFillMode(fillMode)))); }
public virtual void SetPolyFillMode(PolygonFillMode aMode) { if (null != SetPolyFillModeHandler) SetPolyFillModeHandler(aMode); }