Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to have an OpenGL context inside a GTK3 application?

I had a look at GtkGlExt, but it's only for GTK2. Unfortunately, after some hours of searching, it seems that no one take care of having something like an OpenGLDrawingArea…

Any information will be welcomed. Even if it's like "it's not possible for now".

like image 779
Adrien Clerc Avatar asked Aug 22 '12 15:08

Adrien Clerc


1 Answers

It looks like you have a few options here.

  1. Use an in-development port of gtkglext to gtk3
  2. Use SDL to draw into your GTK app by setting the SDL_WINDOWID environment variable
  3. Manage GLX yourself to create an OpenGL context for your GTK app.

I found a app spectrum3d which implements both of the first two alternatives.

The third option will be quite complex and is probably not worth pursuing.

like image 53
Geoff Reedy Avatar answered Nov 05 '22 10:11

Geoff Reedy