Let's go to our main.cpp file in Visual Studio or Xcode, and let's get started. Start typing the following code in your editor:
- Begin by adding some header files to our code:
#include <iostream> // GLEW #define GLEW_STATIC #include <GL/glew.h> // GLFW #include <GLFW/glfw3.h>
iostream is just the input/output stream built into C++. Then, with GLEW_STATIC, we statically linked GLEW. If you don't want to statically link it, just omit the #define line.
- Next, we'll create some constants, and these will be used to store the width and height of our window:
// Window dimensions const GLint WIDTH = 800, HEIGHT = 600;
You might be thinking, why are we using GLint instead of a regular int? The ...