Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
OpenGL Data Visualization Cookbook

You're reading from   OpenGL Data Visualization Cookbook Over 35 hands-on recipes to create impressive, stunning visuals for a wide range of real-time, interactive applications using OpenGL

Arrow left icon
Product type Paperback
Published in Aug 2015
Publisher Packt
ISBN-13 9781782169727
Length 298 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (11) Chapters Close

Preface 1. Getting Started with OpenGL 2. OpenGL Primitives and 2D Data Visualization FREE CHAPTER 3. Interactive 3D Data Visualization 4. Rendering 2D Images and Videos with Texture Mapping 5. Rendering of Point Cloud Data for 3D Range-sensing Cameras 6. Rendering Stereoscopic 3D Models using OpenGL 7. An Introduction to Real-time Graphics Rendering on a Mobile Platform using OpenGL ES 3.0 8. Interactive Real-time Data Visualization on Mobile Devices 9. Augmented Reality-based Visualization on Mobile or Wearable Platforms Index

Installing the GLFW library in Mac OS X and Linux

The installation procedures for Mac and Linux are essentially identical using the command-line interface. To simplify the process, we recommend that you use MacPorts for Mac users.

Getting ready

We assume that you have successfully installed the basic development tools, including CMake, as described in the earlier section. For maximum flexibility, we can compile the library directly from the source code (refer to http://www.glfw.org/docs/latest/compile.html and http://www.glfw.org/download.html).

How to do it...

For Mac users, enter the following command in a terminal to install GLFW using MacPorts:

sudo port install glfw

For Linux users (or Mac users who would like to practice using the command-line tools), here are the steps to compile and install the GLFW source package directly with the command-line interface:

  1. Create a new folder called opengl_dev and change the current directory to the new path:
    mkdir ~/opengl_dev
    cd ~/opengl_dev
    
  2. Obtain a copy of the GLFW source package (glfw-3.0.4) from the official repository: http://sourceforge.net/projects/glfw/files/glfw/3.0.4/glfw-3.0.4.tar.gz.
  3. Extract the package.
    tar xzvf glfw-3.0.4.tar.gz
    
  4. Perform the compilation and installation:
    cd glfw-3.0.4
    mkdir build
    cd build
    cmake ../
    make && sudo make install
    

How it works...

The first set of commands create a new working directory to store the new files retrieved using the wget command, which downloads a copy of the GLFW library to the current directory. The tar xzvf command extracts the compressed packages and creates a new folder with all the contents.

Then, the cmake command automatically generates the necessary build files that are needed for the compilation process to the current build directory. This process also checks for missing dependencies and verifies the versioning of the applications.

The make command then takes all instructions from the Makefile script that is generated automatically and compiles the source code into libraries.

The sudo make install command installs the library header files as well as the static or shared libraries onto your machine. As this command requires writing to the root directory, the sudo command is needed to grant such permissions. By default, the files will be copied to the /usr/local directory. In the rest of the book, we will assume that the installations follow these default paths.

For advanced users, we can optimize the compilation by configuring the packages with the CMake GUI (cmake-gui).

How it works...

For example, you can enable the BUILD_SHARED_LIBS option if you are planning to compile the GLFW library as a shared library. In this book, we will not explore the full functionality of the GLFW library, but these options can be useful to developers who are looking for further customizations. Additionally, you can customize the installation prefix (CMAKE_INSTALL_PREFIX) if you would like to install the library files at a separate location.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime