GLFW

Last updated
GLFW
Developer(s) The GLFW Development Team
Stable release
3.4 / February 23, 2024;1 day ago (2024-02-23) [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.org

GLFW (Graphics Library Framework) is a lightweight utility library for use with OpenGL. It provides programmers with the ability to create and manage windows and OpenGL contexts, as well as handle joystick, keyboard and mouse input. [3]

Contents

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. [4] 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 a platform-specific API.

GLFW is used in programs that require a window, due to OpenGL not providing any mechanisms for creating the necessary contexts, managing windows, user input, timing, etc. [5] 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 not a user-interface library, platform-specific library, image-loading library or a threading library. Additionally, it cannot render independently or playback sound. [6]

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, Julia, Python, Rebol, Red, Ruby and Rust, among others. [7]

Back-ends

GLFW version 3.2 has experimental support for Wayland through compile-time flags. [8]

See also

Related Research Articles

<span class="mw-page-title-main">DirectX</span> Collection of multimedia related APIs on Microsoft platforms

Microsoft DirectX is a collection of application programming interfaces (APIs) for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. Originally, the names of these APIs all began with "Direct", such as Direct3D, DirectDraw, DirectMusic, DirectPlay, DirectSound, and so forth. The name DirectX was coined as a shorthand term for all of these APIs and soon became the name of the collection. When Microsoft later set out to develop a gaming console, the X was used as the basis of the name Xbox to indicate that the console was based on DirectX technology. The X initial has been carried forward in the naming of APIs designed for the Xbox such as XInput and the Cross-platform Audio Creation Tool (XACT), while the DirectX pattern has been continued for Windows APIs such as Direct2D and DirectWrite.

<span class="mw-page-title-main">OpenGL Utility Toolkit</span>

The OpenGL Utility Toolkit (GLUT) is a library of utilities for OpenGL programs, which primarily perform system-level I/O with the host operating system. Functions performed include window definition, window control, and monitoring of keyboard and mouse input. Routines for drawing a number of geometric primitives are also provided, including cubes, spheres and the Utah teapot. GLUT also has some limited support for creating pop-up menus.

<span class="mw-page-title-main">OpenGL</span> Cross-platform graphics API

OpenGL is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardware-accelerated rendering.

<span class="mw-page-title-main">Simple DirectMedia Layer</span> Free software multimedia library

Simple DirectMedia Layer (SDL) is a cross-platform software development library designed to provide a hardware abstraction layer for computer multimedia hardware components. Software developers can use it to write high-performance computer games and other multimedia applications that can run on many operating systems such as Android, iOS, Linux, macOS, and Windows.

<span class="mw-page-title-main">Allegro (software library)</span> Software library for video game development

Allegro is a software library for video game development. The functionality of the library includes support for basic 2D graphics, image manipulation, text output, audio output, MIDI music, input and timers, as well as additional routines for fixed-point and floating-point matrix arithmetic, Unicode strings, file system access, file manipulation, data files, and 3D graphics. The library is written in the C programming language and designed to be used with C, C++, or Objective-C, with bindings available for Python, Lua, Scheme, D, Go, and other languages. Allegro comes with extensive documentation and many examples.

GLX is an extension to the X Window System core protocol providing an interface between OpenGL and the X Window System as well as extensions to OpenGL itself. It enables programs wishing to use OpenGL to do so within a window provided by the X Window System. GLX distinguishes two "states": indirect state and direct state.

Game programming, a subset of game development, is the software development of video games. Game programming requires substantial skill in software engineering and computer programming in a given language, as well as specialization in one or more of the following areas: simulation, computer graphics, artificial intelligence, physics, audio programming, and input. For multiplayer games, knowledge of network programming is required. In some genres, e.g. fighting games, advanced network programming is often demanded, as the netcode and its properties are considered by players and critics to be some of the most important metrics of the game's quality. For massively multiplayer online games (MMOGs), even further knowledge of database programming and advanced networking programming are required. Though often engaged in by professional game programmers, there is a thriving scene of independent developers who lack a relationship with a publishing company.

Cairo (graphics) Vector graphics-based software library

Cairo is an open-source graphics library that provides a vector graphics-based, device-independent API for software developers. It provides primitives for two-dimensional drawing across a number of different back ends. Cairo uses hardware acceleration when available.

<span class="mw-page-title-main">Java OpenGL</span>

Java OpenGL (JOGL) is a wrapper library that allows OpenGL to be used in the Java programming language. It was originally developed by Kenneth Bradley Russell and Christopher John Kline, and was further developed by the Game Technology Group at Sun Microsystems. Since 2010, it has been an independent open-source project under a BSD license. It is the reference implementation for Java Bindings for OpenGL (JSR-231).

Core OpenGL, or CGL, is Apple Inc.'s Macintosh Quartz windowing system interface to the OS X implementation of the OpenGL specification. CGL is analogous to GLX, which is the X11 interface to OpenGL, as well as WGL, which is the Microsoft Windows interface to OpenGL.

A graphics library is a program library designed to aid in rendering computer graphics to a monitor. This typically involves providing optimized versions of functions that handle common rendering tasks. This can be done purely in software and running on the CPU, common in embedded systems, or being hardware accelerated by a GPU, more common in PCs. By employing these functions, a program can assemble an image to be output to a monitor. This relieves the programmer of the task of creating and optimizing these functions, and allows them to focus on building the graphics program. Graphics libraries are mainly used in video games and simulations.

FreeGLUT is an open-source alternative to the OpenGL Utility Toolkit (GLUT) library. GLUT allows the user to create and manage windows containing OpenGL contexts on a wide range of platforms and also read the mouse, keyboard and joystick functions. FreeGLUT is intended to be a full replacement for GLUT, and has only a few differences.

In computing, Nano-X is a windowing system which is full featured enough to be used on a PC, an embedded system or a PDA. It is an Open Source project aimed at bringing the features of modern graphical windowing environments to smaller devices and platforms. The project was renamed from Microwindows due to legal threats from Microsoft regarding the Windows trademark.

<i>Chromium B.S.U.</i>

Chromium B.S.U. is an arcade-style, top-scrolling space shooter available on Windows, iPhone, PSP, Mac, AmigaOS 4, Linux and numerous other UNIX-like operating systems. It is a free software distributed under the Clarified Artistic License. The original version of Chromium B.S.U. was designed in 2000 by Mark B. Allan and released under the Artistic License. Since then it has received many contributions from the community.

Game Sprockets is a collection of application programming interfaces (APIs) supporting gaming on the classic Mac OS. It consisted of four main parts, DrawSprocket, InputSprocket, SoundSprocket and NetSprocket, each providing a library of pre-rolled routines for common gaming tasks. SpeechSprocket was a relabelled version of the Speech Recognition Manager that provided speech recognition support, and QuickDraw 3D RAVE provided 3D hardware acceleration.

<span class="mw-page-title-main">Simple and Fast Multimedia Library</span> Graphics and Multimedia Library written in C++

Simple and Fast Multimedia Library (SFML) is a cross-platform software development library designed to provide a simple application programming interface (API) to various multimedia components in computers. It is written in C++ with bindings available for Ada, C, Crystal, D, Euphoria, Go, Java, Julia, .NET, Nim, OCaml, Python, Ruby, and Rust. Experimental mobile ports were made available for Android and iOS with the release of SFML 2.2.

<span class="mw-page-title-main">ORX</span> Game Engine

Orx is an open-source, portable, lightweight, plug-in-based, data-driven and easy to use 2D-oriented game engine written in C.

<span class="mw-page-title-main">Immediate mode GUI</span> Type of graphical user interface

An immediate mode graphic user interface (GUI), also known as IMGUI, is a graphical user interface design pattern which uses an immediate mode API to render controls, as opposed to a retained mode one.

raylib Game programming library

Raylib is a cross-platform open-source software development library. The library was made to create graphical applications and games.

References

  1. "Releases · glfw/glfw". github.com. Retrieved 2024-02-23.
  2. "License | GLFW". glfw.org. Retrieved 2021-04-10.
  3. "GLFW homepage". www.glfw.org. Retrieved 2022-09-15.
  4. "GLFW: Input guide". www.glfw.org. Retrieved 2021-02-07.
  5. "LearnOpenGL - Creating a window". www.learnopengl.com. Retrieved 2022-09-15.
  6. "GLFW – FAQ" . Retrieved 11 July 2015.
  7. "GLFW Programming language bindings" . Retrieved 4 September 2019.
  8. "GLFW: New features in 3.2".