Changeset 8dcbf62 in opengl-game for vulkan-game.cpp


Ignore:
Timestamp:
Jun 8, 2021, 11:19:16 PM (3 years ago)
Author:
Dmitry Portnoy <dportnoy@…>
Branches:
feature/imgui-sdl
Children:
6bac215
Parents:
8aa4888
git-author:
Dmitry Portnoy <dportnoy@…> (06/08/21 20:38:16)
git-committer:
Dmitry Portnoy <dportnoy@…> (06/08/21 23:19:16)
Message:

Add some functionality to VulkanBuffer, and modify VulkanGame::addObject() to call VulkanBuffer::add()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vulkan-game.cpp

    r8aa4888 r8dcbf62  
    160160      {
    161161         0, 1, 2, 3, 4, 5
    162       }, {
     162      }, objects_modelPipeline, {
    163163         mat4(1.0f)
    164164      });
    165 
    166    objects_modelPipeline.numObjects++;
    167165
    168166   texturedSquare->model_base =
     
    182180      {
    183181         0, 1, 2, 3, 4, 5
    184       }, {
     182      }, objects_modelPipeline, {
    185183         mat4(1.0f)
    186184      });
    187 
    188    objects_modelPipeline.numObjects++;
    189185
    190186   texturedSquare->model_base =
     
    445441         132, 133, 134,
    446442         135, 136, 137,
    447       }, {
     443      }, objects_shipPipeline, {
    448444         mat4(1.0f)
    449445      });
    450 
    451    objects_shipPipeline.numObjects++;
    452446
    453447   ship.model_base =
     
    781775                        {
    782776                           0, 1, 2, 3, 4, 5
    783                         }, {
     777                        }, objects_modelPipeline, {
    784778                           mat4(1.0f)
    785779                        });
    786 
    787                   objects_modelPipeline.numObjects++;
    788780
    789781                  texturedSquare.model_base =
     
    10631055               24, 25, 26, 27, 28, 29,
    10641056               30, 31, 32, 33, 34, 35,
    1065             }, {
     1057            }, objects_asteroidPipeline, {
    10661058               mat4(1.0f),
    10671059               10.0f,
    10681060               false
    10691061            });
    1070 
    1071       objects_asteroidPipeline.numObjects++;
    10721062
    10731063      // This accounts for the scaling in model_base.
     
    15511541void VulkanGame::createImageResources() {
    15521542   VulkanUtils::createDepthImage(device, physicalDevice, resourceCommandPool, findDepthFormat(), swapChainExtent,
    1553       depthImage, graphicsQueue);
     1543                                 depthImage, graphicsQueue);
    15541544
    15551545   createTextureSampler();
     
    19791969          4, 5, 1, 4, 1, 0,
    19801970          6, 7, 5, 6, 5, 4
    1981       }, {
     1971      }, objects_laserPipeline, {
    19821972         mat4(1.0f),
    19831973         color,
    19841974         false
    19851975      });
    1986 
    1987    objects_laserPipeline.numObjects++;
    19881976
    19891977   float xAxisRotation = asin(ray.y / length);
     
    21872175   iota(indices.begin(), indices.end(), 0);
    21882176
    2189    SceneObject<ExplosionVertex, SSBO_Explosion>& explosion = addObject(
    2190       explosionObjects, explosionPipeline, addObjectIndex(explosionObjects.size(), vertices), indices, {
     2177   SceneObject<ExplosionVertex, SSBO_Explosion>& explosion = addObject(explosionObjects, explosionPipeline,
     2178      addObjectIndex(explosionObjects.size(), vertices), indices, objects_explosionPipeline, {
    21912179         mat4(1.0f),
    21922180         cur_time,
     
    21952183      });
    21962184
    2197    objects_explosionPipeline.numObjects++;
    2198 
    21992185   explosion.model_base = model_mat;
    22002186   explosion.model_transform = mat4(1.0f);
     
    22162202   // and resizing the window is a common reason to recreate the swapchain
    22172203   VulkanUtils::createDepthImage(device, physicalDevice, resourceCommandPool, findDepthFormat(), swapChainExtent,
    2218       depthImage, graphicsQueue);
     2204                                 depthImage, graphicsQueue);
    22192205
    22202206   createRenderPass();
Note: See TracChangeset for help on using the changeset viewer.