Changeset b7fc3c2 in opengl-game for sdl-game.hpp


Ignore:
Timestamp:
Jun 10, 2021, 2:58:54 PM (3 years ago)
Author:
Dmitry Portnoy <dportnoy@…>
Branches:
feature/imgui-sdl
Children:
c1ec4f6
Parents:
bb76950
git-author:
Dmitry Portnoy <dportnoy@…> (06/10/21 14:53:52)
git-committer:
Dmitry Portnoy <dportnoy@…> (06/10/21 14:58:54)
Message:

Modify the VulkanBuffer class to take a range and to align data based on that rather than the size of an individual data item. Also, reorganize the code in VulkanGae::updateScene() in a more logical fashion, and remove VulkanGame::updateObject() and inline its functionality.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sdl-game.hpp

    rbb76950 rb7fc3c2  
    323323      void centerObject(SceneObject<VertexType, SSBOType>& object);
    324324
    325       template<class VertexType, class SSBOType>
    326       void updateObject(SceneObject<VertexType, SSBOType>& obj);
    327 
    328325      void renderFrame(ImDrawData* draw_data);
    329326      void presentFrame();
     
    353350}
    354351
    355 // TODO: Right now, it's basically necessary to pass the identity matrix in for ssbo.model
    356 // and to change the model matrix later by setting model_transform and then calling updateObject()
     352// TODO: Right now, it's basically necessary to pass the identity matrix in for ssbo.model and to change
     353// the model matrix later by setting model_transform and then calculating the new ssbo.model.
    357354// Figure out a better way to allow the model matrix to be set during object creation
    358355template<class VertexType, class SSBOType>
     
    362359                                                         VulkanBuffer<SSBOType>& objectBuffer, SSBOType ssbo) {
    363360   // TODO: Use the model field of ssbo to set the object's model_base
    364    // currently, the passed in model is useless since it gets overridden in updateObject() anyway
     361   // currently, the passed-in model is useless since it gets overridden when ssbo.model is recalculated
    365362   size_t numVertices = pipeline.getNumVertices();
    366363
     
    464461}
    465462
    466 // TODO: Just pass in the single object instead of a list of all of them
    467 template<class VertexType, class SSBOType>
    468 void VulkanGame::updateObject(SceneObject<VertexType, SSBOType>& obj) {
    469    obj.ssbo.model = obj.model_transform * obj.model_base;
    470    obj.center = vec3(obj.ssbo.model * vec4(0.0f, 0.0f, 0.0f, 1.0f));
    471 
    472    obj.modified = false;
    473 }
    474 
    475463#endif // _SDL_GAME_H
Note: See TracChangeset for help on using the changeset viewer.