OpenGL hardware mode

Started by
13 comments, last by Zeblar Nagrim 23 years, 10 months ago
Is there a way to know if you are in software or hardware mode in OpenGL? Of course you can see the diffrence sometimes, but I need a way to check if the user can get hardware acceleration in his computer. Zeblar Nagrim, Lord of Chaos
Advertisement
Hi!

You could use the glGetString() function to determine the GL_VENDOR string. If it''s Microsoft (or something similar), then you are running in software mode. Beware, that some people use the SGI OpenGL drivers (which are also software), but their vendor string should also be easy to include in your check. Oh, come to think of it, you can also query the GL_RENDERER string (Don''t know an example return value, though).

Hope this helps,

MK42
Please show me how you do it!

Thanks from the wizard.

Gandalf the White

Gandalf the Black
Hi!

I have never DONE it this way, but I believe that it would be possible to do it this way. Short example:


printf("GL_VENDOR: %s\n", glGetString(GL_VENDOR));
printf("GL_RENDERER: %s\n", glGetString(GL_RENDERER));


The strings, which are returned should be checked against a list of ''software'' drivers. With OpenGL32.DLL this probably returns ''Microsoft'' (or something similar) as the vendor. Just try it out and see.

Another slight problem occurs with, 3Dfx cards. Some people still don''t have full OpenGL drivers installed. I don''t know whether you bind dynamically to the DLL, or just link to OpenGL32.lib. If you bind dynamically (with LoadLibrary()), then you should also check whether to load the 3Dfx non-ICD driver. It''s called 3dfxvgl.dll or something like that. Or just let the user choose (like most games do, BTW).

Happy coding,

MK42
Sorry but I´m a beginner to the Stream I/O Routines.
Please can you show me how you store this information in a char buffer?

Gandalf the White

Gandalf the Black
Hi Gandalf!

This is actually NOT stream i/o.

You might just try this:

char buffer[256]; //a bit big, but who cares
strcpy(buffer, glGetString(GL_RENDERER));

glGetString() returns a char*, NULL-terminated string. So, no prob there.

Ciao,

MK42
I don''t know the function glGetString so I can''t comment on it but if as you say it returns a char * you should be able to :

    char *buffer;buffer = glGetString(GL_VENDOR);    

-----------------------------------------------All messages are of my own personal opinion and not meant to offend. But if they do - tough :)Neuro.
This produce the following error:

error C2664: ''strcpy'' : cannot convert parameter 2 from ''const unsigned char *'' to ''const char *''

Strange!

Gandalf the White

Gandalf the Black
OOPS!

Then make it:

unsigned char buffer[256];

I think that''ll work. Neuro''s way should also work (again, a cast might be needed) like:

buffer = (char*) glGetString(GL_VENDOR);

It IS returning a string ... you just have to coerce VC++ a bit to interpret it correctly.

Take care,

MK42
It doesn´t. I can a little bit C++ me too...

Gandalf the White

Gandalf the Black

This topic is closed to new replies.

Advertisement