glfw/glfw
FreeA multi-platform library for OpenGL, OpenGL ES, Vulkan, window and input
FreeFree tier
About glfw/glfw
GLFW is an open-source, multi-platform library for developing applications with OpenGL, OpenGL ES, and Vulkan. It provides a simple, platform-independent API for creating windows, rendering contexts and surfaces, reading input (keyboard, mouse, joystick), and handling events. Written in C99 with Objective-C for macOS support, it runs on Windows 7 and later, macOS 10.11 and later, Linux (both Wayland and X11), and many other Unix-like systems. Licensed under the permissive zlib/libpng license, it includes pre-compiled binaries for Windows and macOS, and the documentation offers guides, a tutorial, and an API reference.
Key Features
Cross-platform support (Windows, macOS, Linux, Unix-like)
Simple API for window creation and management
OpenGL, OpenGL ES, and Vulkan context/surface creation
Input handling (keyboard, mouse, joystick)
Event handling (window resize, focus, etc.)
Supports Wayland and X11 on Linux
Written in C99 with Objective-C for macOS
zlib/libpng permissive license
Pros & Cons
Pros
- Free and open-source with permissive zlib/libpng license
- Simple, platform-independent API reduces development complexity
- Supports modern graphics APIs (OpenGL, OpenGL ES, Vulkan)
- Well-documented with guides and API reference
- Active community and frequent updates (15k+ stars on GitHub)
Cons
- Limited to window and input management; no GUI widgets or advanced UI features
- Basic window decorations on Wayland without libdecor package
- Requires additional libraries for higher-level graphics or audio functionality
Best For
Cross-platform graphics application developmentGame development with OpenGL or VulkanScientific visualization and simulation toolsPrototyping and educational projects for graphics programming
FAQ
What platforms does GLFW support?
GLFW supports Windows 7 and later, macOS 10.11 and later, Linux (both Wayland and X11), and many other Unix-like systems.
Is GLFW free to use?
Yes, GLFW is open-source and licensed under the permissive zlib/libpng license, allowing use in both open-source and proprietary projects.
Does GLFW support Vulkan?
Yes, GLFW supports Vulkan application development, including creating Vulkan surfaces and providing glad2 in its dependencies for loading Vulkan functions.