Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the Vulkan equivalent of the GtkGLArea widget (GTK+)?

Tags:

gtk

vulkan

gtk3

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?

like image 252
le_me Avatar asked Jul 19 '17 12:07

le_me


People also ask

Does GTK use Vulkan?

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.

Does gtk support OpenGL?

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.


1 Answers

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.

like image 77
krOoze Avatar answered Sep 24 '22 01:09

krOoze