GLEW (The OpenGL Extension Wrangler Library)
repository·master·Indexed 25 days ago
https://github.com/nigels-com/glewA cross-platform C/C++ library that acts as an OpenGL extension wrangler, providing a single header to access OpenGL core and extension functionality and determining runtime support for extensions. Compatible with Windows, Linux, Mac OS X, FreeBSD, Irix, and Solaris. Current release is 2.3.1.
What's inside GLEW
- GLEW (The OpenGL Extension Wrangler Library) is a cross-platform, open-source C/C++ library used for loading OpenGL extensions. It provides efficient run-time mechanisms to determine which OpenGL extensions are supported on a target platform. All OpenGL core and extension functionality is exposed through a single header file. It is compatible with Windows, Linux, Mac OS X, FreeBSD, Irix, and Solaris.
Download GLEW releases
masterYou can download official releases of GLEW in ZIP or TGZ formats, or Windows binaries for 32-bit and 64-bit architectures. The current release is 2.3.1.Build GLEW on Windows
masterVisual Studio
Use the provided Visual Studio project files located in
build/vc15/. Projects forvc6,vc10,vc12, andvc14are also provided.MSYS/Mingw
Requires
bash,make, andgcc.$ mingw32-make $ mingw32-make install $ mingw32-make install.allAlternative toolchain:
SYSTEM=mingw-win32MSYS2/Mingw-w64
Requires
bash,make, andgcc.$ pacman -S gcc make mingw-w64-i686-gcc mingw-w64-x86_64-gcc $ make $ make install $ make install.allAlternative toolchains:
SYSTEM=msys,SYSTEM=msys-win32, orSYSTEM=msys-win64$ mingw32-make $ mingw32-make installBuild GLEW on Linux with specific backends
masterWhen using GNU Make on Linux, you can specify different backends using the
SYSTEMvariable:Linux EGL:
$ sudo apt install libegl1-mesa-dev $ make SYSTEM=linux-eglLinux OSMesa:
$ sudo apt install libosmesa-dev $ make SYSTEM=linux-osmesaLinux mingw-w64:
$ sudo apt install mingw-w64 $ make SYSTEM=linux-mingw32 $ make SYSTEM=linux-mingw64$ make SYSTEM=linux-eglBuild GLEW using CMake
masterThe CMake build is maintained on a best-effort basis and requires CMake 3.16 or higher.
1. Install build tools
Debian/Ubuntu/Mint:
$ sudo apt-get install build-essential libxmu-dev libxi-dev libgl-dev cmake gitRedHat/CentOS/Fedora:
$ sudo yum install libXmu-devel libXi-devel libGL-devel cmake git2. Build
$ cd build $ cmake ./cmake $ make -j4CMake Targets
glew: Build the glew shared library.glew_s: Build the glew static library.glewinfo: Build theglewinfoexecutable (requiresBUILD_UTILS=ON).visualinfo: Build thevisualinfoexecutable (requiresBUILD_UTILS=ON).install: Install targets intoCMAKE_INSTALL_PREFIX.clean: Clean build artifacts.all: Build all enabled targets.
CMake Variables
BUILD_UTILS: Buildglewinfoandvisualinfo.GLEW_REGAL: Build in Regal mode.GLEW_OSMESA: Build in off-screen Mesa mode.BUILD_FRAMEWORK: Build as MacOSX Framework (setCMAKE_INSTALL_PREFIXto/Library/Frameworks).CLANG_TIDY: Enable clang-tidy linting mode.
Build GLEW on Linux and Mac using GNU Make
masterGNU make is the primary build system. It is recommended to build from a tgz or zip release snapshot. Note that you may need to run
makein theautofolder first.1. Install build tools
Debian/Ubuntu/Mint:
$ sudo apt-get install build-essential libxmu-dev libxi-dev libgl-devRedHat/CentOS/Fedora:
$ sudo yum install libXmu-devel libXi-devel libGL-develFreeBSD:
# pkg install xorg lang/gcc git cmake gmake bash python perl52. Build and Install
$ make $ sudo make install $ make cleanAvailable Targets
all: Build all targetsglew.lib: Build shared/static libraries (sub-targets:glew.lib.shared,glew.lib.static)glew.bin: Build binariesclean: Clean build artifactsinstall: Install to systemuninstall: Remove installed files
Build Variables
SYSTEM: e.g.,linux-clangGLEW_DEST: Installation destination (default/usr/local)STRIP: Strip command
$ make $ sudo make installGenerate GLEW code from scratch
masterTo include new extensions or customize code generation, you must use a Unix or Mac environment. The extension data is regenerated from the top-level source directory using:
$ make extensionsAlternatively, you can download pre-generated (unsupported) snapshots from SourceForge.
Inspect OpenGL capabilities with glewinfo
masterTheglewinfocommand-line tool is used to inspect the capabilities of an OpenGL implementation and verify GLEW support. When reporting bugs, it is recommended to include the output ofglewinfo(or theglewinfo.txtfile generated by it).Identify the glewinfo utility executable name
masterThe
glewinfoutility, used for verifying extension entry points, has different executable names depending on whether it was built in debug mode:- Debug builds:
glewinfod.exe - Release builds:
glewinfo.exe
- Debug builds:
Identify the visualinfo executable name
masterThe
visualinfoutility, used for listing pixelformat capabilities, changes its filename based on the build configuration:- Debug builds: The executable is named
visualinfod.exe. - Release builds: The executable is named
visualinfo.exe.
- Debug builds: The executable is named
Identify GLEW Windows binary filenames
masterWhen building or distributing GLEW on Windows, the resulting filename depends on whether you are building a static library or a dynamic link library (DLL), and whether you are in a debug or release configuration.
Use the following mapping to identify the correct file for your build type:
- Static Library (
GLEW_STATICdefined):- Debug:
glew32sd.dll - Release:
glew32s.dll
- Debug:
- Dynamic Library (Default):
- Debug:
glew32d.dll - Release:
glew32.dll
- Debug:
- Static Library (