Dali 3D User Interface Engine
List of all members | Public Types | Public Member Functions | Private Attributes
Dali::Internal::SceneGraph::RenderGeometry Class Reference

This class encapsulates the GPU buffers. More...

#include <render-geometry.h>

Collaboration diagram for Dali::Internal::SceneGraph::RenderGeometry:
Collaboration graph
[legend]

Public Types

typedef
SceneGraph::Geometry::GeometryType 
GeometryType
 

Public Member Functions

 RenderGeometry (GeometryType geometryType, bool requiresDepthTest)
 Constructor. More...
 
 ~RenderGeometry ()
 Destructor. More...
 
void GlContextCreated (Context &context)
 Called on Gl Context created. More...
 
void GlContextDestroyed ()
 Called on Gl Context destroyed. More...
 
void AddPropertyBuffer (Render::PropertyBuffer *propertyBuffer, bool isIndexBuffer)
 Adds a property buffer to the geometry. More...
 
void RemovePropertyBuffer (const Render::PropertyBuffer *propertyBuffer)
 Removes a PropertyBuffer from the geometry. More...
 
void GetAttributeLocationFromProgram (Vector< GLint > &attributeLocation, Program &program, BufferIndex bufferIndex) const
 Gets the attribute locations on the shader for the attributes defined in the geometry RenderBuffers. More...
 
void OnRenderFinished ()
 Called from RenderManager to notify the geometry that current rendering pass has finished. More...
 
bool AttributesChanged () const
 Chack if the attributes for the geometry have changed. More...
 
void SetGeometryType (GeometryType type)
 Sets the geometry type. More...
 
void SetRequiresDepthTest (bool requiresDepthTest)
 Sets if the geometry requires depth testing. More...
 
bool RequiresDepthTest () const
 Check if geometry requires depth testing. More...
 
void UploadAndDraw (Context &context, BufferIndex bufferIndex, Vector< GLint > &attributeLocation)
 Upload the geometry if it has changed, set up the attributes and perform the Draw call corresponding to the geometry type. More...
 

Private Attributes

Render::PropertyBuffermIndexBuffer
 
Vector< Render::PropertyBuffer * > mVertexBuffers
 
GeometryType mGeometryType
 
bool mRequiresDepthTest: 1
 
bool mHasBeenUpdated: 1
 
bool mAttributesChanged: 1
 

Detailed Description

This class encapsulates the GPU buffers.

It is used to upload vertex data to it's GPU buffers, to bind all the buffers and to setup/teardown vertex attribute bindings

Definition at line 49 of file render-geometry.h.

Member Typedef Documentation

Definition at line 53 of file render-geometry.h.

Constructor & Destructor Documentation

Dali::Internal::SceneGraph::RenderGeometry::RenderGeometry ( GeometryType  geometryType,
bool  requiresDepthTest 
)

Constructor.

Creates a render geometry object with no GPU buffers.

Parameters
[in]centerThe center of the geometry
[in]geometryTypeThe geometry type
[in]requiresDepthTestTrue if geometry requires depth testing, false otherwise

Definition at line 31 of file render-geometry.cpp.

Dali::Internal::SceneGraph::RenderGeometry::~RenderGeometry ( )

Destructor.

Definition at line 40 of file render-geometry.cpp.

Member Function Documentation

void Dali::Internal::SceneGraph::RenderGeometry::AddPropertyBuffer ( Render::PropertyBuffer propertyBuffer,
bool  isIndexBuffer 
)

Adds a property buffer to the geometry.

Parameters
[in]dataProviderThe PropertyBuffer data provider
[in]isIndexBufferTrue if the property buffer is intended to be used as an index buffer

Definition at line 52 of file render-geometry.cpp.

References mAttributesChanged, mIndexBuffer, mVertexBuffers, and Dali::Vector< T, IsTrivialType >::PushBack().

Referenced by Dali::Internal::SceneGraph::Geometry::GetRenderGeometry().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Dali::Internal::SceneGraph::RenderGeometry::AttributesChanged ( ) const
inline

Chack if the attributes for the geometry have changed.

Returns
True if vertex buffers have been added or removed since last frame, false otherwise

Definition at line 106 of file render-geometry.h.

References mAttributesChanged.

Referenced by Dali::Internal::Render::Renderer::Render().

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::RenderGeometry::GetAttributeLocationFromProgram ( Vector< GLint > &  attributeLocation,
Program program,
BufferIndex  bufferIndex 
) const

Gets the attribute locations on the shader for the attributes defined in the geometry RenderBuffers.

Parameters
[out]attributeLocationThe vector where the attributes locations will be stored
[in]programThe program
[in]bufferIndexThe current buffer index

Definition at line 87 of file render-geometry.cpp.

References Dali::Vector< T, IsTrivialType >::Clear(), DALI_LOG_WARNING, Dali::Internal::Program::GetCustomAttributeLocation(), mVertexBuffers, Dali::Vector< T, IsTrivialType >::PushBack(), Dali::Internal::Program::RegisterCustomAttribute(), and Dali::VectorBase::Size().

Referenced by Dali::Internal::Render::Renderer::Render().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::RenderGeometry::GlContextCreated ( Context context)

Called on Gl Context created.

Definition at line 44 of file render-geometry.cpp.

void Dali::Internal::SceneGraph::RenderGeometry::GlContextDestroyed ( )

Called on Gl Context destroyed.

Definition at line 48 of file render-geometry.cpp.

Referenced by Dali::Internal::Render::Renderer::GlContextDestroyed().

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::RenderGeometry::OnRenderFinished ( )

Called from RenderManager to notify the geometry that current rendering pass has finished.

Definition at line 110 of file render-geometry.cpp.

References mAttributesChanged, and mHasBeenUpdated.

void Dali::Internal::SceneGraph::RenderGeometry::RemovePropertyBuffer ( const Render::PropertyBuffer propertyBuffer)

Removes a PropertyBuffer from the geometry.

Parameters
[in]propertyBufferThe property buffer to be removed

Definition at line 65 of file render-geometry.cpp.

References Dali::Vector< T, IsTrivialType >::Begin(), mAttributesChanged, mIndexBuffer, mVertexBuffers, Dali::Vector< T, IsTrivialType >::Remove(), and Dali::VectorBase::Size().

Here is the call graph for this function:

bool Dali::Internal::SceneGraph::RenderGeometry::RequiresDepthTest ( ) const
inline

Check if geometry requires depth testing.

Returns
True if depth testing is required, false otherwise

Definition at line 133 of file render-geometry.h.

References mRequiresDepthTest.

Referenced by Dali::Internal::Render::Renderer::RequiresDepthTest().

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::RenderGeometry::SetGeometryType ( GeometryType  type)
inline

Sets the geometry type.

Parameters
[in]typeThe new geometry type

Definition at line 115 of file render-geometry.h.

References mGeometryType.

Referenced by Dali::Internal::SceneGraph::RenderManager::SetGeometryType().

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::RenderGeometry::SetRequiresDepthTest ( bool  requiresDepthTest)
inline

Sets if the geometry requires depth testing.

Parameters
[in]requiresDepthTestTrue if depth testing is required, false otherwise

Definition at line 124 of file render-geometry.h.

References mRequiresDepthTest.

Referenced by Dali::Internal::SceneGraph::RenderManager::SetGeometryRequiresDepthTest().

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::RenderGeometry::UploadAndDraw ( Context context,
BufferIndex  bufferIndex,
Vector< GLint > &  attributeLocation 
)

Member Data Documentation

bool Dali::Internal::SceneGraph::RenderGeometry::mAttributesChanged
private
GeometryType Dali::Internal::SceneGraph::RenderGeometry::mGeometryType
private

Definition at line 155 of file render-geometry.h.

Referenced by SetGeometryType(), and UploadAndDraw().

bool Dali::Internal::SceneGraph::RenderGeometry::mHasBeenUpdated
private

Definition at line 159 of file render-geometry.h.

Referenced by OnRenderFinished(), and UploadAndDraw().

Render::PropertyBuffer* Dali::Internal::SceneGraph::RenderGeometry::mIndexBuffer
private

Definition at line 152 of file render-geometry.h.

Referenced by AddPropertyBuffer(), RemovePropertyBuffer(), and UploadAndDraw().

bool Dali::Internal::SceneGraph::RenderGeometry::mRequiresDepthTest
private

Definition at line 158 of file render-geometry.h.

Referenced by RequiresDepthTest(), and SetRequiresDepthTest().

Vector<Render::PropertyBuffer*> Dali::Internal::SceneGraph::RenderGeometry::mVertexBuffers
private

The documentation for this class was generated from the following files:
Dali Docs Home
Read more about Dali