Changeset cd1cb0f in opengl-game for graphics-pipeline_vulkan.hpp
- Timestamp:
- Dec 24, 2019, 12:48:49 AM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 0fe8433
- Parents:
- a79be34
- git-author:
- Dmitry Portnoy <dmitry.portnoy@…> (12/22/19 03:45:12)
- git-committer:
- Dmitry Portnoy <dmitry.portnoy@…> (12/24/19 00:48:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
graphics-pipeline_vulkan.hpp
ra79be34 rcd1cb0f 10 10 #include <vulkan/vulkan.h> 11 11 12 #define GLM_FORCE_RADIANS 13 #define GLM_FORCE_DEPTH_ZERO_TO_ONE // Since, in Vulkan, the depth range is 0 to 1 instead of -1 to 1 14 #define GLM_FORCE_RIGHT_HANDED 15 16 #include <glm/glm.hpp> 17 #include <glm/gtc/matrix_transform.hpp> 18 12 19 #include "vulkan-utils.hpp" 20 21 using namespace glm; 13 22 14 23 // TODO: Maybe change the name of this struct so I can call the list something other than descriptorInfoList … … 28 37 vector<VertexType> vertices; 29 38 vector<uint16_t> indices; 39 40 mat4 model_base; 41 mat4 model_transform; 30 42 }; 31 43 … … 54 66 void createRenderCommands(VkCommandBuffer& commandBuffer, uint32_t currentImage); 55 67 56 constvector<SceneObject<VertexType>>& getObjects();68 vector<SceneObject<VertexType>>& getObjects(); 57 69 void addObject(const vector<VertexType>& vertices, vector<uint16_t> indices, VkCommandPool commandPool, 58 70 VkQueue graphicsQueue); … … 88 100 VkDeviceMemory indexBufferMemory; 89 101 90 // TODO: T He objects vector isn't used at all in this class, except in the method that returns102 // TODO: The objects vector isn't used at all in this class, except in the method that returns 91 103 // the number of objects. Move this vector and the SceneObject declaration into VulkanGame, esp. 92 // since I'll be adding other // object-specific fields sich as transforms to SceneObject later104 // since I'll be adding other object-specific fields such as transforms to SceneObject later 93 105 vector<SceneObject<VertexType>> objects; 94 106 … … 410 422 411 423 template<class VertexType> 412 constvector<SceneObject<VertexType>>& GraphicsPipeline_Vulkan<VertexType>::getObjects() {424 vector<SceneObject<VertexType>>& GraphicsPipeline_Vulkan<VertexType>::getObjects() { 413 425 return objects; 414 426 } … … 428 440 idx += numVertices; 429 441 } 430 objects.push_back({ vertices, indices });442 objects.push_back({ vertices, indices, mat4(1.0f), mat4(1.0f) }); 431 443 432 444 VulkanUtils::copyDataToBuffer(device, physicalDevice, commandPool, vertices, vertexBuffer, numVertices,
Note:
See TracChangeset
for help on using the changeset viewer.