1 #ifndef AWFUL_SCENEGRAPH_GEOMETRY_H_
2 #define AWFUL_SCENEGRAPH_GEOMETRY_H_
5 #include "scenegraph/scenegraph_export.h"
7 #include "IndexBuffer.h"
8 #include "VertexBuffer.h"
11 namespace awful
{ namespace scenegraph
13 class AWSCENEGRAPH_EXPORT Geometry
: public Serializable
16 Geometry( Pointer
< VertexBuffer
> pVertices
, Pointer
< IndexBuffer
> pIndices
);
17 Geometry( const Serialization_tag
& );
19 const Pointer
< VertexBuffer
>& getpVertexBuffer() const { return m_pVertexBuffer
; }
20 void setpVertexBuffer( const Pointer
< VertexBuffer
>& x
) { m_pVertexBuffer
= x
; }
22 const Pointer
< IndexBuffer
>& getpIndexBuffer() const { return m_pIndexBuffer
; }
23 void setpIndexBuffer( const Pointer
< IndexBuffer
>& x
) { m_pIndexBuffer
= x
; }
25 void addPrimitive( const Primitive
& Prim
)
27 m_Primitives
.push_back( Prim
);
30 void addPrimitive( enum Primitive::e_Type Type_
, uint32_t Start_
, uint32_t Count_
)
32 addPrimitive( Primitive( Type_
, Start_
, Count_
) );
37 m_pIndexBuffer
->bind();
38 m_pVertexBuffer
->renderSetup();
39 std::vector
< Primitive
>::const_iterator it
;
40 for( it
= m_Primitives
.begin(); it
!= m_Primitives
.end(); ++it
)
45 template< class C
, typename T
> friend struct awful::attribute_traits
;
46 Pointer
< VertexBuffer
> m_pVertexBuffer
;
47 Pointer
< IndexBuffer
> m_pIndexBuffer
;
48 std::vector
< Primitive
> m_Primitives
;