Beispiel #1
0
        public void updateTexture(AnimatedCursorTexture texture)
        {
            textureVariable.Set(texture.texture);

            TimeSpan now = timers[animationTimer];

            lastFrameSwitch         = lastRendered = now;
            animatedConstants.frame = 0;
            frameDuration           = texture.frameDuration;
            animationFrames         = texture.animationFrames;
        }
Beispiel #2
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);
        }
Beispiel #3
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);
        }
Beispiel #4
0
 public void updateTexture(MonochromeCursorTexture texture)
 {
     textureVariableRgb.Set(texture.texture);
     textureVariableInvert.Set(texture.texture);
 }
Beispiel #5
0
 public void updateTexture(StaticCursorTexture texture)
 {
     textureVariable.Set(texture.texture);
 }