[zz]OpenGL Installation on Linux

https://en.wikibooks.org/wiki/OpenGL_Programming/Installation/Linux

OpenGL Installation on Linux

Most Linux distributions rely on the Mesa3D project to provide their OpenGL implementation. This supplies libraries for regular OpenGL as well as OpenGL ES 1.x and 2.0.

The exact names of the packages you need to install are highly dependent on distribution. Referring to your distro's packages can save you a lot of time and headache in installation. Use your favorite package manager and search for the package name. You may need to install packages that come with a dev suffix, these are development packages (usually header files). Also look for packages with a lib prefix, which refer to libraries.

Install the GCC C/C++ compilers and associated tools such as make.

All in all, install Mesa, Make and GCC/g++:

sudo apt-get install build-essential libgl1-mesa-dev  # Debian, Ubuntu
sudo dnf install make gcc-c++  # Fedora

Libraries

In this wikibooks, we'll make great use of GLEW, SDL2 (+SDL2_Image), GLM and FreeType. Make sure you install the development libraries:

sudo apt-get install libglew-dev libsdl2-dev libsdl2-image-dev libglm-dev libfreetype6-dev  # Debian, Ubuntu
sudo dnf install glew-devel SDL2-devel SDL2_image-devel glm-devel freetype-devel   # Fedora
sudo pacman -S glew sdl2 sdl2_image glm freetype2 # Arch

If GLM is not available in your distribution repository, you have the option to install it manually. Make sure the headers end in the /usr/include/glm directory. Since it's a headers-only library, you do not need to compile a .so library - just copy the code there.

Check your OpenGL installation

Type this in a terminal to get much info about your OpenGL driver, including supported extensions:

glxinfo | grep OpenGL

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值