/|\ y | | | ---------------> x (0, 0) 0 2 4 6 8 10 -------------------------- | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -------------------------- 1 3 5 7 9 11 side length is 1.
Inheritance: CSharpGL.Renderer
        /// <summary>
        /// 彩色的色标带。
        /// </summary>
        /// <param name="anchor"></param>
        /// <param name="margin"></param>
        /// <param name="size"></param>
        /// <param name="zNear"></param>
        /// <param name="zFar"></param>
        public UIColorPaletteBarRenderer(
            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 QuadStripModel(1);

            this.Renderer = QuadStripRenderer.Create(model);
        }
Ejemplo n.º 2
0
        public static QuadStripRenderer Create(QuadStripModel model)
        {
            var shaderCodes = new ShaderCode[2];
            shaderCodes[0] = new ShaderCode(File.ReadAllText(@"shaders\QuadStripTexture.vert"), ShaderType.VertexShader);
            shaderCodes[1] = new ShaderCode(File.ReadAllText(@"shaders\QuadStripTexture.frag"), ShaderType.FragmentShader);
            var map = new AttributeMap();
            map.Add("in_Position", QuadStripModel.position);
            map.Add("in_TexCoord", QuadStripModel.texCoord);

            var renderer = new QuadStripRenderer(model, shaderCodes, map);
            return renderer;
        }
Ejemplo n.º 3
0
        public static QuadStripRenderer Create(QuadStripModel model)
        {
            var shaderCodes = new ShaderCode[2];

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

            map.Add("in_Position", QuadStripModel.position);
            map.Add("in_TexCoord", QuadStripModel.texCoord);

            var renderer = new QuadStripRenderer(model, shaderCodes, map);

            return(renderer);
        }