- The Microsoft implementation of OpenGL for the Windows operating system is industry-standard graphics software with which programmers can create high-quality still and animated three-dimensional color images. The version of OpenGL described in this section is 1.1. For information about OpenGL ES running on Windows, see ANGLE for Windows Store.
- OpenGL Mathematics (GLM) GLM is a C mathematics library for graphics software based on the OpenGL Shading Language (GLSL) specification. GLM provides classes and functions designed and implemented with the same naming conventions and functionalities than GLSL so that when a programmer knows GLSL, he knows GLM as well which makes it really easy to use.
GLM: GLM ( OpenGL Mathematics ) is a cross-platform C mathematics library designed to match the GLSL math functions. It also provides vectors and matrices classes and functions to replace the deprecated OpenGL functions and many more features from half-precision floating point or quaternions. OpenGL Mathematics (GLM) is a header only C mathematics library for graphics software based on the OpenGL Shading Language (GLSL) specifications. GLM provides classes and functions designed and implemented with the same naming conventions and functionalities than GLSL so that anyone who knows GLSL, can use GLM as well in C.
GLSL + Optional features = OpenGL Mathematics (GLM)
A C++ mathematics library for graphics programming
OpenGL Mathematics (GLM) is a header only C++ mathematics library for graphics software based on the OpenGL Shading Language (GLSL) specifications.
GLM provides classes and functions designed and implemented with the same naming conventions and functionalities than GLSL so that anyone who knows GLSL, can use GLM as well in C++.
This project isn't limited to GLSL features. An extension system, based on the GLSL extension conventions, provides extended capabilities: matrix transformations, quaternions, data packing, random numbers, noise, etc...
This library works perfectly with OpenGL but it also ensures interoperability with other third party libraries and SDK. It is a good candidate for software rendering (raytracing / rasterisation), image processing, physic simulations and any development context that requires a simple and convenient mathematics library.
- GLM is written in C++98 but can take advantage of C++11 when supported by the compiler. It is a platform independent library with no dependence and it officially supports the following compilers:
- Apple Clang 6.0 and higher
- GCC 4.7 and higher
- Intel C++ Composer XE 2013 and higher
- LLVM 3.4 and higher
- Visual C++ 2013 and higher
- CUDA 9.0 and higher (experimental)
- Any conform C++11 compiler
For more information about GLM, please have a look at the manual and the API reference documentation.
The source code and the documentation, including this manual, are licensed under the Happy Bunny License (Modified MIT) or the MIT License.
Thanks for contributing to the project by submitting issues for bug reports and feature requests. Any feedback is welcome at glm@g-truc.net.
Code sample:- #include <glm/vec3.hpp> // glm::vec3
- #include <glm/vec4.hpp> // glm::vec4
- #include <glm/mat4x4.hpp> // glm::mat4
- #include <glm/gtc/matrix_transform.hpp> // glm::translate, glm::rotate, glm::scale, glm::perspective
- glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
- {
- glm::mat4 Projection = glm::perspective(glm::radians(45.0f), 4.0f / 3.0f, 0.1f, 100.f);
- glm::mat4 View = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Translate));
- View = glm::rotate(View, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f));
- View = glm::rotate(View, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f));
- glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f));
- return Projection * View * Model;
- }
Featured APIs
Featured APIs
OpenGL is a cross-platform, industry standard graphics programming API for 3D graphics.
OpenGL ES is the mobile subset of OpenGL. It's supported on all major mobile platforms, and is also the base for WebGL.
Vulkan is the next-generation graphics programming API from The Khronos® Group.
EGL is an interface between Khronos rendering APIs such as OpenGL or OpenVG and the underlying native platform window system.
OpenMAX is a non-proprietary and royalty-free cross-platform set of C-language programming interfaces, provides abstractions for processing of audio, video, and still images.
OpenCL
OpenCL is a framework for writing programs that execute across heterogeneous platforms consisting of CPUs, GPUs, DSPs, FPGAs and other processors or hardware accelerators.
VDPAU
VDPAU is the Video Decode and Presentation API for UNIX. It provides an interface to video decode acceleration and presentation hardware present in modern GPUs.
VA-API
VA-API is an open-source library and API specification, which provides access to graphics hardware acceleration capabilities for video processing.
XvMC
XvMC is an extension of the X video extension (Xv) for the X Window System. The XvMC API allows video programs to offload portions of the video decoding process to the GPU hardware.
Note
Even though Mesa provides implementations of the APIs listed above, not all combinations of drivers and APIs are formally conformant to their respective specifications.
Supported Drivers
Hardware
The R600 driver supports AMD's Radeon HD 2000 GPU series. It's officially supported by AMD, and is one of two Linux drivers for the hardware.
The RadeonSI OpenGL and OpenCL driver supports AMD's Southern Island GPUs and later. It's officially supported by AMD, and is one of two Linux drivers for the hardware.
The AMD RADV Vulkan driver supports AMD's Southern Island GPUs and later. It's not officially supported by AMD, but it's based on public information provided by AMD.
The V3D OpenGL driver supports Broadcom's VC5 and later GPUs, which is found in the Raspberry Pi 4. It's officially supported by Broadcom, and is the official Linux driver for the hardware. More information…
The V3DV Vulkan driver supports Broadcom's VC5 and later GPUs, similar to the V3D driver.
The VC4 driver supports Broadcom's VC4 GPU, which is found among other other things in most of the Raspberry Pis. It's officially supported by Broadcom, and is one of two Linux drivers for the hardware. More information…
The Etnaviv driver supports the Vivante GCxxx series of embedded GPUs. It's a reverse-engineered, community-developed driver, and is not endorsed by Vivante. More information…
The Freedreno driver supports the Qualcomm Adreno GPUs, from the A2xx series to the A6xx series. It's a reverse-engineered, community-developed driver, and is not endorsed by Qualcomm. More information…
The ANV vulkan driver supports Intel's Gen 7 hardware and later. It's officially supported by Intel and is their official Vulkan driver for Linux. More information…
The i965 driver supports Intel's Gen 4 hardware and later. It's officially supported by Intel and is their default OpenGL driver for Linux. More information…
The Iris driver supports Intel's Gen 8 hardware and later. It's officially supported by Intel and is their next-generation Linux OpenGL driver. More information…
Lima is a free and open source driver for the ARM Mali-4xx family of GPUs. It's a reverse-engineered, community-developed driver, and is not endorsed by ARM. More information…
The Nouveau drivers supports a large set of NVIDIA chips, ranging from NV04 found in the Riva TNT card to NVF0 found in the GeForce GTX 780, as well as most of the Tegra GPUs. It's a reverse-engineered, community-developed driver, and is not endorsed by NVIDIA. More information…
Panfrost is a free and open source driver for the ARM Mali Midgard and Bifrost GPUs. It's a reverse-engineered, community-developed driver, and is not endorsed by ARM. More information…
Layered Drivers
The D3D12 driver is a Gallium driver that emits D3D12 API calls instead of targeting a specific GPU architecture. This can be used to get full desktop OpenGL support on devices that only support D3D12, as well as providing hardware acceleration for applications running under WSL. More information…
The SVGA3D driver gives a Linux virtual machine access to the host GPU for hardware-accellerated 3D when running either on VMware hypervisors (Workstation, Fusion, and ESX). It's officially supported by VMware. More information…
The Venus driver is a virtual Vulkan GPU driver for sharing a GPU with a host for virtual machines. It uses Vulkan on the host to accelerate rendering.
The VirGL driver is a virtual OpenGL GPU driver for sharing a GPU with a host for virtual machines. It uses OpenGL or OpenGL ES on the host to accelerate rendering. More information…
The Zink driver is a Gallium driver that emits Vulkan API calls instead of targeting a specific GPU architecture. This can be used to get full desktop OpenGL support on devices that only support Vulkan. More information…
Software rendering
The LLVMPipe driver is a high-performance software renderer. It's useful for systems without a dedicated GPU, or in the process of bringing up a platform. It uses LLVM as a code-generator to dynamically compile efficient machine code for the CPU. More information…
The OpenSWR driver is a high performance, highly scalable software renderer targeted towards visualization workloads. More information…
The Softpipe driver is a reference software rasterizer; it's slow but accurate. It's mostly useful for testing, and on systems that lacks support for LLVM.
Legacy Hardware
Note
Due to the age of the hardware, these drivers are no longer very actively developed, and they are entirely community maintained.
Opengl Library Download
The R200 driver supports AMD's Radeon R200 GPU series.
The R300 driver supports AMD's Radeon R300 GPU series.
The i915 driver supports Intel's GMA 916G as well as the i830, i845 and i865 integrated GPU series.