示例#1
0
        public GLButtonRenderer()
        {
            var model = new CtrlButtonModel();
            var vs    = new VertexShader(vert);
            var fs    = new FragmentShader(frag);
            var codes = new ShaderArray(vs, fs);
            var map   = new AttributeMap();

            map.Add(inPosition, CtrlButtonModel.strPosition);
            map.Add(inColor, CtrlButtonModel.strColor);
            var methodBuilder = new RenderMethodBuilder(codes, map, new PolygonModeSwitch(PolygonMode.Fill), new LineWidthSwitch(2));

            this.renderMethod = methodBuilder.ToRenderMethod(model);
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        public CtrlButton()
        {
            var model = new CtrlButtonModel();
            var vs    = new VertexShader(vert, inPosition, inColor);
            var fs    = new FragmentShader(frag);
            var codes = new ShaderArray(vs, fs);
            var map   = new AttributeMap();

            map.Add(inPosition, CtrlButtonModel.position);
            map.Add(inColor, CtrlButtonModel.color);
            var methodBuilder = new RenderMethodBuilder(codes, map, new PolygonModeState(PolygonMode.Fill), new LineWidthState(2));

            this.RenderUnit = new ModernRenderUnit(model, methodBuilder);

            this.Initialize();
        }
示例#3
0
        /// <summary>
        /// A rectangle control that displays an image.
        /// </summary>
        public CtrlButton()
            : base(GUIAnchorStyles.Left | GUIAnchorStyles.Top)
        {
            var model = new CtrlButtonModel();
            var vs    = new VertexShader(vert);
            var fs    = new FragmentShader(frag);
            var codes = new ShaderArray(vs, fs);
            var map   = new AttributeMap();

            map.Add(inPosition, CtrlButtonModel.position);
            map.Add(inColor, CtrlButtonModel.color);
            var methodBuilder = new RenderMethodBuilder(codes, map, new PolygonModeState(PolygonMode.Fill), new LineWidthState(2));

            this.RenderUnit = new ModernRenderUnit(model, methodBuilder);

            this.Initialize();

            this.MouseDown += CtrlButton_MouseDown;
            this.MouseUp   += CtrlButton_MouseUp;
        }