Creating the Texture.h file

Next, we will actually load the textures, so what we're going to do is create a separate texture file, and we'll just have a method for loading the textures, and also a separate method for loading cube textures. The reason for doing this is we're going to be using this code regularly, and it's just that we have to rewrite these every single time. If we want to do multiple objects, especially, we don't want to rewrite this every single time. Let's take a look at the following steps to create the Texture.h file:

  1. First of all, we'll create an empty header file and name that as Texture.h, and add that to our project.
  2. Then, in Texture.h, we'll add the following code:
#pragma once 
  1. Then, we'll add some header files, ...

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.