Engine
Frameworkcreatedbymeusableforthecreationofsimplegames.CurrentlysupportsOpenGL(Verysimple)andVulkan.
Mesh.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Engine/api.hpp"
7 #include <ThirdParty/EASTL-master/include/EASTL/vector.h>
8 
9 namespace Engine
10 {
15  {
16  public:
20  eastl::vector<Vertex> vertices;
24  eastl::vector<unsigned> indices;
25 
30  uint64_t GetVAO() const;
31  template<typename T>
36  T GetVAO();
37 
42  uint64_t GetVBO() const;
43  template<typename T>
48  T GetVBO();
49 
54  uint64_t GetEBO() const;
55  template <typename T>
60  T GetEBO();
61 
66  uint64_t GetUBO() const;
67  template <typename T>
72  T GetUBO();
73 
77  eastl::string name;
78 
84  bool operator==(Mesh& other);
90  bool operator!=(Mesh& other);
91 
92  private:
93 
94  friend class ResourceManager;
95 #ifdef USING_OPENGL
96  friend class OpenGLMesh;
97 #endif
98 #ifdef USING_VULKAN
99  friend class VulkanMesh;
100 #endif
101 
102  Mesh() = delete;
103  Mesh(eastl::vector<Vertex> vertices, eastl::vector<unsigned> indices);
104  virtual ~Mesh() noexcept;
105 
106  //render data
107  //TODO use this function to set up additional variables that you might need for the mesh
108  virtual void SetUpMesh();
109  protected:
110  uint64_t vao, vbo, ebo, ubo;
111  };
112 
113  template <typename T>
114  T Mesh::GetVAO()
115  {
116  return T(vao);
117  }
118 
119  template <typename T>
121  {
122  return T(vbo);
123  }
124 
125  template <typename T>
127  {
128  return T(ebo);
129  }
130 
131  template <typename T>
133  {
134  return T(ubo);
135  }
136 
137 } // namespace Engine
#define ENGINE_API
Definition: api.hpp:25
eastl::vector< unsigned > indices
The indices of this mesh.
Definition: Mesh.hpp:24
uint64_t GetVBO() const
This method allows you to get the VBO of this mesh.
Definition: Mesh.cpp:30
uint64_t GetEBO() const
This method allows you to get the EBO of this mesh.
Definition: Mesh.cpp:35
This class is used to create models, load in meshes and textures. NOTE: Only the Engine is allowed to...
eastl::vector< Vertex > vertices
The vertices of this mesh.
Definition: Mesh.hpp:20
eastl::string name
The name of this mesh.
Definition: Mesh.hpp:77
This object is used to store data regarding a mesh. NOTE: only the resource manager is allowed to cre...
Definition: Mesh.hpp:14
uint64_t GetUBO() const
This method allows you to get the UBO of this mesh.
Definition: Mesh.cpp:40