internal void SwitchDisplayImage(bool forward) { if (forward) { switch (this.currentDisplay) { case CurrentDisplayImage.Input: this.renderer.SetUniform("output_image", new samplerValue( BindTextureTarget.Texture2D, this.intermediate_image[0], OpenGL.GL_TEXTURE0)); this.currentDisplay = CurrentDisplayImage.Intermediate; break; case CurrentDisplayImage.Intermediate: this.renderer.SetUniform("output_image", new samplerValue( BindTextureTarget.Texture2D, this.output_image[0], OpenGL.GL_TEXTURE0)); this.currentDisplay = CurrentDisplayImage.Output; break; case CurrentDisplayImage.Output: this.renderer.SetUniform("output_image", new samplerValue( BindTextureTarget.Texture2D, this.input_image[0], OpenGL.GL_TEXTURE0)); this.currentDisplay = CurrentDisplayImage.Input; break; default: throw new NotImplementedException(); } } else { switch (this.currentDisplay) { case CurrentDisplayImage.Input: this.renderer.SetUniform("output_image", new samplerValue( BindTextureTarget.Texture2D, this.output_image[0], OpenGL.GL_TEXTURE0)); this.currentDisplay = CurrentDisplayImage.Output; break; case CurrentDisplayImage.Intermediate: this.renderer.SetUniform("output_image", new samplerValue( BindTextureTarget.Texture2D, this.input_image[0], OpenGL.GL_TEXTURE0)); this.currentDisplay = CurrentDisplayImage.Input; break; case CurrentDisplayImage.Output: this.renderer.SetUniform("output_image", new samplerValue( BindTextureTarget.Texture2D, this.intermediate_image[0], OpenGL.GL_TEXTURE0)); this.currentDisplay = CurrentDisplayImage.Intermediate; break; default: throw new NotImplementedException(); } } }
internal void StateDisplayImage(bool forward) { if (forward) { switch (this.currentDisplay) { case CurrentDisplayImage.Input: this.SetUniform("output_image", this.intermediateTexture); this.currentDisplay = CurrentDisplayImage.Intermediate; break; case CurrentDisplayImage.Intermediate: this.SetUniform("output_image", this.outputTexture); this.currentDisplay = CurrentDisplayImage.Output; break; case CurrentDisplayImage.Output: this.SetUniform("output_image", this.inputTexture); this.currentDisplay = CurrentDisplayImage.Input; break; default: throw new NotImplementedException(); } } else { switch (this.currentDisplay) { case CurrentDisplayImage.Input: this.SetUniform("output_image", this.outputTexture); this.currentDisplay = CurrentDisplayImage.Output; break; case CurrentDisplayImage.Intermediate: this.SetUniform("output_image", this.inputTexture); this.currentDisplay = CurrentDisplayImage.Input; break; case CurrentDisplayImage.Output: this.SetUniform("output_image", this.intermediateTexture); this.currentDisplay = CurrentDisplayImage.Intermediate; break; default: throw new NotImplementedException(); } } }