Background: I want to write a CAD application. I want to implement all rendering with Vulkan. And I want to use GTK+.
I don't want a (visible) different window for the rendered image of the object.
So I researched and found the GtkGLArea widget, which seems to do what I want, but for OpenGL.
Is there an equivalent to GTKGLArea? If not, is there another way to implement what I'm thinking of?
GTK can use Vulkan to render its contents (even though the Vulkan renderer is considered experimental), but you don't have access to the Vulkan pipeline from outside GTK itself.
GtkGLArea is a widget that allows drawing with OpenGL. GtkGLArea sets up its own GdkGLContext , and creates a custom GL framebuffer that the widget will do GL rendering onto.
There is a GdkWindow which I believe is behind many Gtk graphic types such as GtkWindow and GtkWidget and obtainable with gtk_*_get_window(). GdkWindow has gdk_window_create_vulkan_context(). With GdkVulkanContext you can get raw Vulkan types and theoretically should be able to render to with Vulkan.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With