1

Closed

disappearing sprites

description

In RecordingSample the second sprite is disappearing when using the following code and after pressing enter. When using two SpriteBatches everything is working fine (uncomment the two lines).
 
        GraphicsDevice.Clear(Color.CornflowerBlue);
 
        spriteBatch.Begin();
        if (Keyboard.GetState().IsKeyDown(Keys.Enter))
        {
            spriteBatch.Draw(logo, Vector2.Zero, Color.White);
        }
        //spriteBatch.End();
        //spriteBatch.Begin();
        spriteBatch.Draw(logo, new Rectangle(Mouse.GetState().X, Mouse.GetState().Y, 115, 30), Color.White);
        spriteBatch.End();
 
        base.Draw(gameTime);
Closed Jan 9, 2012 at 1:23 PM by Glatzemann
fixed in #12958When rendering more than one sprite the last sprite of each individual texture block was not rendered.

comments

Glatzemann wrote Jan 9, 2012 at 1:06 PM

The issue does not occur when using SpriteSortMode.Immediate => has something to do with texture sorting/batching.

Glatzemann wrote Jan 9, 2012 at 1:13 PM

The issue has nothing to do with the InputSystem. When using a frame counter and displaying both sprites in the first frame, the second sprites disappears in the second frame.