If DX9 isn't found is DX7 used

BlitzMax Forums/BlitzMax Programming/If DX9 isn't found is DX7 used

Grey Alien(Posted 2011) [#1]
Now that DX9 is default for BMax, if it isn't found on a user's system (say a pre-XP SP2 system), then does BMax default to DX7 instead? And is there an easy way to check which one is running? Thanks for any answers.


GfK(Posted 2011) [#2]
I half typed a reply to this... then thought about it... and now I'm curious too. I.e. will the whole thing blow up if I don't import DX7 as a precaution?

I'll sit here and wait for replies.


Zeke(Posted 2011) [#3]
Print GetGraphicsDriver().ToString()


Grey Alien(Posted 2011) [#4]
Good command thanks Zeke.

Now to find out what Blitz does if DX9 can't be found we either need to: test it ourselves on an old rig (I don't have one), or investigate the source (I find it hard to understand), or rely on the kindness of more knowledgeable forum members.


SLotman(Posted 2011) [#5]
I do it manually: first I get what OS I'm running: Linux and Mac OSX obviously sets OpenGL and that's it.

If I'm on Windows, then I check Direct-X version string in the registry. If DX is lower than 7, I set OpenGL. If lower than 9, I set DX7.

After that, I see if Windows is pre-98 (you can have dx9 installed on Windows 98 - I had a system with it), or if I have a desktop in 16bpp (hence, a very old video card being used) I automatically set DX7.

It works very well so far :)


GfK(Posted 2011) [#6]
I think skidracer once told me something like:
If Not D3D9Max2DDriver()
  SetGraphicsDriver(D3D7Max2DDriver())
EndIf

After that, I see if Windows is pre-98 (you can have dx9 installed on Windows 98 - I had a system with it
Blitzmax apps don't support unicode under Windows 98 (since about 1.33) which pretty much knackers you.


Grey Alien(Posted 2011) [#7]
Thanks SLotman. Yeah maybe I need to do it manually then it it's not automatic. Easy enough, I just didn't want to do it if it was already happening internally.