public SetUniform ( string name, CurrentTextureType current ) : void | ||
name | string | Name of the texture in the shader |
current | CurrentTextureType | |
return | void |
public Pixelate() : base("pixelate") { // Load the texture and initialize the sprite myTexture = new Texture("resources/background.jpg"); mySprite = new Sprite(myTexture); // Load the shader myShader = new Shader(null, null, "resources/pixelate.frag"); myShader.SetUniform("texture", Shader.CurrentTexture); }
public Edge() : base("edge post-effect") { // Create the off-screen surface mySurface = new RenderTexture(800, 600); mySurface.Smooth = true; // Load the textures myBackgroundTexture = new Texture("resources/sfml.png"); myBackgroundTexture.Smooth = true; myEntityTexture = new Texture("resources/devices.png"); myEntityTexture.Smooth = true; // Initialize the background sprite myBackgroundSprite = new Sprite(myBackgroundTexture); myBackgroundSprite.Position = new Vector2f(135, 100); // Load the moving entities myEntities = new Sprite[6]; for (int i = 0; i < myEntities.Length; ++i) { myEntities[i] = new Sprite(myEntityTexture, new IntRect(96 * i, 0, 96, 96)); } // Load the shader myShader = new Shader(null, null, "resources/edge.frag"); myShader.SetUniform("texture", Shader.CurrentTexture); }