My Project
DynamicRenderable.h
1 #pragma once
2 
3 namespace ParaEngine
4 {
16  {
17  public:
18  CDynamicRenderable(void);
19  virtual ~CDynamicRenderable(void);
20 
21  /* Renders a sequence of nonindexed, geometric primitives of the specified type from
22  the current set of vertex data */
23  HRESULT DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount);
24 
27  HRESULT DrawIndexedPrimitive(D3DPRIMITIVETYPE Type, INT BaseVertexIndex,UINT MinIndex,UINT NumVertices, UINT StartIndex,UINT PrimitiveCount);
28 
33  void PrepareBuffers(int nVertexCount, int nIndexCount);
34 
36  bool lock();
38  bool unlock();
39 
40  public:
41  // current vertex format: current only POS|Normal|UV is supported.
42  int m_nFVF;
43  int m_nVertexBufSize;
44  int m_nIndexBufSize;
45  //
46  // Vertex data
47  //
48  vector <Vector3> m_Positions;
49  vector <Vector3> m_Normals;
50  vector <DWORD> m_Colors;
51  vector <Vector2> m_UVs;
52 
53  // index buffer
54  vector <unsigned short> m_indices;
55  };
56 
57 }
HRESULT DrawIndexedPrimitive(D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinIndex, UINT NumVertices, UINT StartIndex, UINT PrimitiveCount)
Based on indexing, renders the specified geometric primitive into an array of vertices.
Definition: DynamicRenderable.cpp:115
a base class for rendering objects using dynamic buffer from memory data.
Definition: DynamicRenderable.h:15
different physics engine has different winding order.
Definition: EventBinding.h:32
bool lock()
it locks everything for the caller to prevent simultaneous access.
Definition: DynamicRenderable.cpp:28
bool unlock()
it unlocks everything for the caller to prevent simultaneous access.
Definition: DynamicRenderable.cpp:34
void PrepareBuffers(int nVertexCount, int nIndexCount)
call this function when the vertex or index buffer size changes.
Definition: DynamicRenderable.cpp:40