3 ms·
For those who wonder what GLFW is... if you want to play with OpenGL or Vulkan, make a graphics demo, or make a game, GLFW is a library that frees you from havi
by klodolph 8y ago
For those who wonder what GLFW is... if you want to play with OpenGL or Vulkan, make a graphics demo, or make a game, GLFW is a library that frees you from having to deal with the nuances of Win32/X11/etc, wrangles keyboard inputs and other things across platforms.
It is similar to LibSDL, but is more lightweight and GPU-centric. GLFW is designed more with greenfield projects in mind, whereas LibSDL was designed from the beginning to help with porting existing code. (They are both excellent libraries.)
- childintime 8y agoI got to know of glfw because a few GUI libs which embed Flutter (in Rust or Go) use it. Maybe it's just a hyperbole, but will this release help those efforts?
- kbenson 8y agoSo, it's sort of like GLUT was? (is?) I only messed around with 3D rendering a little back in the very early 2000's, but from what I remember, GLUT made everything much easier.
- electricslpnsld 8y agoI mainly see GLFW used as a modern, if somewhat more bare bones (no font rendering, no event loop, etc), variant of GLUT.
- skocznymroczny 8y agoYes, it's kind of like GLUT, although it covers fewer functionalities. It focuses only on abstracting the OS specific parts like keyboard/mouse input and window/graphics context creation. GLUT also offered things like rendering fonts, teapots and additional functionalities.
- Crinus 8y ago"is", as long as you consider FreeGLUT as being GLUT.
- klodolph 8y agoI would say that any time you are using GLUT for new projects, you really should be using GLFW or LibSDL instead.
- muterad_murilax 8y agoWhat does the FW in GLFW stand for?
- kirke 8y agoGLFrameWork
- iamcreasy 8y agoHow does GLFW compare to SFML? Edit: upon initial inspection it appears SFML is similar to SDL, which provides support for other features such has networking, audio etc.
- floatboth 8y agoSFML is much "fatter", it handles graphics and even audio and networking.
- klodolph 8y agoGLFW, SDL, and SFML are on a scale from "lightweight" to "heavyweight". SFML is, by far, the largest, heaviest, and most opinionated of the three. GLFW is not much more than platform abstraction for multimedia (windows, input, OpenGL/Vulkan context creation, timing). Notably it is missing any kind of audio support, but you probably want to ues FMOD, Wwise, or iirKlang anyway. SDL is all of that, plus various utilities for porting and some platform abstractions that are no longer needed. For example, logging, assertions, blitting, endian conversion, file abstraction, threads and atomics. There are a few associated helper libraries designed to work with SDL, like SDL_image, SDL_ttf, and SDL_mixer. These are optional. SFML is all of that, plus the interface is written in C++, there's all sorts of things like sprite drawing, texture loading, and audio systems mixed in, plus a bunch of extra random functionality like HTTP clients, OpenGL wrappers, etc. SDL is the oldest of the three. My perspective is that if you look at SDL and think, "Wow, this does a lot of stuff that is kind of weird and old, maybe I don't need all of that", then you would invent GLFW. If you looked at SDL and thought, "I want something bigger, more, more, more, with a C++ interface, consume the world!" Then you would invent SFML. I have some strong opinions here, which are probably coming across. I see developers who say, "I want to make games, that means low-level, so I'm going to learn Win32," and I try to prevent them from wasting time learning APIs, steering them towards one of these libraries. On the other hand, I think SFML is a big mess that tries to do everything, and it's a lesson in why it's easy to make bad C++ APIs. I mean, jeez, it has "class RectangleShape" which inherits from "Shape" which inherits from "Drawable". It makes me want to puke.
- iamcreasy 8y ago