SFML.Graphics.Texture.Update C# (CSharp) Method

Update() public method

Update a texture from an image
public Update ( Image image ) : void
image Image Image to copy to the texture
return void
        public void Update(Image image)
        {
            Update(image, 0, 0);
        }

Same methods

Texture::Update ( Image image, uint x, uint y ) : void
Texture::Update ( RenderWindow window ) : void
Texture::Update ( RenderWindow window, uint x, uint y ) : void
Texture::Update ( SFML window ) : void
Texture::Update ( SFML window, uint x, uint y ) : void
Texture::Update ( byte pixels ) : void
Texture::Update ( byte pixels, uint width, uint height, uint x, uint y ) : void

Usage Example

Esempio n. 1
0
        public void Render(DoomApplication app)
        {
            if (app.State == ApplicationState.Opening)
            {
                openingSequence.Render(app.Opening);
            }
            else if (app.State == ApplicationState.Game)
            {
                RenderGame(app.Game);
            }

            if (app.Menu.Active)
            {
                menu.Render(app.Menu);
            }

            var screenData = screen.Data;
            var p          = MemoryMarshal.Cast <byte, uint>(sfmlTextureData);

            for (var i = 0; i < p.Length; i++)
            {
                p[i] = colors[screenData[i]];
            }

            sfmlTexture.Update(sfmlTextureData, (uint)screen.Height, (uint)screen.Width, 0, 0);

            sfmlWindow.Draw(sfmlSprite, sfmlStates);

            sfmlWindow.Display();
        }
All Usage Examples Of SFML.Graphics.Texture::Update