XNA - Texture2D won't get rendered after ~10 frames.

Started by
11 comments, last by FelixK15 11 years, 1 month ago

Actually that is not *quite* the same problem as I'm having.

If I minimize the game I can still see my player sprite and some of the other dynamic objects.

However my problem is that nothing gets drawn after a specific amount of frames (like in the video I posted).

The RenderTarget2D.ContentLost is also not getting called when my sprites stop getting drawn, however if I minimize/restore the window AFTER

the sprites disappear the sprites of the player and dynamic objects are getting drawn again.

Visit my blog, follow me on twitter or check out my bitbucket repositories.

Advertisement
Hmm, you may be right, it might be something different.

I actually had it do some weird stuff while I was switching windows on the desktop (I know some stuff turned purple), and then I tried running it again and testing for the device lost which I described above. So it's possible that it did repro on my machine once, but I can't seem to repro it again. I can only get things to disappear if I force a device reset.

So I'm not sure what else to suggest at this point.

I looked at your code a bit. You're creating 496 render targets at startup. I know you Dispose them right away, but maybe it's somehow messing with your graphics card. I'm pretty sure there has to be an alternative way to do what you're doing.
Does it repro if you remove that code?

Thanks for your hint!

The problem are in fact the RenderTargets.

I removed all RenderTargets from the GameWorldLoader and voila...it works.

Now I gotta find a workaround for that...gheez

Visit my blog, follow me on twitter or check out my bitbucket repositories.

This topic is closed to new replies.

Advertisement