diff --git a/examples/direct-rendering/direct-rendering-example.cpp b/examples/direct-rendering/direct-rendering-example.cpp index ae549f4..c813df5 100644 --- a/examples/direct-rendering/direct-rendering-example.cpp +++ b/examples/direct-rendering/direct-rendering-example.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -46,32 +46,32 @@ const uint32_t DR_THREAD_ENABLED = GetEnvInt("DR_THREAD_ENABLED", 0); */ const Toolkit::GlView::BackendMode BACKEND_MODE = Toolkit::GlView::BackendMode(GetEnvInt("EGL_ENABLED", 0)); -} +} // namespace /** * RenderView encapsulates single GLView callback and its parameters. */ struct RenderView { - explicit RenderView( const Dali::Window& window ) + explicit RenderView(const Dali::Window& window) { mWindow = window; } - int Create(const Vector2& pos, Toolkit::GlView::BackendMode mode ) + int Create(const Vector2& pos, Toolkit::GlView::BackendMode mode) { auto w = mWindow.GetSize().GetWidth(); auto h = mWindow.GetSize().GetHeight(); NativeRenderer::CreateInfo info{}; info.clearColor = {0, 0, 0, 0}; - info.name = "DR"; - info.offscreen = (mode == Toolkit::GlView::BackendMode::EGL_IMAGE_OFFSCREEN_RENDERING || DR_THREAD_ENABLED); - info.viewportX = 0; - info.viewportY = 0; - info.width = w; - info.height = h; - info.threaded = (mode != Toolkit::GlView::BackendMode::EGL_IMAGE_OFFSCREEN_RENDERING) && (DR_THREAD_ENABLED); + info.name = "DR"; + info.offscreen = (mode == Toolkit::GlView::BackendMode::EGL_IMAGE_OFFSCREEN_RENDERING || DR_THREAD_ENABLED); + info.viewportX = 0; + info.viewportY = 0; + info.width = w; + info.height = h; + info.threaded = (mode != Toolkit::GlView::BackendMode::EGL_IMAGE_OFFSCREEN_RENDERING) && (DR_THREAD_ENABLED); // Enable threaded rendering if(info.threaded && mode == Dali::Toolkit::GlView::BackendMode::DIRECT_RENDERING) @@ -103,9 +103,8 @@ struct RenderView return 0; } - - Dali::Window mWindow; - Toolkit::GlView mGlView; + Dali::Window mWindow; + Toolkit::GlView mGlView; std::unique_ptr mRenderer{}; CallbackBase* mGlInitCallback{}; @@ -119,9 +118,8 @@ struct RenderView class DirectRenderingExampleController : public ConnectionTracker { public: - explicit DirectRenderingExampleController(Application& application) - : mApplication(application) + : mApplication(application) { // Connect to the Application's Init signal mApplication.InitSignal().Connect(this, &DirectRenderingExampleController::Create); @@ -135,8 +133,11 @@ public: Dali::Window window = application.GetWindow(); window.SetBackgroundColor(Color::WHITE); + window.KeyEventSignal().Connect(this, &DirectRenderingExampleController::OnKeyEvent); + window.GetRootLayer().TouchedSignal().Connect(this, &DirectRenderingExampleController::OnTouch); + mDRView = std::make_unique(window); - mDRView->Create( Vector2::ZERO, BACKEND_MODE ); + mDRView->Create(Vector2::ZERO, BACKEND_MODE); } bool OnTouch(Actor actor, const TouchEvent& touch) @@ -158,13 +159,13 @@ public: } private: - Application& mApplication; + Application& mApplication; std::unique_ptr mDRView; }; int DALI_EXPORT_API main(int argc, char** argv) { - Application application = Application::New(&argc, &argv); + Application application = Application::New(&argc, &argv); DirectRenderingExampleController test(application); application.MainLoop(); return 0; diff --git a/examples/perf-view-creation/perf-view-creation-example.cpp b/examples/perf-view-creation/perf-view-creation-example.cpp index 2ef0074..ab33d2f 100644 --- a/examples/perf-view-creation/perf-view-creation-example.cpp +++ b/examples/perf-view-creation/perf-view-creation-example.cpp @@ -451,7 +451,7 @@ public: mCreatingControlList.pop_front(); // Dereference timer safety - if(mTimerList.empty()) + if(!mTimerList.empty()) { mTimerList.pop_front(); } diff --git a/examples/scene3d-model/scene3d-model-example.cpp b/examples/scene3d-model/scene3d-model-example.cpp index 43b6146..1a08850 100644 --- a/examples/scene3d-model/scene3d-model-example.cpp +++ b/examples/scene3d-model/scene3d-model-example.cpp @@ -25,6 +25,7 @@ #include #include +#include using namespace Dali; using namespace Dali::Toolkit; @@ -376,15 +377,9 @@ public: mSkyboxGeometry.AddVertexBuffer(vertexBuffer); mSkyboxGeometry.SetType(Geometry::TRIANGLES); - // Diffuse Cube Map - Devel::PixelBuffer diffusePixelBuffer = LoadImageFromFile(uri_cube_diffuse_texture); - int32_t diffuseFaceSize = diffusePixelBuffer.GetWidth() / 4; - Texture texture = Texture::New(TextureType::TEXTURE_CUBE, diffusePixelBuffer.GetPixelFormat(), diffuseFaceSize, diffuseFaceSize); - for(int32_t i = 0; i < 6; ++i) - { - UploadTextureFace(texture, diffusePixelBuffer, i); - } - texture.GenerateMipmaps(); + Dali::Scene3D::Loader::EnvironmentMapData environmentMapData; + Dali::Scene3D::Loader::LoadEnvironmentMap(uri_cube_diffuse_texture, environmentMapData); + Texture texture = environmentMapData.GetTexture(); mSkyboxTextures = TextureSet::New(); mSkyboxTextures.SetTexture(0, texture); diff --git a/packaging/com.samsung.dali-demo.spec b/packaging/com.samsung.dali-demo.spec index 4bba627..26409a4 100755 --- a/packaging/com.samsung.dali-demo.spec +++ b/packaging/com.samsung.dali-demo.spec @@ -2,7 +2,7 @@ Name: com.samsung.dali-demo Summary: The OpenGLES Canvas Core Demo -Version: 2.2.10 +Version: 2.2.11 Release: 1 Group: System/Libraries License: Apache-2.0