gkv311 / occt-samples-gtk

Open CASCADE Technology sample - 3D Viewer within GTK window
Other
13 stars 5 forks source link

Request: OCCT viewer created from a handle of a pre-existing GTK:Widget #8

Open avimdev opened 1 year ago

avimdev commented 1 year ago

According to what you wrote on your blog: https://unlimited3d.wordpress.com/2021/07/29/occt-viewer-and-gtk/ :

"There are two basic approaches for embedding OpenGL-based viewer into GUI framework:

    1. Ask OCCT to create OpenGL context for a native window taken from a normal widget or entire window.
    2. Wrap existing OpenGL context created by GUI library itself via special widget, like Gtk::GLArea in case of GTK".

Back in GTK+2, to create an OCCT viewer the first approach was simply: make a Gtk:DrawableArea, get its handle, and pass it to V3d_View::SetWindow. This approach no longer works in GTK+3 and GTK+4, at least following those simple steps.

Would it be possible to create a sample of a minimal OCCT viewer following the first approach, using GTK+4? And also for a Windows platform? It would be immensely useful given the general lack of documentation/samples of this kind on the web. Thank you.