Adrien Clerc
Adrien Clerc

Reputation: 2797

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".

Upvotes: 25

Views: 4796

Answers (1)

Geoff Reedy
Geoff Reedy

Reputation: 36011

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.

Upvotes: 8

Related Questions