As the title says it, in this snippet I will show you how to check if the user's graphics card is OpenGL accelerated or not. Doing this is not very difficult. If the card is not accelerated you could for example close the application or warn the user that he/she will probably run into problems. It might also be useful while debugging. This function only works under Windows.
I will create a function that checks whether the card is Hardware accelerated or not. The function is called IsCardAccelerated().. very original, eh? The basic idea is the following: we will enumerate all available pixel formats and then we will check if they are GL accelerated and return true if yes, otherwise false. Here's the code:
Simply copy this function in your code and you will be able to see whether the user has a good, OpenGL accelerated card or a 7 years-old one with good old EGA graphics :-). As I said before, we simply enumerate all pixel formats of our Device Context and check whether it is accelerated or not. If yes, we immediately return true as the card has at least one accelerated pixel format.
That's all. I hope this function will be useful for you. If you have suggestions, comments or you've found a bug, m@il me. Happy Coding!