To create object-related buffers, such as vertex, index, and uniform, we will create a new class called ObjectBuffers. In the ObjectBuffers.h file, we will add the required include statements:
#include <vulkan\vulkan.h> #include <vector> #include "Mesh.h"
Then, we will create the class itself. In the public section, we will add the constructor and the destructor and add the required data types for creating vertex, index, and uniform buffers. We add a vector of the data vertex to set the vertex information of the geometry, create a VkBuffer instance called vertexBuffer to store the vertex buffer, and create a VkDeviceMemory instance called vertexBufferMemory:
- VkBuffer: This is the handle to the object buffer itself.
- VkDeviceMemory: Vulkan operates on memory data in the device's memory through the DeviceMemory object...