Beispiel #1
0
        /// <summary>
        /// </summary>
        /// <param name="anchor"></param>
        /// <param name="margin"></param>
        /// <param name="size"></param>
        /// <param name="zNear"></param>
        /// <param name="zFar"></param>
        public UIColorPaletteMarkersRenderer(int maxMarkerCount,
                                             System.Windows.Forms.AnchorStyles anchor, System.Windows.Forms.Padding margin,
                                             System.Drawing.Size size, int zNear, int zFar)
            : base(anchor, margin, size, zNear, zFar)
        {
            var model = new LinesModel(maxMarkerCount);

            this.Renderer = LinesRenderer.Create(model);
        }
Beispiel #2
0
        public static LinesRenderer Create(LinesModel model)
        {
            var shaderCodes = new ShaderCode[2];

            shaderCodes[0] = new ShaderCode(File.ReadAllText(@"shaders\Lines.vert"), ShaderType.VertexShader);
            shaderCodes[1] = new ShaderCode(File.ReadAllText(@"shaders\Lines.frag"), ShaderType.FragmentShader);
            var map = new PropertyNameMap();

            map.Add("in_Position", LinesModel.position);
            var renderer = new LinesRenderer(model, shaderCodes, map);

            renderer.markerCount = model.markerCount;

            return(renderer);
        }