IVertexBuffer.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <ionCore.h>
5 
6 #include "Enums.h"
7 
8 
9 namespace ion
10 {
11  namespace Graphics
12  {
13 
16  {
17  string Name = "";
18  int Components = 1;
20 
21  SInputLayoutElement(string const & Name, int const Components, EAttributeType const Type)
22  {
23  this->Name = Name;
24  this->Components = Components;
25  this->Type = Type;
26  }
27  };
28 
31  {
32 
33  public:
34 
35  virtual ~IVertexBuffer()
36  {}
37 
38  template <typename T>
39  void UploadData(vector<T> const & Data)
40  {
41  UploadData(Data.data(), sizeof(T), Data.size());
42  }
43 
44  template <typename T>
45  void UploadSubData(vector<T> const & Data, size_t const Offset)
46  {
47  UploadSubData(Data.data(), sizeof(T), Offset, Data.size());
48  }
49 
50  virtual void UploadData(void const * const Data, size_t const DataSize, size_t const NumberOfElements) = 0;
51  virtual void UploadSubData(void const * const Data, size_t const DataSize, size_t const Offset, size_t const NumberOfElements) = 0;
52 
53  virtual void SetInputLayout(SInputLayoutElement const * const InputLayout, int const NumElements) = 0;
54 
55  virtual void SetInstancingEnabled(bool const Enabled) = 0;
56 
57  };
58 
59  }
60 }
void UploadSubData(vector< T > const &Data, size_t const Offset)
Definition: IVertexBuffer.h:45
SInputLayoutElement(string const &Name, int const Components, EAttributeType const Type)
Definition: IVertexBuffer.h:21
void UploadData(vector< T > const &Data)
Definition: IVertexBuffer.h:39
Definition: CCatmullRomAdvancedSplineInterpolator.h:7
EAttributeType
Possible types for attributes i.e. vertex buffer contents.
Definition: Enums.h:48
virtual ~IVertexBuffer()
Definition: IVertexBuffer.h:35
int Components
Definition: IVertexBuffer.h:18
string Name
Definition: IVertexBuffer.h:17
EAttributeType Type
Definition: IVertexBuffer.h:19
Lightweight wrapper for std::type_info that enables sorting (e.g. for use in a std::map) ...
Definition: ionClass.h:180
Definition: IVertexBuffer.h:30
Definition: IVertexBuffer.h:15