NAP
vertexattributedeclaration.h
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4 
5 #pragma once
6 
7 // External Includes
8 #include <string>
9 #include <unordered_map>
10 #include "vulkan/vulkan_core.h"
11 #include "rtti/typeinfo.h"
12 
13 namespace nap
14 {
19  {
20  public:
21  // Constructor
22  VertexAttributeDeclaration(const std::string& name, int location, int elementSize, VkFormat format);
23  VertexAttributeDeclaration() = delete;
24 
25  std::string mName;
26  int mLocation;
28  VkFormat mFormat;
29  };
30 
31  using VertexAttributeDeclarations = std::unordered_map<std::string, std::unique_ptr<VertexAttributeDeclaration>>;
32 }
33 
35 // Hash
37 namespace std
38 {
39  template<>
40  struct hash<nap::VertexAttributeDeclaration>
41  {
42  size_t operator()(const nap::VertexAttributeDeclaration &k) const
43  {
44  return hash<std::string>()(k.mName);
45  }
46  };
47 }
nap::VertexAttributeDeclaration::VertexAttributeDeclaration
VertexAttributeDeclaration()=delete
nap::VertexAttributeDeclaration::mName
std::string mName
Name of the shader attribute.
Definition: vertexattributedeclaration.h:25
nap::VertexAttributeDeclaration::mFormat
VkFormat mFormat
Definition: vertexattributedeclaration.h:28
nap::VertexAttributeDeclarations
std::unordered_map< std::string, std::unique_ptr< VertexAttributeDeclaration > > VertexAttributeDeclarations
Definition: vertexattributedeclaration.h:31
nap::VertexAttributeDeclaration::mLocation
int mLocation
Definition: vertexattributedeclaration.h:26
nap::VertexAttributeDeclaration
Definition: vertexattributedeclaration.h:18
nap
Definition: templateapp.h:17
nap::VertexAttributeDeclaration::mElementSize
int mElementSize
Element size of this vertex.
Definition: vertexattributedeclaration.h:27