Oxygine  1
2g game engine
VertexDeclaration.h
1 #pragma once
2 #include "oxygine-include.h"
3 #include "vertex.h"
4 namespace oxygine
5 {
7  {
8  public:
9  VertexDeclaration(): bformat(0), numElements(0), size(0) {}
10 
11  bvertex_format bformat;
12  int size;
13 
14  int numElements;
15  };
16 
17  template <class T>
19  {
20  public:
21  const T* get(bvertex_format bformat)
22  {
23  for (int i = 0; i < NUM; ++i)
24  {
25  T& decl = _declarations[i];
26  if (decl.bformat == 0)
27  decl.init(bformat);
28 
29  if (decl.bformat == bformat)
30  return &decl;
31  }
32 
33  return 0;
34  }
35 
36  protected:
37  enum {NUM = 8};
38  T _declarations[NUM];
39  };
40 }
Definition: VertexDeclaration.h:6
–oxgl-end–!
Definition: Actor.h:14
Definition: VertexDeclaration.h:18