# glfw/glfw

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/glfw-glfw).**

14,716 stars · 5,806 forks · C · zlib

## Links

- GitHub: https://github.com/glfw/glfw
- Homepage: https://www.glfw.org
- awesome-repositories: https://awesome-repositories.com/repository/glfw-glfw.md

## Topics

`c` `linux` `macos` `opengl` `opengl-es` `unix` `vulkan` `windows`

## Description

This project is a cross-platform library designed for desktop application development, providing a unified interface for window management, input handling, and hardware-accelerated graphics. It serves as a foundational framework that abstracts platform-specific windowing protocols and graphics APIs, enabling developers to create interactive software that functions consistently across Windows, macOS, and Linux.

The library distinguishes itself by providing deep integration with low-level graphics APIs, specifically OpenGL and Vulkan. It manages the complexities of graphics context initialization, hardware extension discovery, and frame synchronization, while offering a modular backend that maps unified commands to native system calls. By encapsulating native operating system objects within platform-agnostic handles, it allows for consistent resource management without sacrificing the ability to access underlying system-specific features when necessary.

Beyond its core graphics capabilities, the project includes comprehensive systems for managing user interactions and display environments. It supports advanced input processing for keyboards, mice, and gamepads, alongside utilities for clipboard access, cursor customization, and file drop handling. The display management layer provides granular control over multi-monitor configurations, including resolution, refresh rates, gamma correction, and high-DPI scaling, ensuring that applications can adapt to diverse hardware setups.

The library is implemented in C and provides a stable, event-driven architecture that relies on polling loops and callback mechanisms to maintain application responsiveness. It includes robust support for library lifecycle management, custom memory allocation, and high-resolution timing, and is distributed with extensive documentation to assist in integrating its native handles with other system-level APIs.

## Tags

### Operating Systems & Systems Programming

- [Cross-Platform Windowing Abstractions](https://awesome-repositories.com/f/operating-systems-systems-programming/desktop-environment-frameworks/desktop-environment-components/window-management-systems/cross-platform-windowing-abstractions.md) — Provides a unified cross-platform interface for window management, graphics context creation, and input handling.
- [Desktop Application Development](https://awesome-repositories.com/f/operating-systems-systems-programming/desktop-environment-frameworks/desktop-environment-components/desktop-application-development.md) — Serves as a foundational framework for building interactive desktop applications with system-level access.
- [Graphics Context Initializers](https://awesome-repositories.com/f/operating-systems-systems-programming/desktop-environment-frameworks/desktop-environment-components/window-management-systems/graphics-context-initializers.md) — Initializes and maintains rendering environments by negotiating with native graphics drivers. ([source](https://www.glfw.org/docs/latest/compat_guide.html))
- [Library Initializers](https://awesome-repositories.com/f/operating-systems-systems-programming/desktop-environment-frameworks/desktop-environment-components/window-management-systems/graphics-context-initializers/library-initializers.md) — Handle library initialization, version checking, and error reporting to ensure the graphics environment is correctly set up for the application. ([source](https://www.glfw.org/docs/latest/modules.html))
- [Vulkan Surface Initializers](https://awesome-repositories.com/f/operating-systems-systems-programming/desktop-environment-frameworks/desktop-environment-components/window-management-systems/graphics-context-initializers/vulkan-surface-initializers.md) — Initializes native surfaces for windows to enable direct rendering via Vulkan. ([source](https://www.glfw.org/docs/latest/vulkan_guide.html))
- [Graphics API Bridges](https://awesome-repositories.com/f/operating-systems-systems-programming/kernel-core-internals/system-programming-primitives/system-abstractions/native-interoperability-bindings/native-system-integrations/native-api-bridges/graphics-api-bridges.md) — Bridges platform-specific windowing systems with low-level graphics APIs like OpenGL and Vulkan.
- [Window Property Setters](https://awesome-repositories.com/f/operating-systems-systems-programming/display-windowing/window-property-setters.md) — Sets persistent window attributes such as title, size, and monitor selection for individual windows. ([source](https://www.glfw.org/docs/latest/moving_guide.html))
- [Display Connection Monitors](https://awesome-repositories.com/f/operating-systems-systems-programming/display-connection-monitors.md) — Trigger a callback function whenever a display is connected or disconnected from the system. ([source](https://www.glfw.org/docs/latest/monitor_guide.html))
- [System Resource Initializers](https://awesome-repositories.com/f/operating-systems-systems-programming/system-resource-initializers.md) — Prepare the library for use by detecting hardware features, enumerating monitors, and setting up internal resources for window management. ([source](https://www.glfw.org/docs/latest/intro_guide.html))
- [Backend Selectors](https://awesome-repositories.com/f/operating-systems-systems-programming/systems-programming/runtime-libraries/backend-selectors.md) — Configure the library to use a specific windowing system backend at runtime and query the current platform support. ([source](https://www.glfw.org/docs/latest/news.html))

### User Interface & Experience

- [Input Handling](https://awesome-repositories.com/f/user-interface-experience/input-handling.md) — Capture and process keyboard, mouse, joystick, and gamepad events to enable interactive control within the application window. ([source](https://www.glfw.org/docs/latest/))
- [Input Handling Systems](https://awesome-repositories.com/f/user-interface-experience/input-handling-systems.md) — Captures and manages keyboard, mouse, and gamepad input events through a unified system-level framework.
- [Input Handling](https://awesome-repositories.com/f/user-interface-experience/form-and-input-management/input-handling.md) — Captures and normalizes keyboard, mouse, and gamepad input across different operating systems.
- [Window Management](https://awesome-repositories.com/f/user-interface-experience/window-management.md) — Interacts with native windowing protocols to manage the full lifecycle of application windows across platforms. ([source](https://www.glfw.org/docs/latest/compat_guide.html))
- [Display Metrics](https://awesome-repositories.com/f/user-interface-experience/display-metrics.md) — Retrieve precise window dimensions and high-resolution framebuffer sizes to ensure correct viewport scaling across various display hardware and screen densities. ([source](https://www.glfw.org/docs/latest/moving_guide.html))
- [Window Lifecycle Monitors](https://awesome-repositories.com/f/user-interface-experience/event-handling/window-lifecycle-monitors.md) — Monitors window lifecycle events to enable responsive, event-driven application logic. ([source](https://www.glfw.org/docs/latest/window_guide.html))
- [Event Handling Systems](https://awesome-repositories.com/f/user-interface-experience/form-and-input-management/interaction-and-event-handling/event-handling-architectures/event-handling-systems.md) — Implements event polling loops to maintain application responsiveness and process system interactions. ([source](https://www.glfw.org/docs/latest/quick_guide.html))
- [Vulkan Loader Configurations](https://awesome-repositories.com/f/user-interface-experience/graphical-application-runtimes/graphics-runtime-configurators/vulkan-loader-configurations.md) — Provides runtime configuration for Vulkan loader libraries to support custom driver integration paths. ([source](https://www.glfw.org/docs/latest/vulkan_guide.html))
- [Multi-Window Controllers](https://awesome-repositories.com/f/user-interface-experience/window-management/multi-window-controllers.md) — Enables creation and control of multiple independent windows, each with dedicated graphics contexts. ([source](https://www.glfw.org/docs/latest/moving_guide.html))
- [Waitable Swap Chains](https://awesome-repositories.com/f/user-interface-experience/animation-and-motion-systems/configuration-utility-helpers/animation-configuration/frame-execution-synchronization/waitable-swap-chains.md) — Manages frame presentation and vertical synchronization through swap chain configuration. ([source](https://www.glfw.org/docs/latest/quick_guide.html))
- [Extension Detectors](https://awesome-repositories.com/f/user-interface-experience/performance-optimizers/vulkan/extension-detectors.md) — Identifies required instance extensions for managing graphics surfaces on local hardware. ([source](https://www.glfw.org/docs/latest/vulkan_guide.html))
- [Cursor Controllers](https://awesome-repositories.com/f/user-interface-experience/cursor-management/pane-cursor-controllers/cursor-controllers.md) — Configures cursor visibility and movement constraints, including locking cursors to specific windows. ([source](https://www.glfw.org/docs/latest/input_guide.html))
- [Display Scaling](https://awesome-repositories.com/f/user-interface-experience/display-scaling.md) — Retrieves DPI-based scaling factors to ensure UI elements render correctly on high-density displays. ([source](https://www.glfw.org/docs/latest/monitor_guide.html))
- [Mouse Event Handlers](https://awesome-repositories.com/f/user-interface-experience/form-and-input-management/interaction-and-event-handling/event-handling-architectures/event-handling/mouse-event-handlers.md) — Handles mouse button states and scroll wheel offsets via event callbacks or polling. ([source](https://www.glfw.org/docs/latest/input_guide.html))
- [Gamepad Mappers](https://awesome-repositories.com/f/user-interface-experience/input-device-detection/embedded-input-controllers/gamepad-mappers.md) — Maps joystick inputs to standardized gamepad layouts for consistent controller support. ([source](https://www.glfw.org/docs/latest/input_guide.html))
- [Main Thread Dispatchers](https://awesome-repositories.com/f/user-interface-experience/main-thread-dispatchers.md) — Execute functions across threads by adhering to specific constraints regarding which operations must occur on the main thread versus background threads. ([source](https://www.glfw.org/docs/latest/intro_guide.html))
- [Unicode Text Input Capturers](https://awesome-repositories.com/f/user-interface-experience/text-input-managers/unicode-text-input-capturers.md) — Captures Unicode text input while respecting local keyboard layouts and modifier keys. ([source](https://www.glfw.org/docs/latest/input_guide.html))
- [Cursor Customizations](https://awesome-repositories.com/f/user-interface-experience/form-and-input-management/interaction-and-event-handling/drag-operation-controls/cursor-customizations.md) — Allows definition of custom cursor shapes and mouse-transparent window behaviors. ([source](https://www.glfw.org/docs/latest/news.html))
- [System File Drop Handlers](https://awesome-repositories.com/f/user-interface-experience/form-and-input-management/interaction-and-event-handling/interaction-logic-hooks/interaction-handlers/drag-and-drop-event-callbacks/system-file-drop-handlers.md) — Handles file drop events from the operating system onto application windows. ([source](https://www.glfw.org/docs/latest/input_guide.html))
- [Input Device Detection](https://awesome-repositories.com/f/user-interface-experience/input-device-detection.md) — Tracks the physical state of input hardware including cursor positioning and scroll offsets. ([source](https://www.glfw.org/docs/latest/moving_guide.html))
- [Raw Mouse Motion Trackers](https://awesome-repositories.com/f/user-interface-experience/mouse-event-handlers/raw-mouse-motion-trackers.md) — Provides unscaled and unaccelerated mouse movement data for precise control in 3D applications. ([source](https://www.glfw.org/docs/latest/input_guide.html))

### Graphics & Multimedia

- [Display Configuration Managers](https://awesome-repositories.com/f/graphics-multimedia/display-configuration-managers.md) — Query supported video resolutions and refresh rates or retrieve the current display configuration for a specific monitor. ([source](https://www.glfw.org/docs/latest/monitor_guide.html))
- [Graphics API Integrations](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/graphics-api-integrations.md) — Provides deep integration for initializing and managing OpenGL and Vulkan rendering environments.
- [Graphics API Loaders](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/rendering/graphics-apis-bindings/graphics-rendering-apis/graphics-api-loaders.md) — Initializes graphics rendering environments and retrieves function pointers for hardware-accelerated APIs.
- [Graphics Rendering APIs](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/rendering/graphics-apis-bindings/graphics-rendering-apis.md) — Provides a unified interface for interacting with low-level graphics drivers and rendering surfaces. ([source](https://www.glfw.org/docs/latest/pages.html))
- [Display Hardware Initializers](https://awesome-repositories.com/f/graphics-multimedia/display-configuration-managers/display-hardware-initializers.md) — Manage the lifecycle of input devices and rendering backends, including on-demand initialization to ensure hardware compatibility. ([source](https://www.glfw.org/docs/latest/news.html))
- [Monitor Enumerators](https://awesome-repositories.com/f/graphics-multimedia/display-configuration-managers/monitor-enumerators.md) — Detects connected display devices and retrieves supported video modes to configure multi-monitor environments. ([source](https://www.glfw.org/docs/latest/))
- [Hardware-Accelerated Rendering](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/rendering/engines/graphics-pipeline-architectures/hardware-accelerated-rendering.md) — Manages hardware-accelerated rendering pipelines and frame synchronization for real-time applications.
- [Function Pointer Retrievers](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/rendering/graphics-apis-bindings/graphics-rendering-apis/function-pointer-retrievers.md) — Retrieves graphics API function addresses at runtime to access vendor-specific extensions. ([source](https://www.glfw.org/docs/latest/context_guide.html))

### Development Tools & Productivity

- [Native Handle Accessors](https://awesome-repositories.com/f/development-tools-productivity/macos-utilities/native-window-contexts/native-handle-accessors.md) — Retrieve underlying platform-specific handles for windows and contexts to allow direct integration with native system APIs. ([source](https://www.glfw.org/docs/latest/modules.html))
- [System Clipboard Access](https://awesome-repositories.com/f/development-tools-productivity/clipboard-management/system-clipboard-access.md) — Provides read and write access to the system clipboard for cross-application data exchange. ([source](https://www.glfw.org/docs/latest/input_guide.html))

### Software Engineering & Architecture

- [Platform Abstraction Layers](https://awesome-repositories.com/f/software-engineering-architecture/platform-abstraction-layers.md) — Maps unified API calls to native windowing and input protocols via a modular platform abstraction layer.
- [Application Lifecycle Managers](https://awesome-repositories.com/f/software-engineering-architecture/application-lifecycle-managers.md) — Initialize the library before use and terminate it to release all allocated resources and destroy active windows. ([source](https://www.glfw.org/docs/latest/quick_guide.html))
- [Event Dispatchers](https://awesome-repositories.com/f/software-engineering-architecture/event-dispatchers.md) — Provides a callback-based event dispatch system for handling window lifecycle and hardware input events.

### Web Development

- [Graphics API Loaders](https://awesome-repositories.com/f/web-development/dynamic-loading-strategies/graphics-api-loaders.md) — Resolves graphics API entry points at runtime to enable hardware-specific features.
- [Presentation Support Verifiers](https://awesome-repositories.com/f/web-development/dom-to-canvas-renderers/rendering-surface-initializers/presentation-support-verifiers.md) — Verifies if hardware queue families support surface presentation before rendering initialization. ([source](https://www.glfw.org/docs/latest/vulkan_guide.html))

### DevOps & Infrastructure

- [Window Geometry Managers](https://awesome-repositories.com/f/devops-infrastructure/window-geometry-managers.md) — Enforces window dimension constraints and retrieves frame geometry for precise layout management. ([source](https://www.glfw.org/docs/latest/window_guide.html))

### System Administration & Monitoring

- [Display Configuration Managers](https://awesome-repositories.com/f/system-administration-monitoring/display-configuration-managers.md) — Enables enumeration and querying of connected display monitors to retrieve properties, resolutions, and refresh rates. ([source](https://www.glfw.org/docs/latest/modules.html))

### Artificial Intelligence & ML

- [Hardware Extension Detectors](https://awesome-repositories.com/f/artificial-intelligence-ml/hardware-acceleration-support/hardware-extension-detectors.md) — Verifies hardware extension support at runtime to prevent application crashes. ([source](https://www.glfw.org/docs/latest/context_guide.html))
- [Gamma Correction Utilities](https://awesome-repositories.com/f/artificial-intelligence-ml/computer-vision-systems/computer-vision/image-augmentation/lighting-adjusters/gamma-correction-utilities.md) — Provides hardware-level gamma ramp control to adjust brightness and color output characteristics for monitors. ([source](https://www.glfw.org/docs/latest/monitor_guide.html))

### Programming Languages & Runtimes

- [Event-Driven Loops](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-execution-environments/runtime-environments/runtimes/asynchronous-execution-engines/event-driven-loops.md) — Implements an event-driven polling loop to maintain application responsiveness and state synchronization.
- [Graphics Context Threading](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/concurrency-models/concurrency/thread-local-contexts/graphics-context-threading.md) — Handles the assignment and transfer of graphics context ownership between threads for stable rendering. ([source](https://www.glfw.org/docs/latest/context_guide.html))

### Mobile Development

- [Native Platform Access](https://awesome-repositories.com/f/mobile-development/android-ecosystem/android-platform-integrations/native-platform-access.md) — Access platform-specific handles and functions to bridge the gap between standard cross-platform interfaces and the underlying windowing systems of the host operating system. ([source](https://www.glfw.org/docs/latest/files.html))
