SetGfxDriver fails?

Archives Forums/Blitz3D Bug Reports/SetGfxDriver fails?

_PJ_(Posted 2009) [#1]
It's hard to explain what happens here, but I notice that the SetGfxDriver command seems to fail somehow on certain occasions.

Here's an example:

I sould note, that my system DOES have 2 GPUs and the modes used in the example ARE valid graphics modes.
Both these examples, theoretically should run perfectly, the only difference is the inclusion of "CountGfxModes()" which prerhaps forces some internal checking of the adapter's modes???

Anyway:
THIS FAILS:
SetGfxDriver 2
Print GfxModeWidth(20)
SetGfxDriver 1
Print GfxModeWidth(1)


THIS SUCCEEDS:
SetGfxDriver 2
Print CountGfxModes()
Print GfxModeWidth(20)
SetGfxDriver 1
Print CountGfxModes()
Print GfxModeWidth(1)


The error happens at "GfxModeWidth" and returns "Illegal Graphics Index"


Yasha(Posted 2009) [#2]
Looks like more of an error in the documentation than the engine, actually...

GfxModeWidth(N) accesses a list created by CountGfxModes(). If you don't call CountGfxModes first for each driver, I suppose this list is never created, so obviously the index points to an invalid something or other. I would guess this is actually intended behaviour?


_PJ_(Posted 2009) [#3]
If you don't call CountGfxModes first for each driver, I suppose this list is never created, so obviously the index points to an invalid something or other.

That crtainly seems to be the case.
If it's intended that way, then fine, but if so I'll add a post to the docs.

I figured I'd mention it, though because I had a very hard time trying to figure out why I got a bug accessing what I knew were valid modes :D