What is the difference between FreeGLUT vs GLFW?

37,870

FreeGLUT:

  • Based on the GLUT API.
  • GLUT has been around for about as long as OpenGL itself.
  • Many tutorials and examples out there use GLUT.
  • Takes care of implementing the event loop and works through callbacks (good for simple stuff, makes things like precisely timed animation loops and low latency input much harder though).

GLFW:

  • Designed from scratch with the experiences of other frameworks in mind.
  • Gives much finer control over context creation and window attributes.
  • GLFW-2 Provides basic threading support functions (thread creation, synchronization). –– removed from GLFW-3
  • GLFW-2 Provides basic image file loading support. –– removed from GLFW-3
  • Gives very detailed access to input devices.
  • Event loop is in control of the programmer which allows for much preciser timing and lower latency.
Share:
37,870
varun
Author by

varun

Updated on July 09, 2022

Comments

  • varun
    varun almost 2 years

    My university started teaching a course which includes OpenGL programming. They make us use FreeGLUT to create a window and a context for OpenGL, but I found an online course at lynda.com about OpenGL in which they use GLFW instead of FreeGLUT.

    So I want to know which one should I use and what are the differences between the two?

  • varun
    varun over 9 years
    So glfw is better if one is going for a conplex applications ?
  • Iggy
    Iggy over 9 years
    It's important to note that GLFW3 no longer has threading or image loading functionality. It's being kept as a simple library for creating windows with OpenGL contexts.
  • derhass
    derhass over 9 years
    One should also note that freeglut goes beyond the GLUT API and implements own extensions which also allow more control over context and window attributes, and also allows the user to write the event loop, like it is the case with GLFW.
  • user5280911
    user5280911 almost 6 years
    For me, GLUT and freeglut does not work with Nsight (maybe someone can work around this using some special means, but I don't have the interest and time to hack it). So if you wanna use Nsight to debug GLSL code, choose GLFW 3. PS: I'm on Windows and Quadro card; I know someone hates it.