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); }
/// <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(); }
/// <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; }