Sign in to follow this  
rajivtm

Image Corruption?

Recommended Posts

Hello- I'm making a game with C# and DirectX 9. The game is working very well except for that after about a minute of playing, the bitmaps on the screen all go crazy. I don't even know how to explain the craziness.... they just get fuzzy and unreadable like they were corrupted or something. Does anyone know what might be the problem? Thanks for any help on this one, Rajiv

Share this post


Link to post
Share on other sites
Can you get a screenshot?

Sometimes if you display surfaces that haven't been initialized, you get some crazy looking results (bits and pieces of other images in memory, for example). Or blitting off screen (improper clipping) can do strange things.

Don't know why it would be happening to you in the middle of the game, though. Does the game state somehow change?


Ryan

Share this post


Link to post
Share on other sites
Nope, I just do a TargetSurface.DrawFast each frame. If I do a check for if(bitmapSurface.IsLost || TargetSurface.IsLost) and throw an exception, it gets thrown immediately when the game starts. But the bitmap distortions don't occur until about a minute into the game.

Share this post


Link to post
Share on other sites
What pool do you assign your surfaces and textures to?
If you use Pool.Default you will have to call Device.TestCooperativeLevel() each frame and reset the device and re-create all default-pool resources in case of a lost device in order to avoid such problems.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this