Creating a Camera.h header file

We'll begin by creating a header file for our Camera class, so we'll create an empty header file in our project and add it to our target. We'll name it Camera.h. We'll only have a header because the methods that we're going to implement are very simple methods. But you can extract it into a separate CPP file if you want to. It is recommended that you try experimenting that way as well, because it will be a great way to learn. Let's begin coding our camera header. Follow these steps:

  1. First, let's get rid of the default code that is already present in the file. Then, add #pragma when the code is a simpler version. This doesn't work on all compilers, but most compilers will support this.
  2. Then, we'll add the ...

Get Learn OpenGL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.