For drawing regular game objects, we will create a separate class from the LightRenderer class by adding texture, and we will also add motion to the object by adding physical properties. We will draw a textured object and then add physics to this object in the next section of this chapter. To do this, we will create a new .h and .cpp file called MeshRenderer.
In the MeshRenderer.h file, we will do the following:
- First, we will add the includes as follows:
#include <vector> #include "Camera.h" #include "LightRenderer.h" #include <GL/glew.h> #include "Dependencies/glm/glm/glm.hpp" #include "Dependencies/glm/glm/gtc/matrix_transform.hpp" #include "Dependencies/glm/glm/gtc/type_ptr.hpp"
- Next, we will create the class itself as follows:
Class MeshRenderer{ };
- We will...