#include <dali/integration-api/adaptor-framework/adaptor.h>
#include <dali/integration-api/adaptor-framework/native-render-surface.h>
-using Dali::Internal::Adaptor::ThreadMode;
-using RenderMode = Dali::OffscreenApplication::RenderMode;
-
namespace Dali
{
namespace Internal
{
+using RenderMode = Dali::OffscreenApplication::RenderMode;
+
IntrusivePtr< OffscreenApplication > OffscreenApplication::New( uint16_t width, uint16_t height, Dali::Any surface, bool isTranslucent, RenderMode renderMode )
{
IntrusivePtr< OffscreenApplication > offscreenApplication = new OffscreenApplication( width, height, surface, isTranslucent, renderMode );
mDefaultWindow = Dali::OffscreenWindow( impl.Get() );
mAdaptor.reset( Dali::Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( impl.Get() ), impl->GetSurface(), NULL,
- renderMode == RenderMode::AUTO ?
- Dali::Internal::Adaptor::ThreadMode::NORMAL : Dali::Internal::Adaptor::ThreadMode::RUN_IF_REQUESTED ) );
+ renderMode == RenderMode::AUTO ? Dali::Internal::Adaptor::ThreadMode::NORMAL : Dali::Internal::Adaptor::ThreadMode::RUN_IF_REQUESTED ) );
// Initialize default window
impl->Initialize( true );
void OffscreenApplication::Start()
{
- // Start the adaptor
- mAdaptor->Start();
- mInitSignal.Emit();
- mAdaptor->NotifySceneCreated();
+ // Start the adaptor
+ mAdaptor->Start();
+
+ Dali::OffscreenApplication handle( this );
+ mInitSignal.Emit();
+ mAdaptor->NotifySceneCreated();
}
void OffscreenApplication::Stop()
{
// Stop the adaptor
mAdaptor->Stop();
+
+ Dali::OffscreenApplication handle( this );
mTerminateSignal.Emit();
}