GlWindow::GlWindow()
: mWindowBase(),
- mGraphics(),
- mDisplayConnection( nullptr ),
+ mGraphics( nullptr ),
mEventHandler( nullptr ),
mPositionSize(),
mColorDepth( COLOR_DEPTH_24 ),
mEventHandler->RemoveObserver( *this );
}
+ if( Dali::Adaptor::IsAvailable() && mGLRenderCallback )
+ {
+ Dali::Adaptor::Get().RemoveIdle( mGLRenderCallback );
+ }
+
if( mGLTerminateCallback )
{
mGLTerminateCallback();
if( mIsEGLInitialize )
{
- GraphicsInterface* graphics = mGraphics.get();
- EglGraphics *eglGraphics = static_cast<EglGraphics*>( graphics );
+ EglGraphics *eglGraphics = static_cast<EglGraphics*>( mGraphics );
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
if( mEGLSurface )
eglImpl.DestroyContext( mEGLContext );
mEGLContext = nullptr;
}
-
- eglImpl.TerminateGles();
-
- mGraphics->Destroy();
}
}
bool GlWindow::RunCallback()
{
- GraphicsInterface* graphics = mGraphics.get();
- EglGraphics *eglGraphics = static_cast<EglGraphics*>( graphics );
+ EglGraphics *eglGraphics = static_cast<EglGraphics*>( mGraphics );
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
eglImpl.MakeContextCurrent( mEGLSurface, mEGLContext );
{
if( !mIsEGLInitialize )
{
- // Init Graphics
- std::unique_ptr< GraphicsFactory > graphicsFactoryPtr = Utils::MakeUnique< GraphicsFactory >();
- auto graphicsFactory = *graphicsFactoryPtr.get();
-
- mGraphics = std::unique_ptr< GraphicsInterface >( &graphicsFactory.Create() );
- GraphicsInterface* graphics = mGraphics.get();
- EglGraphics *eglGraphics = static_cast<EglGraphics*>( graphics );
- eglGraphics->Initialize( mDepth, mStencil, mMSAA );
- eglGraphics->Create();
-
- mDisplayConnection = std::unique_ptr< Dali::DisplayConnection >( Dali::DisplayConnection::New( *graphics, Dali::RenderSurfaceInterface::Type::WINDOW_RENDER_SURFACE ) );
- mDisplayConnection->Initialize();
-
+ mGraphics = &( Adaptor::GetImplementation( Adaptor::Get() ).GetGraphicsInterface() );
+ EglGraphics *eglGraphics = static_cast<EglGraphics *>(mGraphics);
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
+
if( mGLESVersion == Dali::GlWindow::GlesVersion::VERSION_2_0 )
{
eglImpl.SetGlesVersion( 20 );