Introduction to OpenGL

Chapter Two in the textbook gives an overview of some of the elements of OpenGL programming. Our primary task in this chapter is getting a first example OpenGL program up and running.

The textbook gives detailed instructions for setting up OpenGL projects on Windows and Mac in appendices A and B. I have gone through the work of setting up an example project on Windows and Mac so you won't have to slog through all of the details yourself. The sections below will provide you with a prebuilt example project and will give you additional instructions needed to set up your computer for OpenGL development.

Windows

Visual Studio Project

The button above links to an example project for Visual Studio. This project implements program 2.5 from the textbook.

I created this project using the Community Edition of Visual Studio 2022.

This project is completely self-contained, and contains all of the libraries you will need for OpenGL development in this course.

Macintosh

Xcode Project for Intel Macs

Xcode Project for Apple Silicon Macs

For this course you will need to install a number of libraries. We will be using the homebrew package management system to do this.

If you have not done so already, go to brew.sh and follow the instructions there to install homebrew on your computer.

After installing homebrew, run the following commands in a terminal window:

brew install glfw3
brew install glew
brew install glm

This will install the libraries you will need.

Next, click the blue button at the top of this section to download the appropriate starter project for the type of Mac you have. This project implements program 2.5 from chapter two in the textbook. Open this project in Xcode and run it to confirm that it runs correctly.