/// <summary> /// 彩色的色标带。 /// </summary> /// <param name="anchor"></param> /// <param name="margin"></param> /// <param name="size"></param> /// <param name="zNear"></param> /// <param name="zFar"></param> public UIColorPaletteColoredBarRenderer( int maxMarkerCount, CodedColor[] codedColors, System.Windows.Forms.AnchorStyles anchor, System.Windows.Forms.Padding margin, System.Drawing.Size size, int zNear, int zFar) : base(anchor, margin, size, zNear, zFar) { this.codedColors = codedColors; var model = new QuadStripColoredModel(maxMarkerCount, codedColors.GetBitmap(1024)); this.Renderer = QuadStripColoredRenderer.Create(model); }
public static QuadStripColoredRenderer Create(QuadStripColoredModel model) { var shaderCodes = new ShaderCode[2]; shaderCodes[0] = new ShaderCode(File.ReadAllText(@"shaders\QuadStripColor.vert"), ShaderType.VertexShader); shaderCodes[1] = new ShaderCode(File.ReadAllText(@"shaders\QuadStripColor.frag"), ShaderType.FragmentShader); var map = new AttributeMap(); map.Add("in_Position", QuadStripColoredModel.position); map.Add("in_Color", QuadStripColoredModel.color); var renderer = new QuadStripColoredRenderer(model, shaderCodes, map); renderer.quadCount = model.quadCount; return renderer; }
public static QuadStripColoredRenderer Create(QuadStripColoredModel model) { var shaderCodes = new ShaderCode[2]; shaderCodes[0] = new ShaderCode(File.ReadAllText(@"shaders\QuadStripColor.vert"), ShaderType.VertexShader); shaderCodes[1] = new ShaderCode(File.ReadAllText(@"shaders\QuadStripColor.frag"), ShaderType.FragmentShader); var map = new AttributeMap(); map.Add("in_Position", QuadStripColoredModel.position); map.Add("in_Color", QuadStripColoredModel.color); var renderer = new QuadStripColoredRenderer(model, shaderCodes, map); renderer.quadCount = model.quadCount; return(renderer); }