Avoiding lag when rendering Texture2D for first time

Posted by Emir Lima on Game Development See other posts from Game Development or by Emir Lima
Published on 2013-10-27T13:57:02Z Indexed on 2013/10/30 16:15 UTC
Read the original article Hit count: 263

Filed under:

I have found a similar question here, but it is about playing sounds.

I am using 2048 x 2048 textures for sprite sheets and every time I call spriteBatch.Draw using a sheet for the first time in game execution, causes a considerable lag. The lag doesn't appears for the next times.

Someone has faced this problem before? What can I do to overcome this?

Update:

I inserted a code in the end of content load routine that draws EVERY Texture2D that is loaded into ContentManager before follow to the game screen. This works well. None lag occurs when different textures are rendered over the time, EXCEPT if the IsFullScreen are changed. Apparently, changing this property makes the textures loaded in the GPU gone. Is that correct?

© Game Development or respective owner

Related posts about xna-4.0