Archived

This topic is now archived and is closed to further replies.

steve coward

Help! How to debug video memory issue?

Recommended Posts

I am seeing some weird behavior in my application that I have been developing. As I create my direct draw surfaces from bitmap files during initialization, the rendering of certain buttons in my MSVC++ program and on my task bar turn solid orange, which is the background color of my sprites. It happens upon executing this code: if ((hr = pdds->GetDC(&hdc)) == DD_OK) { StretchBlt(hdc, 0, 0, ddsd.dwWidth, ddsd.dwHeight, hdcImage, x, y, dx, dy, SRCCOPY); pdds->ReleaseDC(hdc); } I check available video memory querying DDCAPS structure and it reports that I still have 5 Mb of original 32 Mb free after all bit maps have been loaded. My program runs in Windows mode and is a 2D iso based rts game using direct draw. Changing the order that the bitmaps are loaded causes the color anomaly to occur duiring a different bitmap load. Reducing the number or size of bitmaps loaded eliminates the behavior (but remember that even when all bitmaps are loaded DDCAPS structure claims significant amount of free video memory exists). Also as I play with my program after initialization and loading in a game map, simply panning around the map seems to cause certain data structures within my game database to quietly become corrupted. I am using many small CRgns for various purposes. Hit testing using these CRgns changes as I pan around the screen. I am not sure if this is related to the previous issue. I assume it is because both problems seem to have appeared at the same time. All of this code was working fine very recently. I added a second hard drive to my computer a few days ago and I think my program was not displaying this problem prior to that. Could this somehow be the source of my problem? Does anyone have any idea how I can debug this problem - or better yet, does anybody know what is wrong? thanks in advance for any advice you are willing to give me, steve coward

Share this post


Link to post
Share on other sites