GtkRadiant icon indicating copy to clipboard operation
GtkRadiant copied to clipboard

[enhancement] Switch to GtkGLArea

Open ghost opened this issue 9 years ago • 8 comments

With Gtk+3.16 there is a new GL render widget available, thus making the use of the old GtkGLExt library not needed.

Some preprocessor checks cloud be used determine what widget should be used. One great thing about this is that it works on any platform that GDK can provide a GL context to (Wayland, Mir and so on).

C: https://developer.gnome.org/gtk3/stable/GtkGLArea.html C++ (Gtkmm): https://developer.gnome.org/gtkmm/stable/classGtk_1_1GLArea.html

example: https://github.com/ebassi/glarea-example

GDK: https://developer.gnome.org/gdk3/unstable/GdkGLContext.html

Just a thought...

ghost avatar Oct 02 '16 14:10 ghost

Yes, this has come up before. We are still using gtk2 at this time, @Pan7 has done some work towards upgrading us to gtk3, which would be a prerequisite as I understand.

TTimo avatar Oct 02 '16 14:10 TTimo

There is GtkGLArea support in the gtk3 branch https://github.com/TTimo/GtkRadiant/blob/gtk3/radiant/glwidget.cpp#L40 But GtkGLArea didn't support opengl 1, does it now?

Pan7 avatar Oct 03 '16 19:10 Pan7

I don't see any indication that GtkGLArea would only support some newer OpenGL versions, and not the old fixed function paths that we are using.

TTimo avatar Mar 26 '17 16:03 TTimo

Was not able to use it with OpenGL1 when i tested it.

Pan7 avatar Mar 26 '17 17:03 Pan7

https://developer.gnome.org/gdk3/stable/GdkGLContext.html#gdk-gl-context-is-legacy Can't force gtkglarea to use OpenGL 1 (via gtk_gl_area_set_required_version).

Pan7 avatar Mar 27 '17 13:03 Pan7

The doc states that GdkGLContext attempts to create a 3.2 core profile by default, but can fallback to legacy when that's not possible. If gtk_gl_area_set_required_version doesn't work that could be a bug or a problem in setup, but it sounds possible to setup as GL 1.2 fixed function

TTimo avatar Apr 15 '17 18:04 TTimo

Can't, see http://stackoverflow.com/questions/37909072/gtkglarea-unable-to-create-opengl-2-1-context

Pan7 avatar Apr 15 '17 20:04 Pan7

"GDK creates GL contexts internally for drawing." - alright that's be why .. guess we could look at upgrading the rendering to VBOs and all .. fun project???

Sent from my iPhone

On Apr 15, 2017, at 15:27, Pan7 [email protected] wrote:

Can't, see http://stackoverflow.com/questions/37909072/gtkglarea-unable-to-create-opengl-2-1-context

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

TTimo avatar Apr 15 '17 22:04 TTimo