Graphic Drivers

BlitzMax Forums/BlitzMax Beginners Area/Graphic Drivers

I have this problem in my game that some people are not able to run it - either people without video drivers, directx, or old pcs...

Whenever that happens, the game just closes. Is there anyway I can make it display an error saying why it crashed? Saying what exactly the user needs? Or is there a way to make it select a different driver if the default one is not available?

Thanks in advance.

Check "Graphics" or "SetGraphicsDriver" in the helpfile, under "modules" and "graphics".

Yes, I know how to set the different graphics, but I don't know how to give an error message or automatically change to another if the currently selected one is not supported.

OpenGL will try to fallback to DX on its own

If you want to try - catch you have to create the TGraphics object within a try catch block as it will throw an exception if it fails

This will display "Graphics mode not supported" when I have directx disabled.
SetGraphicsDriver D3D7Max2DDriver()
Local CurrentGraphics:TGraphics = Graphics(800,600,32)

If CurrentGraphics = Null
	Print "Graphics mode not supported"
	End
Else
	Print "Graphics mode supported"
End If

While Not KeyHit(KEY_ESCAPE)
	Cls
	DrawRect 10,10,300,300
	Flip
Wend


Thank you TomToad this will do nicely :D