How can I check for features is if in C++ / GLEW
bool haveHardwareOcclusionQueries() { return GLEW_ARB_occlusion_query || GLEW_NV_occlusion_query; }
In this particular case, I am looking for OcclusionQuries.
It's best to create a static hashmap with all available extensions at startup:
HashSet<string> allExtensions = new HashSet<string>(GL.GetString(StringName.Extensions).Split(new char[] { ' ' }));
Then you can query for extensions:
public static bool IsSupported(string extensionName) { return allExtensions.Contains(extensionName) }
So to check if occlusion queries are supported, you would check for (IsSupported("GL_ARB_occlusion_query") || (IsSupported("GL_NV_occlusion_query"))).
(IsSupported("GL_ARB_occlusion_query") || (IsSupported("GL_NV_occlusion_query")))
Thank you very much!
Comments
Re: How to check if graphics card support a certain ...
It's best to create a static hashmap with all available extensions at startup:
HashSet<string> allExtensions = new HashSet<string>(GL.GetString(StringName.Extensions).Split(new char[] { ' ' }));Then you can query for extensions:
So to check if occlusion queries are supported, you would check for
(IsSupported("GL_ARB_occlusion_query") || (IsSupported("GL_NV_occlusion_query"))).Re: How to check if graphics card support a certain ...
Thank you very much!