With all the necessary classes created, we can finally create our ObjectRenderer class, which will render the mesh object to the scene.
Let's create a new class called ObjectRenderer. In ObjectRenderer.h, add the following:
#include "GraphicsPipeline.h" #include "ObjectBuffers.h" #include "Descriptor.h" #include "Camera.h" class ObjectRenderer { public: void createObjectRenderer(MeshType modelType, glm::vec3 _position,
glm::vec3 _scale); void updateUniformBuffer(Camera camera); void draw(); void destroy(); private: GraphicsPipeline gPipeline; ObjectBuffers objBuffers; Descriptor descriptor; glm::vec3 position; glm::vec3 scale; };
We will include the descriptor, pipeline, and object buffer headers because they are required for the class. In...