#define DALI_INTERNAL_VERTEX_BUFFER_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// INTERNAL INCLUDES
-#include <dali/public-api/common/dali-common.h> // DALI_ASSERT_ALWAYS
+#include <dali/public-api/common/dali-common.h> // DALI_ASSERT_ALWAYS
#include <dali/public-api/common/intrusive-ptr.h> // Dali::IntrusivePtr
#include <dali/public-api/object/base-object.h>
-#include <dali/public-api/object/property-map.h> // Dali::Property::Map
+#include <dali/public-api/object/property-map.h> // Dali::Property::Map
+#include <dali/public-api/rendering/vertex-buffer.h> // Dali::VertexBuffer
+
#include <dali/internal/event/common/event-thread-services.h>
#include <dali/internal/render/renderers/render-vertex-buffer.h>
namespace Dali
{
+class VertexBuffer;
namespace Internal
{
-
class VertexBuffer;
-typedef IntrusivePtr<VertexBuffer> VertexBufferPtr;
+using VertexBufferPtr = IntrusivePtr<VertexBuffer>;
/**
* VertexBuffer is an object that contains an array of structures of values that
class VertexBuffer : public BaseObject
{
public:
-
/**
* @copydoc PropertBuffer::New()
*/
- static VertexBufferPtr New( Dali::Property::Map& format );
+ static VertexBufferPtr New(Dali::Property::Map& format);
/**
* @copydoc PropertBuffer::SetData()
*/
- void SetData( const void* data, uint32_t size );
+ void SetData(const void* data, uint32_t size);
/**
* @copydoc PropertBuffer::GetSize()
uint32_t GetSize() const;
public: // Default property extensions from Object
-
/**
* @brief Get the render thread side of the VertexBuffer
*
/**
* @brief Destructor
*/
- ~VertexBuffer();
+ ~VertexBuffer() override;
private: // implementation
/**
/**
* Second stage initialization
*/
- void Initialize( Dali::Property::Map& format );
+ void Initialize(Dali::Property::Map& format);
private: // unimplemented methods
- VertexBuffer( const VertexBuffer& );
- VertexBuffer& operator=( const VertexBuffer& );
+ VertexBuffer(const VertexBuffer&);
+ VertexBuffer& operator=(const VertexBuffer&);
-private: // data
- EventThreadServices& mEventThreadServices; ///<Used to send messages to the render thread via update thread
+private: // data
+ EventThreadServices& mEventThreadServices; ///<Used to send messages to the render thread via update thread
Render::VertexBuffer* mRenderObject; ///<Render side object
- uint32_t mBufferFormatSize;
- uint32_t mSize; ///< Number of elements in the buffer
+ uint32_t mBufferFormatSize;
+ uint32_t mSize; ///< Number of elements in the buffer
};
/**
* Get the implementation type from a Property::Type
*/
-template<Property::Type type> struct PropertyImplementationType
+template<Property::Type type>
+struct PropertyImplementationType
{
// typedef ... Type; not defined, only support types declared below
};
-template<> struct PropertyImplementationType< Property::BOOLEAN > { typedef bool Type; };
-template<> struct PropertyImplementationType< Property::FLOAT > { typedef float Type; };
-template<> struct PropertyImplementationType< Property::INTEGER > { typedef int Type; };
-template<> struct PropertyImplementationType< Property::VECTOR2 > { typedef Vector2 Type; };
-template<> struct PropertyImplementationType< Property::VECTOR3 > { typedef Vector3 Type; };
-template<> struct PropertyImplementationType< Property::VECTOR4 > { typedef Vector4 Type; };
-template<> struct PropertyImplementationType< Property::MATRIX3 > { typedef Matrix3 Type; };
-template<> struct PropertyImplementationType< Property::MATRIX > { typedef Matrix Type; };
-template<> struct PropertyImplementationType< Property::RECTANGLE > { typedef Rect<int> Type; };
-template<> struct PropertyImplementationType< Property::ROTATION > { typedef Quaternion Type; };
-
-uint32_t GetPropertyImplementationSize( Property::Type& propertyType );
+template<>
+struct PropertyImplementationType<Property::BOOLEAN>
+{
+ using Type = bool;
+};
+template<>
+struct PropertyImplementationType<Property::FLOAT>
+{
+ using Type = float;
+};
+template<>
+struct PropertyImplementationType<Property::INTEGER>
+{
+ using Type = int;
+};
+template<>
+struct PropertyImplementationType<Property::VECTOR2>
+{
+ using Type = Vector2;
+};
+template<>
+struct PropertyImplementationType<Property::VECTOR3>
+{
+ using Type = Vector3;
+};
+template<>
+struct PropertyImplementationType<Property::VECTOR4>
+{
+ using Type = Vector4;
+};
+template<>
+struct PropertyImplementationType<Property::MATRIX3>
+{
+ using Type = Matrix3;
+};
+template<>
+struct PropertyImplementationType<Property::MATRIX>
+{
+ using Type = Matrix;
+};
+template<>
+struct PropertyImplementationType<Property::RECTANGLE>
+{
+ using Type = Rect<int>;
+};
+template<>
+struct PropertyImplementationType<Property::ROTATION>
+{
+ using Type = Quaternion;
+};
+
+uint32_t GetPropertyImplementationSize(Property::Type& propertyType);
} // namespace Internal