1 #ifndef AWFUL_SCENEGRAPH_GEOMETRY_H_
2 #define AWFUL_SCENEGRAPH_GEOMETRY_H_
6 #include "IndexBuffer.h"
7 #include "VertexBuffer.h"
10 namespace awful
{ namespace scenegraph
12 class Geometry
: public Serializable
15 Geometry( Pointer
< VertexBuffer
> pVertices
, Pointer
< IndexBuffer
> pIndices
) :
16 m_pVertexBuffer( pVertices
),
17 m_pIndexBuffer( pIndices
)
21 Geometry( const Serialization_tag
& ) {}
23 const Pointer
< VertexBuffer
>& getpVertexBuffer() const { return m_pVertexBuffer
; }
24 void setpVertexBuffer( const Pointer
< VertexBuffer
>& x
) { m_pVertexBuffer
= x
; }
26 const Pointer
< IndexBuffer
>& getpIndexBuffer() const { return m_pIndexBuffer
; }
27 void setpIndexBuffer( const Pointer
< IndexBuffer
>& x
) { m_pIndexBuffer
= x
; }
29 void addPrimitive( const Primitive
& Prim
)
31 m_Primitives
.push_back( Prim
);
34 void addPrimitive( enum Primitive::e_Type Type_
, uint32_t Start_
, uint32_t Count_
)
36 addPrimitive( Primitive( Type_
, Start_
, Count_
) );
41 m_pIndexBuffer
->bind();
42 m_pVertexBuffer
->renderSetup();
43 std::vector
< Primitive
>::const_iterator it
;
44 for( it
= m_Primitives
.begin(); it
!= m_Primitives
.end(); ++it
)
49 template< class C
, typename T
> friend struct awful::attribute_traits
;
50 Pointer
< VertexBuffer
> m_pVertexBuffer
;
51 Pointer
< IndexBuffer
> m_pIndexBuffer
;
52 std::vector
< Primitive
> m_Primitives
;