Advertisement
Ember

fetch

Dec 17th, 2015
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 KB | None | 0 0
  1. // Get the model header
  2. auto lookupmodel = resourceManager->Resources.find(node->Attachment);
  3. if(lookupmodel == resourceManager->Resources.end()) { Error("buh"); }
  4. // -- //
  5. auto model = (Model*)lookupmodel->second;
  6.  
  7. // Get the mesh
  8. auto lookupmesh = resourceManager->Resources.find(model->Presets[0].Meshes[0].Handle); // lol
  9. if(lookupmesh == resourceManager->Resources.end()) { Error("buh"); }
  10. // -- //
  11. auto mesh = (Mesh*)lookupmesh->second;
  12.  
  13. // Get the vertex and index buffers
  14. auto lookupvbuffer = resourceManager->Resources.find(mesh->VertexBufferID.Handle);
  15. auto lookupibuffer = resourceManager->Resources.find(mesh->IndexBufferID.Handle);
  16. if(lookupvbuffer == resourceManager->Resources.end()) { Error("buh"); }
  17. if(lookupibuffer == resourceManager->Resources.end()) { Error("buh"); }
  18. // -- //
  19. auto vbuffer = (Buffer*)lookupvbuffer->second;
  20. auto ibuffer = (Buffer*)lookupibuffer->second;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement