Home
Products
Community
Manuals
Contact
Login or Signup

Unable to Set Graphics Mode

Blitz3D Forums/Blitz3D Beginners Area/Unable to Set Graphics Mode

Jamie(Posted 1+ years ago) #1
Greetings,

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

Project/Development Specs
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.

Thanks,

Jamie


Gabriel(Posted 1+ years ago) #2
Well posting the code you use to set a graphics mode would help.


Jamie(Posted 1+ years ago) #3
Sorry about that.... here are the lines that I use for setting the graphics mode:

ClearWorld
;
.GRAPHICS_SETTINGS
Graphics3D 1024,768,32

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.


Thanks,
Jamie


Gabriel(Posted 1+ years ago) #4
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.


Jamie(Posted 1+ years ago) #5
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.

Thanks,

Jamie


Graythe(Posted 1+ years ago) #6
Jamie,

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...


jfk EO-11110(Posted 1+ years ago) #7
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
Graphics3D 1024,768,32
will run windowed in debug mode and fullscreen in non-debug mode. So use
Graphics3D 1024,768,32,1 ; (or 2, of course)


Fernhout(Posted 1+ years ago) #8
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.


Jamie(Posted 1+ years ago) #9
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.

Jamie