Exemplo n.º 1
0
        void iCursorRender.render(IDeviceContext context, IBuffer vertexBuffer)
        {
            context.writeBuffer(constantBuffer, ref position);
            context.SetVertexBuffer(0, vertexBuffer, 0);
            DrawAttribs draw = new DrawAttribs(false)
            {
                NumVertices = 4,
                Flags       = DrawFlags.VerifyAll
            };

            context.SetPipelineState(psoInvert);
            context.CommitShaderResources(bindingsInvert);
            context.Draw(ref draw);

            context.SetPipelineState(psoRgb);
            context.CommitShaderResources(bindingsRgb);
            context.Draw(ref draw);
        }
Exemplo n.º 2
0
        public static void renderQuad(IDeviceContext context, IBuffer vertexBuffer)
        {
            context.SetVertexBuffer(0, vertexBuffer, 0);
            DrawAttribs draw = new DrawAttribs(false)
            {
                NumVertices = 4,
                Flags       = DrawFlags.VerifyAll
            };

            context.Draw(ref draw);
        }
Exemplo n.º 3
0
        protected void drawTriangle(IDeviceContext ic, ITextureView textureView)
        {
            ic.SetPipelineState(pipelineState);
            textureVariable.Set(textureView);
            ic.CommitShaderResources(binding);
            ic.setVertexBuffer(vertexBuffer);
            DrawAttribs draw = new DrawAttribs(false)
            {
                NumVertices = 3,
                Flags       = DrawFlags.VerifyAll
            };

            ic.Draw(ref draw);
        }
Exemplo n.º 4
0
        public void blend(IDeviceContext ic, IShaderResourceBinding source)
        {
            ic.SetPipelineState(pipelineState);
            ic.CommitShaderResources(source);
            ic.SetVertexBuffer(0, null, 0);
            DrawAttribs draw = new DrawAttribs(false)
            {
                NumVertices = 3,
                Flags       = DrawFlags.VerifyAll
            };

            // ConsoleLogger.logDebug( "BlendTextures.blend, rendering" );
            ic.Draw(ref draw);
            // ConsoleLogger.logDebug( "BlendTextures.blend, rendered" );
        }
Exemplo n.º 5
0
        public void render(IDeviceContext context, ITextureView rtv, CSize outputSize, int index)
        {
            // Setup stuff
            context.SetRenderTarget(rtv, null);
            context.setViewport(outputSize, viewport);
            context.SetPipelineState(pipelineState);
            textureVariable.Set(sourceTextures[index]);
            context.CommitShaderResources(binding);

            // Render a full-screen triangle, no vertex buffer needed
            DrawAttribs draw = new DrawAttribs(false)
            {
                NumVertices = 3,
                Flags       = DrawFlags.VerifyAll
            };

            context.Draw(ref draw);
        }