--- /dev/null
+#ifndef __DALI_INTERNAL_SCENE_GRAPH_BOOLEAN_PROPERTY_H__
+#define __DALI_INTERNAL_SCENE_GRAPH_BOOLEAN_PROPERTY_H__
+
+/*
+ * Copyright (c) 2015 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/math/boolean.h>
+#include <dali/public-api/object/property.h>
+#include <dali/public-api/object/property-input.h>
+#include <dali/public-api/object/property-types.h>
+#include <dali/internal/common/buffer-index.h>
+#include <dali/internal/event/common/property-input-impl.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace SceneGraph
+{
+
+/**
+ * A Boolean non-animatable property.
+ */
+class PropertyBoolean : public PropertyInputImpl
+{
+public:
+
+ /**
+ * Create an non-animatable property.
+ * @param [in] initialValue The initial value of the property.
+ */
+ PropertyBoolean( bool initialValue )
+ : mValue( initialValue ),
+ mDirtyFlag( true )
+ {
+ }
+
+ /**
+ * Virtual destructor.
+ */
+ virtual ~PropertyBoolean()
+ {
+ }
+
+ /**
+ * Clear the dirty flag
+ */
+ void Clear()
+ {
+ mDirtyFlag = false;
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetType()
+ */
+ virtual Dali::Property::Type GetType() const
+ {
+ return Dali::PropertyTypes::Get<bool>();
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::InputInitialized()
+ */
+ virtual bool InputInitialized() const
+ {
+ return true;
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::InputChanged()
+ */
+ virtual bool InputChanged() const
+ {
+ return mDirtyFlag;
+ }
+
+ /**
+ * @copydoc Dali::PropertyInput::GetBoolean()
+ */
+ virtual const bool& GetBoolean( BufferIndex bufferIndex ) const
+ {
+ return mValue;
+ }
+
+ /**
+ * Flag that the property has been Set during the current frame.
+ */
+ void OnSet()
+ {
+ mDirtyFlag = true;
+ }
+
+private:
+
+ // Undefined
+ PropertyBoolean(const PropertyBoolean& property);
+
+ // Undefined
+ PropertyBoolean& operator=(const PropertyBoolean& rhs);
+
+public:
+ boolean mValue; ///< The property value
+
+private:
+ boolean mDirtyFlag;
+};
+
+} // namespace SceneGraph
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif // __DALI_INTERNAL_SCENE_GRAPH_BOOLEAN_PROPERTY_H__
{
}
+//@todo MESH_REWORK Remove when we have working property buffers
+PropertyBuffer* PropertyBuffer::NewQuadVertices()
+{
+ PropertyBuffer* propertyBuffer = new PropertyBuffer();
+ propertyBuffer->mVertexSize = sizeof(Vector4);
+ propertyBuffer->mData.Resize( propertyBuffer->mVertexSize * 4 );
+ Vector4* vertices = reinterpret_cast<Vector4*>(propertyBuffer->mData[0]);
+
+ vertices[ 0 ] = Vector4( -0.5f, -0.5f, 1.0f, 0.0f );
+ vertices[ 1 ] = Vector4( 0.5f, -0.5f, 1.0f, 1.0f );
+ vertices[ 2 ] = Vector4( -0.5f, 0.5f, 0.0f, 0.0f );
+ vertices[ 3 ] = Vector4( 0.5f, 0.5f, 0.0f, 1.0f );
+
+ return propertyBuffer;
+}
+
+//@todo MESH_REWORK Remove when we have working property buffers
+PropertyBuffer* PropertyBuffer::NewQuadIndices()
+{
+ PropertyBuffer* propertyBuffer = new PropertyBuffer();
+
+ propertyBuffer->mVertexSize = sizeof( unsigned short );
+ propertyBuffer->mData.Resize( propertyBuffer->mVertexSize * 6 );
+ unsigned short* indices = reinterpret_cast<unsigned short*>(propertyBuffer->mData[0]);
+
+ indices[0] = 0; indices[1] = 3; indices[2] = 1;
+ indices[3] = 0; indices[4] = 2; indices[5] = 3;
+
+ return propertyBuffer;
+}
} // namespace SceneGraph
} // namespace Internal
* limitations under the License.
*/
+#include <dali/public-api/common/dali-vector.h>
+#include <dali/public-api/math/vector4.h>
+
namespace Dali
{
namespace Internal
~PropertyBuffer();
private:
- // Data
+
+ // @todo MESH_REWORK - TEMPORARY TYPES - REMOVE WHEN WE HAVE WORKING BUFFERS
+ typedef Dali::Vector< char > CharBuffer;
+ CharBuffer mData;
+ std::size_t mVertexSize;
};
} // namespace SceneGraph
{
Geometry::Geometry()
-: mGeometryType(Dali::Geometry::TRIANGLES)
+: mCenter(),
+ mHalfExtents(),
+ mGeometryType(Dali::Geometry::TRIANGLES),
+ mRequiresDepthTest(false)
{
// @todo MESH_REWORK Remove this code when we have working property buffers
// @todo It's also the wrong place to do this temporary work
#include <dali/public-api/geometry/geometry.h>
#include <dali/internal/common/event-to-update.h>
+#include <dali/internal/update/common/animatable-property.h>
#include <dali/internal/update/common/double-buffered.h>
#include <dali/internal/update/common/property-owner.h>
#include <dali/internal/update/common/scene-graph-property-buffer.h>
private:
VertexBuffers mVertexBuffers; ///< The vertex buffers
OwnerPointer<PropertyBuffer> mIndexBuffer; ///< The index buffer if required
- GeometryType mGeometryType; ///< The type of geometry (tris/lines etc)
+
+private: // Properties
+ AnimatableProperty<Vector3> mCenter;
+ AnimatableProperty<Vector3> mHalfExtents;
+ GeometryType mGeometryType; ///< The type of geometry (tris/lines etc)
+ AnimatableProperty<bool> mRequiresDepthTest;
};
inline void AddVertexBufferMessage( EventToUpdate& eventToUpdate, const Geometry& geometry, PropertyBuffer& vertexBuffer )