Open mqxf opened 1 year ago
Yes that would indeed be nice. However, currently the Vulkan backend doesn't support all features (some texture formats are missing, etc.). So for now, using OpenGL is probably the better option in any case. But once I come around improving the Vulkan backend I will integrate something like that.
You could easily go with something like this is your Main
s:
val ctx = try {
createContext {
assetsBaseDir = assetsDir
renderBackend = Lwjgl3Context.Backend.VULKAN
this.title = title
}
} catch (e: java.lang.Exception) {
createContext {
localAssetPath = assetsDir
renderBackend = Lwjgl3Context.Backend.OPEN_GL
this.title = title
}
}
It is basically an option you can put onto the
createContext()
function, which sets the default rendering engine to vulkan, however, if the setup fails, for example if the GPU doesn't support vulkan, it reverts the rendering engine to OpenGL and creates a new context, closing the second one. That way the GPUs that can support vulkan will have vulkan, and those that cannot will be automatically switched to OpenGL.Potential name would be a boolean called "autoRevert"