|
Query GFX_* driver at runtime. |
brigham toskin
Member #2,213
April 2002
|
I'm trying to query which driver is loaded by allegro when you use a magic card like GFX_AUTODETECT_FULLSCREEN. I've been searching the the manual, the forums and google to no avail for a couple days now, so I guess you could call that due dilligence before asking here. The only way I can figure to do it is search the sources and try to access whatever internal structure allegro stores such information in, but my friend assures me that there's a nicer way to do this--he just doesn't remember what it is. It seems like this must be a very common thing. I mean, the ability to tailor your graphics effects to the card you have seems braindead-obvious. I mean, I know how to query certain capabilities of the driver, but not exactly whih one it is. Anyone got this one? --- |
Thomas Fjellstrom
Member #476
June 2000
|
While its not recomended that you use internal structures and especially the member variables of allegro types, you can access the driver id, ex: gfx_driver->id. First three items in the GFX_DRIVER struct are: int id; AL_CONST char *name; AL_CONST char *desc; AL_CONST char *ascii_name;
-- |
kazzmir
Member #1,786
December 2001
|
Quote: I mean, I know how to query certain capabilities of the driver, but not exactly whih one it is. Do you really want to know what the underlying graphics driver is or do you mean asking Allegro what extra capabilities it supports such as hardware accelerated blitting? If the latter case you can use gfx_capabilities to determine this. if ( gfx_capabilities & GFX_HW_VRAM_BLIT ){ ... } If the former what would you do with that information anyway? Do you really want to optimize your program for a certain OS? |
brigham toskin
Member #2,213
April 2002
|
I want to be able to know exactly which graphic driver its using because this is actually going to be part of the logged output for a quick n dirty benchmark rig I whipped up. I'm trying to get an idea of how well various rendering methods perform on different machines, and the performance numbers are less meaningful if I don't know the graphics driver. --- |
Kitty Cat
Member #2,815
October 2002
|
After setting the graphics mode, use gfx_driver->name to tell which driver was selected. gfx_driver->desc could be useful, too. -- |
Evert
Member #794
November 2000
|
Quote: I'm trying to query which driver is loaded by allegro when you use a magic card like GFX_AUTODETECT_FULLSCREEN.
You typically shouldn't care and don't need to know. If for some reason you do need to know, others have already posted the information. That said, you can normally assume the following: |
brigham toskin
Member #2,213
April 2002
|
I mostly just need to know so I can give some context to the results I receive from the graphical tests I'm running, e.g. how well does rotate_sprite() perform with the test data using ddraw_accel vs. gdi on an older machine? --- |
Tobias Dammers
Member #2,604
August 2002
|
If you want to compare gfx driver performance, then why not set the desired drivers explicitly? You can always skip the test for drivers that fail. --- |
|