From 3fcfa3c4f996c78da64c8279ada9b2b3305b6ba1 Mon Sep 17 00:00:00 2001 From: seungho baek Date: Thu, 29 Jun 2023 18:08:30 +0900 Subject: [PATCH] [Tizen] Use ShaderDefinitionFactory to ShaderManager Change-Id: I41979b1877067c85f64444e84bb3ee731305f8fa Signed-off-by: seungho baek --- examples/scene3d-light/scene3d-light-example.cpp | 23 +++++++------- examples/scene3d/scene3d-example.cpp | 40 +++++++++++------------- examples/scene3d/scene3d-example.h | 20 +++--------- 3 files changed, 34 insertions(+), 49 deletions(-) diff --git a/examples/scene3d-light/scene3d-light-example.cpp b/examples/scene3d-light/scene3d-light-example.cpp index e38d146..4be4720 100644 --- a/examples/scene3d-light/scene3d-light-example.cpp +++ b/examples/scene3d-light/scene3d-light-example.cpp @@ -15,11 +15,10 @@ * */ +#include +#include #include -#include -#include #include -#include #include @@ -152,7 +151,7 @@ public: sceneView.SetImageBasedLightSource("", "", 1.0f); light1.Enable(true); light2.Enable(true); - light6.Enable(false); // to reset state of lights + light6.Enable(false); // to reset state of lights light6.Enable(true); light3.Enable(true); } @@ -194,19 +193,19 @@ public: } private: - Application& mApplication; - Scene3D::Light light1; - Scene3D::Light light2; - Scene3D::Light light3; - Scene3D::Light light4; - Scene3D::Light light5; - Scene3D::Light light6; + Application& mApplication; + Scene3D::Light light1; + Scene3D::Light light2; + Scene3D::Light light3; + Scene3D::Light light4; + Scene3D::Light light5; + Scene3D::Light light6; Scene3D::SceneView sceneView; }; int DALI_EXPORT_API main(int argc, char** argv) { - Application application = Application::New(&argc, &argv); + Application application = Application::New(&argc, &argv); Scene3dLightController test(application); application.MainLoop(); return 0; diff --git a/examples/scene3d/scene3d-example.cpp b/examples/scene3d/scene3d-example.cpp index a1639aa..7323bb1 100644 --- a/examples/scene3d/scene3d-example.cpp +++ b/examples/scene3d/scene3d-example.cpp @@ -15,23 +15,10 @@ * */ #include "scene3d-example.h" -#include #include #include +#include #include -#include "dali-scene3d/public-api/loader/model-loader.h" -#include "dali-scene3d/public-api/loader/light-parameters.h" -#include "dali-scene3d/public-api/loader/load-result.h" -#include "dali-scene3d/public-api/loader/shader-definition-factory.h" -#include "dali-toolkit/public-api/controls/scrollable/item-view/default-item-layout.h" -#include "dali-toolkit/public-api/controls/scrollable/item-view/item-factory.h" -#include "dali-toolkit/public-api/controls/text-controls/text-label.h" -#include "dali-toolkit/public-api/visuals/gradient-visual-properties.h" -#include "dali/public-api/actors/layer.h" -#include "dali/public-api/adaptor-framework/key.h" -#include "dali/public-api/events/key-event.h" -#include "dali/public-api/object/property-array.h" -#include "dali/public-api/render-tasks/render-task-list.h" #include "scene3d-extension.h" using namespace Dali; @@ -59,7 +46,8 @@ const std::string RESOURCE_TYPE_DIRS[]{ using StringVector = std::vector; StringVector ListFiles( - const std::string& path, bool (*predicate)(const char*) = [](const char*) { return true; }) + const std::string& path, bool (*predicate)(const char*) = [](const char*) + { return true; }) { StringVector results; @@ -127,7 +115,8 @@ Actor CreateErrorMessage(std::string msg) void ConfigureBlendShapeShaders(ResourceBundle& resources, const SceneDefinition& scene, Actor root, std::vector&& requests) { std::vector errors; - auto onError = [&errors](const std::string& msg) { + auto onError = [&errors](const std::string& msg) + { errors.push_back(msg); }; if(!scene.ConfigureBlendshapeShaders(resources, root, std::move(requests), onError)) @@ -142,7 +131,8 @@ void ConfigureBlendShapeShaders(ResourceBundle& resources, const SceneDefinition Actor LoadScene(std::string sceneName, CameraActor camera, std::vector& generatedAnimations, Animation& animation) { - ResourceBundle::PathProvider pathProvider = [](ResourceType::Value type) { + ResourceBundle::PathProvider pathProvider = [](ResourceType::Value type) + { return Application::GetResourcePath() + RESOURCE_TYPE_DIRS[type]; }; @@ -178,13 +168,19 @@ Actor LoadScene(std::string sceneName, CameraActor camera, std::vector DLI_EXTENSION.size() && DLI_EXTENSION.compare(name + (len - DLI_EXTENSION.size())) == 0) || - (len > GLTF_EXTENSION.size() && GLTF_EXTENSION.compare(name + (len - GLTF_EXTENSION.size())) == 0); - }); + (len > GLTF_EXTENSION.size() && GLTF_EXTENSION.compare(name + (len - GLTF_EXTENSION.size())) == 0); }); mSceneNames = sceneNames; // create Dali objects diff --git a/examples/scene3d/scene3d-example.h b/examples/scene3d/scene3d-example.h index 3f56eba..0139104 100644 --- a/examples/scene3d/scene3d-example.h +++ b/examples/scene3d/scene3d-example.h @@ -17,21 +17,11 @@ * */ +#include +#include +#include +#include #include -#include "dali-scene3d/public-api/loader/animation-definition.h" -#include "dali-scene3d/public-api/loader/camera-parameters.h" -#include "dali-scene3d/public-api/loader/node-definition.h" -#include "dali-scene3d/public-api/loader/scene-definition.h" -#include "dali-toolkit/devel-api/controls/navigation-view/navigation-view.h" -#include "dali-toolkit/public-api/controls/scrollable/item-view/item-factory.h" -#include "dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h" -#include "dali-toolkit/public-api/controls/scrollable/item-view/item-view.h" -#include "dali/public-api/actors/camera-actor.h" -#include "dali/public-api/adaptor-framework/application.h" -#include "dali/public-api/common/vector-wrapper.h" -#include "dali/public-api/events/pan-gesture-detector.h" -#include "dali/public-api/render-tasks/render-task.h" -#include "dali/public-api/signals/connection-tracker.h" class Scene3DExtension; @@ -83,4 +73,4 @@ private: // methods void OnKeyboardFocusChanged(Dali::Actor originalFocusedActor, Dali::Actor currentFocusedActor); }; -#endif //SCENE_LAUNCHER_H_ +#endif // SCENE_LAUNCHER_H_ -- 2.7.4