GLFW is a C library that creates windows, graphics contexts, and surfaces while handling input and events. It targets OpenGL, OpenGL ES, and Vulkan on desktop and Unix-like systems.
Overview
GLFW gives C and C++ applications a small, platform-neutral API for opening windows, creating rendering contexts, reading keyboard and mouse input, and processing events. It is aimed at OpenGL, OpenGL ES, and Vulkan development rather than shipping a full game engine.
Supported operating environments include Windows, macOS, and Linux with both X11 and Wayland on Linux, plus other Unix-like systems. macOS support mixes C99 with Objective-C where required. Documentation covers tutorials, guides, and a full API reference; prebuilt Windows and macOS binaries are published alongside source releases.
Feature highlights from the project site include creating a window and context with minimal setup calls, multiple monitors and high-DPI handling, gamma ramps, keyboard and mouse and gamepad input via polling or callbacks, and access to native platform objects for specialized integrations. Language bindings are maintained by the community.
System requirements note Windows 7 and later, macOS 10.11 and later, and basic X11 support without requiring a full desktop on some Unix setups. GLFW builds with CMake using platform headers and libraries, without mandating extra graphics SDKs beyond what the OS provides.
Key features
- Windows and OpenGL or Vulkan contexts
- Keyboard, mouse, and gamepad input
- Multiple monitors and high-DPI support
- Event polling and callback handlers
- X11 and Wayland on Linux
- Native object access for platform features
- Online tutorial and API reference
- Prebuilt binaries for Windows and macOS
Use cases
- Bootstrap a desktop OpenGL application
- Prototype Vulkan rendering on multiple OSes
- Handle window resize and input in a C engine
- Embed GLFW in tools needing a GL context
- Portable Unix graphics utilities