3

i'm currently working on a simple editor for my game engine project, while the project seems to run just fine on my main workstation ( GTX 650Ti with OpenGL 3.3+ support ) , but it'seems to be broken when im test it on my testing desktop ( GMA4500 with OpenGL 2.1 max support ).

The GtkGLArea's gtk_gl_area_make_current() unable to create OpenGL 2.1 context even if i specified the GL version with gtk_gl_area_set_required_version() to 2.1.

Tried to troubleshoot it with testing the gtk glarea demo ( https://git.gnome.org/browse/gtk+/tree/demos/gtk-demo/glarea.c ) and getting the same result.

Already search it on the web but none lead to any solution. Though someone have mention the same exatct issue on glarea example from ebassi (https://github.com/ebassi/glarea-example/issues/2)

Is there any solution to this?

Operating System: Fedora 23 GTK version 3.18


EDIT : The Operating system (Fedora 23) are using OpenGL 2.1 ( checked with glxinfo ), and considering by demos given on GTK+ source i'm assuming GTK using GL 3.0+ as default. is it any way to overide this? (according to ebassi on his answer below, starting from GTK+ 3.20 GdkGLContext will falling back to legacy profiles if core profiles are not available. will test it as soon i upgrade to GTK+ 3.20)

EDIT 2: I'm able to make workaround by using context created by SDL instead of GdkGLContext, but i'm still intrested to make GdkGLContext to work with OpenGL 2.1.

  • This question probably doesn't belong on SO because it sounds more like an OS problem, but have you tried running `glxinfo`? It should tell you what version your OS is actually using. Also, could you be more specific about the exact error, behavior, response, etc. – oldtechaa Jun 19 '16 at 23:23
  • The OS is using OGL 2.1, default context creation are running just fine on other lib (glfw, wxWidget and qt). So i dont think it was issue caused by the os. – Rizkie Yudha Pratama Jun 20 '16 at 08:09
  • Well, if it's not an OS problem, we'll need to know the exact behavior. – oldtechaa Jun 20 '16 at 13:04

2 Answers2

4

GTK+ tries to created an OpenGL 3.2+ core profile context by default.

Starting from GTK+ 3.20, GdkGLContext will attempt at falling back to legacy profiles if core profiles are not available. You can check whether a GdkGLContext is in legacy mode by using gdk_gl_context_is_legacy().

You are not allowed to select a legacy context by yourself, because it's not possible to share core profiles with legacy ones, and GDK creates GL contexts internally for drawing.

ebassi
  • 8,648
  • 27
  • 29
0

You can use EGL to use legacy (pre-3.0) OpenGL versions with GtkDrawingArea

http://bobthegnome.blogspot.com/2014/09/using-egl-with-gtk.html

frang
  • 69
  • 5