Image Corruption?

Started by
5 comments, last by rajivtm 19 years, 6 months ago
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
Advertisement
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
--Visit the Game Programming Wiki!
Actually, I think it gets paged out of memory. I don't know how to fix that though. Any ideas?

Rajiv
Are you accidently re-creating new image textures each frame?
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.
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.
I don't specifically assign them to a pool. Does it automatically put them in Pool.Default?

This topic is closed to new replies.

Advertisement