Image Corruption?
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
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
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
Actually, I think it gets paged out of memory. I don't know how to fix that though. Any ideas?
Rajiv
Rajiv
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement