Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        public CtrlButtonRenderer()
        {
            var model = new CtrlImageModel();
            var vs    = new VertexShader(vert, inPosition, inUV);
            var fs    = new FragmentShader(frag);
            var codes = new ShaderArray(vs, fs);
            var map   = new AttributeMap();

            map.Add(inPosition, CtrlImageModel.position);
            var methodBuilder = new RenderMethodBuilder(codes, map);

            this.RenderUnit = new ModernRenderUnit(model, methodBuilder);
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="bitmap">bitmap to be displayed.</param>
        /// <param name="autoDispose">auto dispose <paramref name="bitmap"/> after this object's initialization.</param>
        public CtrlImageRenderer(Bitmap bitmap, bool autoDispose = false)
        {
            var model = new CtrlImageModel();
            var vs    = new VertexShader(vert, inPosition, inUV);
            var fs    = new FragmentShader(frag);
            var codes = new ShaderArray(vs, fs);
            var map   = new AttributeMap();

            map.Add(inPosition, CtrlImageModel.position);
            map.Add(inUV, CtrlImageModel.uv);
            var methodBuilder = new RenderMethodBuilder(codes, map, new BlendState(BlendingSourceFactor.SourceAlpha, BlendingDestinationFactor.OneMinusSourceAlpha));

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

            this.bitmap      = bitmap;
            this.autoDispose = autoDispose;
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="bitmap">bitmap to be displayed.</param>
        /// <param name="autoDispose">auto dispose <paramref name="bitmap"/> after this object's initialization.</param>
        public CtrlImage(Bitmap bitmap, bool autoDispose = false)
            : base(GUIAnchorStyles.Left | GUIAnchorStyles.Top)
        {
            var model = new CtrlImageModel();
            var vs    = new VertexShader(vert);
            var fs    = new FragmentShader(frag);
            var codes = new ShaderArray(vs, fs);
            var map   = new AttributeMap();

            map.Add(inPosition, CtrlImageModel.position);
            map.Add(inUV, CtrlImageModel.uv);
            var methodBuilder = new RenderMethodBuilder(codes, map, new BlendFuncSwitch(BlendSrcFactor.SrcAlpha, BlendDestFactor.OneMinusSrcAlpha));

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

            this.bitmap      = bitmap;
            this.autoDispose = autoDispose;

            this.Initialize();
        }