6

I want to upgrade my scientific 3D application from Freeglut to GLFW, but I worried about hidden conflicts or loss of data, Actually my application works like a charm with Freeglut and I don't have any problem, but GLFW is recommended for modern OpenGL(3.0+) in all modern books and tutorials.

I look at GLFW API and It looks like Glut with glfw* prefix, but I'm not exactly sure. so I have three questions in mind:

  1. Is it worth to break my existing project for GLFW sake, or stick to freeglut?
  2. Am I going to loss any feature from glut?
  3. Is GLFW compatible with GTK+? (because my GUI is based on GTK)
Waqar
  • 8,558
  • 4
  • 35
  • 43
xxx
  • 554
  • 8
  • 17

1 Answers1

3

3- Is GLFW compatible with GTK+? (because my GUI is based on GTK)

Using GTK+ you should neither use Free-/GLUT nor GLFW. GTK+ has a OpenGL widget and does all the event management. Use that.

nbanic
  • 1,270
  • 1
  • 8
  • 11
datenwolf
  • 159,371
  • 13
  • 185
  • 298
  • @Ndv Just keep in mind that GLFW (like freeglut) is just **a GUI library** (like GTK+), **that doesn't have anything to do with OpenGL**. – Christian Rau Jan 17 '12 at 15:51
  • 2
    @Ndv So if you like to handle it your own, you won't get around managing the OpenGL context yourself using the platform's own API (wgl for win, glX for nix). Otherwise there is no argument for GLFW/GLUT but against GTK+, as both are just wrappers to the platform specific OpenGL and GUI managament, making them nothing more than **GUI libraries with support for OpenGL context management**. In this regard GLFW/GLUT and GTK+ are on the exact same abstraction level. Again: **GLFW/GLUT doesn't belong or have anything to do with OpenGL**, not more than GTK+ has. – Christian Rau Jan 17 '12 at 16:06
  • @Ndv: I can only agree with Christian Rau; *GLUT and GLFW are not low level.* You want to see low level? Then have a look at https://github.com/datenwolf/codesamples/tree/master/samples/OpenGL/x11argb_opengl – datenwolf Jan 17 '12 at 16:09
  • @Ndv Well, functions for context and window and input management does it make a GUI library. That easy. If you don't want to write a system based on GUI libraries (which is a good idea), then just seperate concerns. You have to do this the same for GTK+ like for GLUT/GLFW, since **GLUT/GLFW doesn't have anything to do with OpenGL**. Sorry for repeating but this is a crucial fact people often forget. So write your system in terms of OpenGL and not GLFW/GLUT/GTK+. – Christian Rau Jan 17 '12 at 16:09
  • @Ndv Well, prove the opposite. Then I might again have something to say. But until that there is really nothing more to say than **GLUT/GLFW doesn't hav...**, well I guess you finally got it. – Christian Rau Jan 17 '12 at 16:13
  • 1
    @Ndv Ok, sorry then. The answer to the third question is just **no**. Both are completely different libraries doing the same thing. The only way to make your code work with both is not depending on either library. Creating a context with GLFW for a GTK+ window will surely not work. GLFW (like GLUT) is as incompatible to GTK+ as Qt or MFC is. Nobody would ever try to mix them in one project and if your code/library is to be used with both, then don't depend on them. I don't see why this is a flame. I don't take sides. The opposite, I want to clarify that they're all equal and cannot be mixed. – Christian Rau Jan 17 '12 at 16:20