GLFW
This article has multiple issues. Please help or discuss these issues on the talk page. (Learn how and when to remove these template messages)
|
Developer(s) | The GLFW Development Team |
---|---|
Stable release | 3.3.4
/ April 8, 2021[1] |
Repository | |
Written in | C |
Operating system | Linux, macOS, Microsoft Windows, FreeBSD, NetBSD, OpenBSD |
Platform | Cross-platform |
Type | API |
License | zlib/libpng License[2] |
Website | www |
GLFW is a lightweight utility library for use with OpenGL. GLFW stands for Graphics Library Framework. It provides programmers with the ability to create and manage windows and OpenGL contexts, as well as handle joystick, keyboard and mouse input.
Software architecture[]
GLFW is a small C library that allows the creation and management of windows with OpenGL contexts, making it also possible to use multiple monitors and video modes. It provides access to input from the keyboard, mouse, and joysticks.[3] The API provides a thin, multi-platform abstraction layer, primarily for applications whose sole graphics output is through the OpenGL API. While GLFW is very useful when developing multi-platform OpenGL applications, single-platform developers can also benefit from avoiding having to deal with different platform-specific APIs.
A possible reason that libraries like GLFW are needed is that OpenGL by itself does not provide any mechanisms for creating the necessary context, managing windows, user input, timing, etc. There are several other libraries available for aiding OpenGL development. The most common ones are FreeGLUT (an Open Source implementation of GLUT) and SDL. However, FreeGLUT is mostly concerned with providing a stable clone of GLUT, while SDL is too large for some people and has never had OpenGL as its main focus. GLFW is predicated on the assumption that there is room for a lightweight, modern library for managing OpenGL contexts, windows, and input.
GLFW is by design not...[4]
- a user interface library. It allows the programmer to create top-level windows with OpenGL contexts. No menus, no buttons.
- a Windows-only library. Requests for features that cannot be portably implemented will be denied unless they are unobtrusive, like the Windows port looking for a GLFW_ICON resource at window creation.
- a threading library. There are already good cross-platform threading libraries and threading has been added to both the C11 and C++11 standard libraries.
- an image loading library. There are already good cross-platform image loading libraries.[5]
- capable of rendering text. There are already several libraries that render text with OpenGL and consistent cross-platform text rendering cannot depend on the platform’s text rendering facilities anyway.
- capable of rendering anything at all. Rendering is up to the programmer and/or other libraries.
- integrated with any user interface toolkit on any platform.
- Able to playback sound.
- GLUT or SDL.
Programming language bindings[]
Although GLFW is written in C, bindings do exist to use the API with other programming languages including Ada, C#, Common Lisp, D, Delphi, Go, Harbour, Haskell, Java, Python, Rebol, Red, Ruby and Rust, among others.[6]
Back-ends[]
GLFW version 3.2 has experimental support for Wayland through compile-time flags.[7]
See also[]
- GLUT – OpenGL's legacy windowing toolkit
- OpenGL Extension Wrangler Library
- Raylib
- Simple DirectMedia Layer
References[]
- ^ "Releases · glfw/glfw". github.com. Retrieved 2021-04-10.
- ^ "License | GLFW". glfw.org. Retrieved 2021-04-10.
- ^ "GLFW: Input guide". www.glfw.org. Retrieved 2021-02-07.
- ^ "GLFW – FAQ". Retrieved 11 July 2015.
- ^ "PNGs in OpenGL?". www.xspdf.com. Retrieved 2021-02-07.
- ^ "GLFW Programming language bindings". Retrieved 4 September 2019.
- ^ "GLFW: New features in 3.2".
External links[]
- Application programming interfaces
- C (programming language) libraries
- Cross-platform software
- Free software programmed in C
- Linux APIs
- MacOS APIs
- OpenGL
- Software using the zlib license
- Windows APIs