How to detect graphic modes

Blitz3D Forums/Blitz3D Beginners Area/How to detect graphic modes

I've never heard that checking a graphics driver for 3D-capability causes crashes.
But I've got only 1 pc at home and cannot check it on other systems.

But I've created the routine to do it (check for 3D-capability) and select the first 3D-card.

; Get the number of graphics drivers available in a user's system
GfxCardCount% = CountGfxDrivers()

; Select the first 3D-capable card
For i = 1 To GfxCardCount%
	If GfxDriver3D(i) = True Then
		SetGfxDriver i
		Exit
	EndIf
Next

; Set window for displaying the init-screen (see screenshot above)
Graphics3D 640, 480, 0, 2



Maybe it's better to let the user manually choose?



What if the user selects a card that Blitz reports as 3D-capable, and crashes if he selects it?
That would cause the same crash.

But currently, on startup of the game, the interface also checks all cards for 3D-capable modes, as the user will not be allowed to select a 2D-card for the game (because it will be entirely 3D).
The optionbutton in front of the card's name will be greyed out if it doesn't do 3D.
Then either way, the program would crash in both situations, if just checking the driver for 3D-capabilities causes a crash.