Unable to Set Graphics ModeBlitz3D Forums/Blitz3D Beginners Area/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):
nVidia GeForce 6200A 512MB
P4 3.2 GHz
1.5 GB RAM
Windows XP Pro SP2
Blitz3D IDE V1.90 Linker V1.84 Runtime V1.90
Protean IDE V 1.4 Build 1884 Revision 26595
Project Running at 1024 x 768 32-bit color
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.
| Well posting the code you use to set a graphics mode would help. |
| Sorry about that.... here are the lines that I use for setting the graphics mode:|
Before these lines I have a number of types, variables, and functions defined, but this is the only Graphics or Graphics3d call in the entire project.
| I'm not sure if ClearWorld should be called before Graphics3d is called. |
Anyway, try changing to Graphics3d 1024,768,0
That should pick the bit depth automatically, according to what is available.
The only other thing I can think of which might cause a problem is if you're already running a program which has a D3D window open. They don't seem to like having two open at once.
| 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:
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.
A shot in the dark...
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.
I hope it helps...
| I'd try:|
Remove the Clearworld, especially if you really didn't call Graphics3D before!
Then: explicitely define if it should be windowed or fullscreen. Your command
will run windowed in debug mode and fullscreen in non-debug mode. So use
Graphics3D 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.|