6
$\begingroup$

I'm building an engine, which has Vulkan for its primary rendering engine. But to have at least some backwards compatibility with devices that don't have drivers for it (mainly mobile) I want to implement an OpenGL fallback. Now, how do I check what API's are available in the current system?

I want to check if Vulkan support exists, if not then if OpenGL support exists and if not that then crash.

$\endgroup$
3
$\begingroup$

Basic Vulkan availability can be checked by the presence of the loader dynamic library. This will reside in a standard place where you can load it with dlopen or LoadLibrary.

If it fails to load then vulkan is not installed. If it does load then you can get the vkGetInstanceProcAddr function pointer from it with dlsymor GetProcAddress. After that you can query the devices as normal and decide whether or not it's sufficient to support your app.

$\endgroup$
0
$\begingroup$

If i remember correctly i have read somewhere that all the graphic cards that supports OpenGL version 3.0 and on, will support Vulkan, just new drivers are required. You can get the OpenGL version with glGetString(GL_VERSION), read here and here.

Anyway i don't think comparing strings is a good way, i am sure there would be a better way of doing this and somebody will point it out nor i know if this will work.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.