Unable to Set Graphics Mode

I have been working on a project for some time now and periodically I will receive the Unable to Set Graphics Mode message when starting my project (but only if compiled). This happens on 3 or 4 PCs and appears to be somewhat random. Below is sample specs for one of the PCs (the development PC):

I have not tried the newest GeForce drivers, but at least two of the PCs that exhibit this are using different driver versions. All PCs that I have tried this on are running Windows XP Pro SP2

I realize that no one can "tell me whats wrong", but I was hoping for some direction to begin troubleshooting. Obviously this is very frustrating and limits my ability to distribute my project. Any help would be greatly appreciated.

I will remove the ClearWorld call and change the Graphics3D line to let it choose the highest available.

It does appear that this problem occurs usually after I have ran the project numerous times. I wonder if something is not truely getting unloaded and there is a D3D window open somewhere, eventhough it is not visible?!? Right now when I want to exit my program I make the following calls after freeing all of the sounds, textures, etc:

ClearWorld EndGraphics End

I am going through and making sure I have freed all items before I make these calls; but if any ideas while I check through that would be appreciated.

If you are using writepixelfast or readpixelfast then examine these routines for possible bounds errors. If there is doubt then construct another set of almost identical routines but using readpixel and writepixel which will not write out of bounds even if instructed to. Naturally, if the problem endures then it's not an out of frame write.

A good tool to check running processes is Winsonar (do a google search) which is free.

Then: explicitely define if it should be windowed or fullscreen. Your commandGraphics3D 1024,768,32will run windowed in debug mode and fullscreen in non-debug mode. So useGraphics3D 1024,768,32,1 ; (or 2, of course)

I am a beginner in Blitz 3D but i know a bit more about Windows. and for me the problem is not Blitz but windows. Specialy Combination windows and Graphics card. You say this wil happens after you opend you program a couple of times. Windows don't like to reserve and free up memory to the same program again and again. There will be a memory fragmentation between windows and the graphics card. Normaly you get a warning can't created memblock. But if the fragmentation is to high your color depth wil not work anymore. Your program gets a error back and reports that it cant create the graphics mode you requested. You can test this by simple restart windows. Its clear out the memory. If you application starts after a restart windows then this is the problem. If the problem stil exist after a restart then the problem is not windows, and i can't help you either.

Thanks to all that have posted. I have performed some of the fixes/tests described above. Before making the code changes, I found that if my program gets the unable to set graphics mode error, I can either restart and it works fine or I can re-reun the program and it appears to work fine. I will let you know if the aobve code changes have made any differences.

It seems that you can use any width height in windowed mode but you have to use one of the available resolution in fullscreen mode.Here is an example on how to get the available resolutions where the width is superior to the height and height/width >= 0.5 and width/height <=2 and the colors depth is 32bits