texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
texturedQuadVertexFormat["aVertexCoord"] = Property::VECTOR2;
- PropertyBuffer vertexData = PropertyBuffer::New( PropertyBuffer::STATIC,
- texturedQuadVertexFormat, 4 );
+ PropertyBuffer vertexData = PropertyBuffer::New( texturedQuadVertexFormat, 4 );
return vertexData;
}
{ Vector2( halfQuadSize, halfQuadSize), Vector2(1.f, 1.f) } };
vertexData.SetData(texturedQuadVertexData);
- unsigned short indexData[6] = { 0, 3, 1, 0, 2, 3 };
+ unsigned int indexData[6] = { 0, 3, 1, 0, 2, 3 };
Property::Map indexFormat;
- indexFormat["indices"] = Property::UNSIGNED_INTEGER; // Should be Unsigned Short
- PropertyBuffer indices = PropertyBuffer::New( PropertyBuffer::STATIC, indexFormat, 3 );
+ indexFormat["indices"] = Property::UNSIGNED_INTEGER;
+ PropertyBuffer indices = PropertyBuffer::New( indexFormat, sizeof(indexData)/sizeof(indexData[0]) );
indices.SetData(indexData);
Geometry geometry = Geometry::New();
texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
texturedQuadVertexFormat["aVertexCoord"] = Property::VECTOR2;
- PropertyBuffer propertyBuffer = PropertyBuffer::New( PropertyBuffer::STATIC,
- texturedQuadVertexFormat, 4 );
+ PropertyBuffer propertyBuffer = PropertyBuffer::New( texturedQuadVertexFormat, 4 );
DALI_TEST_EQUALS( (bool)propertyBuffer, true, TEST_LOCATION );
END_TEST;
texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
texturedQuadVertexFormat["aVertexCoord"] = Property::VECTOR2;
- PropertyBuffer propertyBuffer = PropertyBuffer::New( PropertyBuffer::STATIC,
- texturedQuadVertexFormat, 4 );
+ PropertyBuffer propertyBuffer = PropertyBuffer::New( texturedQuadVertexFormat, 4 );
BaseHandle handle(propertyBuffer);
PropertyBuffer propertyBuffer2 = PropertyBuffer::DownCast(handle);
tet_infoline("Test that a uniform map propertyBuffer property can be constrained");
- Shader shader = Shader::New("VertexSource", "FragmentSource");
+ Shader shader = Shader::New( "VertexSource", "FragmentSource" );
Material material = Material::New( shader );
material.SetProperty(Material::Property::COLOR, Color::WHITE);
texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
texturedQuadVertexFormat["aVertexCoord"] = Property::VECTOR2;
- PropertyBuffer propertyBuffer = PropertyBuffer::New( PropertyBuffer::STATIC,
- texturedQuadVertexFormat, 4 );
+ PropertyBuffer propertyBuffer = PropertyBuffer::New( texturedQuadVertexFormat, 4 );
DALI_TEST_EQUALS( (bool)propertyBuffer, true, TEST_LOCATION );
const float halfQuadSize = .5f;
texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
texturedQuadVertexFormat["aVertexCoord"] = Property::VECTOR2;
- PropertyBuffer propertyBuffer = PropertyBuffer::New( PropertyBuffer::STATIC,
- texturedQuadVertexFormat, 4 );
+ PropertyBuffer propertyBuffer = PropertyBuffer::New( texturedQuadVertexFormat, 4 );
DALI_TEST_EQUALS( (bool)propertyBuffer, true, TEST_LOCATION );
const float halfQuadSize = .5f;
texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
texturedQuadVertexFormat["aVertexCoord"] = Property::VECTOR2;
- PropertyBuffer propertyBuffer = PropertyBuffer::New( PropertyBuffer::STATIC,
- texturedQuadVertexFormat,
- 4u );
+ PropertyBuffer propertyBuffer = PropertyBuffer::New( texturedQuadVertexFormat, 4u );
DALI_TEST_EQUALS( (bool)propertyBuffer, true, TEST_LOCATION );
size_t size = propertyBuffer.GetSize();
new SceneGraph::PropertyBuffer::BufferType( mBuffer ) );
}
-Dali::Property::Index PropertyBuffer::GetPropertyIndex( const std::string name, std::size_t index )
-{
- //TODO: MESH_REWORK
- DALI_ASSERT_ALWAYS( false && "MESH_REWORK" );
- return 0;
-}
-
const SceneGraph::PropertyBuffer* PropertyBuffer::GetPropertyBufferSceneObject() const
{
return mSceneObject;
}
-void PropertyBuffer::SetType( Dali::PropertyBuffer::Type type )
-{
- DALI_ASSERT_DEBUG( mType == Dali::PropertyBuffer::TYPE_COUNT && "Type can only be set once." );
- DALI_ASSERT_DEBUG( type != Dali::PropertyBuffer::TYPE_COUNT && "Type must be set to a valid value." );
-
- mType = type;
-}
-
void PropertyBuffer::SetFormat( Dali::Property::Map& format )
{
DALI_ASSERT_ALWAYS( format.Count() && "Format cannot be empty." );
: mSceneObject( NULL ),
mBufferFormat( NULL ),
mSize( 0 ),
- mType( Dali::PropertyBuffer::TYPE_COUNT ),
mOnStage( false )
{
}
const SceneGraph::PropertyBuffer* GetPropertyBufferSceneObject() const;
/**
- * @brief Set the type of PropertyBuffer
- *
- * @pre Has not been set yet
- *
- * @param[in] type of PropertyBuffer
- */
- void SetType( Dali::PropertyBuffer::Type type );
-
- /**
* @brief Set the format of the PropertyBuffer
*
* @pre Has not been set yet
Property::Map mFormat; ///< Format of the property buffer
const SceneGraph::PropertyBufferMetadata::Format* mBufferFormat; ///< Metadata for the format of the property buffer
unsigned int mSize; ///< Number of elements in the buffer
- Dali::PropertyBuffer::Type mType; ///< Type of propertyBuffer
Dali::Vector< char > mBuffer; // Data of the property-buffer
bool mOnStage; ///< Flag to know if the object is on stage
namespace Dali
{
-PropertyBuffer PropertyBuffer::New( Type type, Dali::Property::Map& bufferFormat, std::size_t size )
+PropertyBuffer PropertyBuffer::New( Dali::Property::Map& bufferFormat, std::size_t size )
{
Internal::PropertyBufferPtr propertyBuffer = Internal::PropertyBuffer::New();
- propertyBuffer->SetType( type );
propertyBuffer->SetFormat( bufferFormat );
propertyBuffer->SetSize( size );
GetImplementation(*this).SetData( data );
}
-Dali::Property::Index PropertyBuffer::GetPropertyIndex( const std::string name, std::size_t index )
-{
- return GetImplementation(*this).GetPropertyIndex( name, index );
-}
-
PropertyBuffer::PropertyBuffer( Internal::PropertyBuffer* pointer )
: Handle( pointer )
{
* Property::Map texturedQuadVertexFormat;
* texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
* texturedQuadVertexFormat["aTexCoord"] = Property::VECTOR2;
- * PropertyBuffer texturedQuadVertices = PropertyBuffer::New( PropertyBuffer::STATIC, texturedQuadVertexFormat, 4 );
+ * PropertyBuffer texturedQuadVertices = PropertyBuffer::New( texturedQuadVertexFormat, 4 );
* texturedQuadVertices.SetData(texturedQuadVertexData);
*
* // Create indices
- * unsigned short indexData[6] = { 0, 3, 1, 0, 2, 3 };
+ * unsigned int indexData[6] = { 0, 3, 1, 0, 2, 3 };
* Property::Map indexFormat;
* indexFormat["indices"] = Property::UNSIGNED_INTEGER;
- * PropertyBuffer indices = PropertyBuffer::New( PropertyBuffer::STATIC, indexFormat, 6 );
+ * PropertyBuffer indices = PropertyBuffer::New( indexFormat, 6 );
* indices.SetData(indexData);
*
* // Create the geometry object
public:
/**
- * @brief Type of property buffer
- */
- enum Type
- {
- STATIC, ///< The property buffer properties will not be animatable
- ANIMATABLE, ///< The property buffer properties will be animatable
- TYPE_COUNT, ///< Number of different types
- };
-
- /**
* @brief An enumeration of properties belonging to the PropertyBuffer class.
*/
struct Property
*
* Static property buffers use less memory.
*
- * @param[in] type Type of property buffer, will make properties animatable or not
* @param[in] bufferFormat Map of names and types that describes the components of the buffer
* @param[in] size The number of elements in the property buffer
* @return Handle to a newly allocated PropertyBuffer
*/
- static PropertyBuffer New( Type type, Dali::Property::Map& bufferFormat, std::size_t size );
+ static PropertyBuffer New( Dali::Property::Map& bufferFormat, std::size_t size );
/**
* @brief Default constructor, creates an empty handle
*/
void SetData( void* data );
- /**
- * @brief Get the property index for a value in the buffer
- *
- * @param[in] name Name of the component
- * @param[in] index Index of the object in the buffer
- *
- * Indices are calculated as follows:
- * NumberOfComponents * index + OffsetOf( name )
- * Example:
- * For a PropertyBuffer with 2 components {"position", "normal"}
- * The Property::Index for the property "position" in the 20th object would be:
- * Property::Index( 2 * 19 + 0 ) => Property::Index( 38 )
- */
- Dali::Property::Index GetPropertyIndex( const std::string name, std::size_t index );
-
public:
/**
* @brief The constructor