2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUiEffects_RendererRendererGeometry.cpp
20 * @brief This is the source file for the RendererGeometry class
23 #include <FUiEffects_RendererRendererGeometry.h>
24 #include <FUiEffects_RendererEffectShader.h>
25 #include <FUiEffects_RendererLog.h>
26 #include <FUiEffects_EffectErrorMessages.h>
28 using namespace Tizen::Ui::Effects::_Renderer::Math;
29 using namespace Tizen::Ui::Effects::_Renderer::EngineModel;
30 using namespace Tizen::Ui::Effects::_Runtime;
32 namespace Tizen { namespace Ui { namespace Effects { namespace _Renderer
35 RendererGeometry::RendererGeometry(void)
37 result r = GetLastResult();
38 SysTryReturnVoidResult(NID_UI_EFFECT, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
40 __composite = Buffer_CompositeFloatVertexPtr(new (std::nothrow) _Buffer_CompositeFloatVertex());
41 __indexTriangles = Buffer_UIntIndexPtr(new (std::nothrow) _Buffer_UShortIndex());
43 __partVertex = Buffer_VertexAttributePtr(new (std::nothrow) _Buffer_VertexAttribute(__composite, 3, VertexData::OffsetPos(), VertexData::Stride()));
44 __partNormal = Buffer_VertexAttributePtr(new (std::nothrow) _Buffer_VertexAttribute(__composite, 3, VertexData::OffsetNorm(), VertexData::Stride()));
45 __partTexCoords = Buffer_VertexAttributePtr(new (std::nothrow) _Buffer_VertexAttribute(__composite, 2, VertexData::OffsetTexCoords(), VertexData::Stride()));
48 SysTryReturnVoidResult(NID_UI_EFFECT, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
49 SysTryReturnVoidResult(NID_UI_EFFECT, System::GetImpl(__composite) != null, E_OUT_OF_MEMORY, _UiEffectError::OUT_OF_MEMORY);
50 SysTryReturnVoidResult(NID_UI_EFFECT, System::GetImpl(__indexTriangles) != null, E_OUT_OF_MEMORY, _UiEffectError::OUT_OF_MEMORY);
51 SysTryReturnVoidResult(NID_UI_EFFECT, System::GetImpl(__partVertex) != null, E_OUT_OF_MEMORY, _UiEffectError::OUT_OF_MEMORY);
52 SysTryReturnVoidResult(NID_UI_EFFECT, System::GetImpl(__partNormal) != null, E_OUT_OF_MEMORY, _UiEffectError::OUT_OF_MEMORY);
53 SysTryReturnVoidResult(NID_UI_EFFECT, System::GetImpl(__partTexCoords) != null, E_OUT_OF_MEMORY, _UiEffectError::OUT_OF_MEMORY);
56 RendererGeometry::~RendererGeometry(void)
62 RendererGeometry::GetBuffer(const std::string& aName) const
64 if (aName == SHADER_IN_POSITION_STR)
68 else if (aName == SHADER_IN_TEXCOORDS_STR )
70 return __partTexCoords;
72 else if (aName == SHADER_IN_NORMAL_STR)
80 }}}} //Tizen::Ui::Effects::_Renderer