GetCurrentDriver() ?

BlitzMax Forums/BlitzMax Programming/GetCurrentDriver() ?

Jake L.(Posted 2006) [#1]
Hi,

anyone knows how to detect which driver is active?
My problem is that I have to use glDrawText when using glGraphics() instead of Graphics(), so I need to detect it, right?

Or is there a smarter solution? Can I force my app to run with OpenGL with using Graphics() (and will DrawText work in this case) ?


Yan(Posted 2006) [#2]
If TGLMax2DDriver(_max2dDriver) then Print "I'm using GL"
I'm a bit confused as to what you're trying to do though.
SetGraphicsDriver GLMax2DDriver()
??

OR, are you trying to use raw GL?


Jake L.(Posted 2006) [#3]
Most time I'm using my own system (pure GL), so I'm initializing graphics with glgraphics ().

I've written a debug/profiler-mod which outputs to the screen and I want to keep this working with every app (no matter if it uses max2d/rawgl). So somehow I have to detect if the main-app is using max2d (then I can use DrawText) or RawGL (then I would use glDrawText) - or is there a "global" DrawText-function that works with every mode?

Hopefully this clearifies my problem.


Dreamora(Posted 2006) [#4]
DrawText is global as long as people don't break with Max2D.

But if you do a profiler, are you even supporting DX?
If not, then the GLDrawtext function should be enough as it will work in manually initialized GL windows as well as Graphics with GL driver


Yan(Posted 2006) [#5]
Ahh...Right, then perhaps something this would be okay?...
Function DrawTextAll(str$, x, y)
  If TD3D7Max2DDriver(_max2dDriver)
    DrawText str$, x, y
  else
    GLDrawtext str$, x, y
  endif
end function



Jake L.(Posted 2006) [#6]
Thanks, thats exactly what I looked for.