コード例 #1
0
        unsafe void SetTexture(Texture texture, Color4 color, float opacity)
        {
            SetTextureInner(texture.ResourceView);

            var buffer = new Brush.BrushBuffer()
            {
                Type = 4, Opacity = opacity
            };

            buffer.GradientColors[0] = color.R;
            buffer.GradientColors[1] = color.G;
            buffer.GradientColors[2] = color.B;
            buffer.GradientColors[3] = color.A;
            deviceContext.UpdateSubresource(brushBuffer, 0, null, (IntPtr)(&buffer), 0, 0);
            deviceContext.PixelShader.SetConstantBuffer(1, brushBuffer);
        }
コード例 #2
0
ファイル: Renderer_Layer0.cs プロジェクト: Artentus/GameUtils
        unsafe void SetTexture(Texture texture, Color4 color, float opacity)
        {
            SetTextureInner(texture.ResourceView);

            var buffer = new Brush.BrushBuffer() { Type = 4, Opacity = opacity};
            buffer.GradientColors[0] = color.R;
            buffer.GradientColors[1] = color.G;
            buffer.GradientColors[2] = color.B;
            buffer.GradientColors[3] = color.A;
            deviceContext.UpdateSubresource(brushBuffer, 0, null, (IntPtr)(&buffer), 0, 0);
            deviceContext.PixelShader.SetConstantBuffer(1, brushBuffer);
        }
コード例 #3
0
 unsafe void SetBrushBuffer(Brush.BrushBuffer buffer)
 {
     deviceContext.UpdateSubresource(brushBuffer, 0, null, (IntPtr)(&buffer), 0, 0);
     deviceContext.PixelShader.SetConstantBuffer(1, brushBuffer);
 }