GLFW is a library to open a window with OpenGL graphics visualization.
There are three ways to set up GLFW:
- using package manager (for Mac and Ubuntu)
- download pre-build library (Mac and Windows)
- build the source code (for all OSs)
This class support the option 1 and 3. Below, we discuss these options in detail for each OS
for Mac, install glfw
using package manager brew
as
$ brew install glfw
Alternatively, you can build glfw
from source code and put the library under external/glfwlib
with
$ git submodule update --init external/glfw
$ cd external/glfw
$ cmake .
$ cmake --build . --config Release
$ cmake --install . --prefix ../glfwlib
Make sure you have a header file glfw3.h
at
pba-<username>/external/glfwlib/include/GLFW/glfw3.h
For ubuntu, install glfw
using apt-get
as
$ sudo apt-get install -y libx11-dev xorg-dev \
libglu1-mesa libglu1-mesa-dev \
libgl1-mesa-glx libgl1-mesa-dev
$ sudo apt install -y libglfw3 libglfw3-dev
$ sudo apt install -y libglew-dev
Alternatively, you can build glfw
from source code and put the library under external/glfwlib
with
$ git submodule update --init external/glfw
$ cd external/glfw
$ cmake .
$ cmake --build . --config Release
$ cmake --install . --prefix ../glfwlib
Make sure you have a header file glfw3.h
at
pba-<username>/external/glfwlib/include/GLFW/glfw3.h
Alternatively, you can build glfw
from source code and put the library under external/glfwlib
with
$ git submodule update --init external/glfw
$ cd external/glfw
$ cmake .
$ cmake --build . --config Release
$ cmake --install . --prefix ../glfwlib
Make sure you have a header file glfw3.h
at
pba-<username>/external/glfwlib/include/GLFW/glfw3.h