Is it possible to hack GTK to render to OpenGL texture
I'm writing an OpenGL game, and want native looking GUI elements. I was wondering if anyone has successfully hacked GTK+ using GtkOffscreenWindow
and gtk_offscreen_window_get_pixbuf
to render to an OpenGL texture, and whether this would have reasonable performance, considering repeated re-upl开发者_高级运维oading of texture data every time the GUI is updated
While this is certainly possible, I'd instead use a real OpenGL widget toolkit like Clutter. If you want to render GTK+ with OpenGL, I'd start by creating a new GDK backend (X11/OpenGL or something like that), that (re-)implements all the GDK drawing functions using OpenGL. A nice side effect would be, that all GTK+ windows would allow for ordinary OpenGL rendering, too, i.e. no more need for a GtkGLWidget class.
精彩评论