2 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
19 #include <dali/internal/window-system/windows/display-connection-impl-win.h>
\r
21 // EXTERNAL INCLUDES
\r
22 #include <dali/integration-api/debug.h>
\r
24 // INTERNAL INCLUDES
\r
25 #include <dali/internal/graphics/gles/egl-graphics.h>
\r
36 DisplayConnection* DisplayConnectionWin::New()
\r
38 DisplayConnection* pDisplayConnection(new DisplayConnectionWin());
\r
40 return pDisplayConnection;
\r
43 DisplayConnectionWin::DisplayConnectionWin()
\r
48 DisplayConnectionWin::~DisplayConnectionWin()
\r
52 Any DisplayConnectionWin::GetDisplay()
\r
54 return Any(mDisplay);
\r
57 void DisplayConnectionWin::ConsumeEvents()
\r
61 bool DisplayConnectionWin::InitializeEgl(EglInterface& egl)
\r
63 EglImplementation& eglImpl = static_cast<EglImplementation&>( egl );
\r
65 if( !eglImpl.InitializeGles( reinterpret_cast<EGLNativeDisplayType>( mDisplay ) ) )
\r
67 DALI_LOG_ERROR( "Failed to initialize GLES.\n" );
\r
74 bool DisplayConnectionWin::InitializeGraphics()
\r
76 auto eglGraphics = static_cast<EglGraphics *>( mGraphics );
\r
77 EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
\r
79 if( !eglImpl.InitializeGles( reinterpret_cast<EGLNativeDisplayType>( mDisplay ) ) )
\r
81 DALI_LOG_ERROR( "Failed to initialize GLES.\n" );
\r
88 void DisplayConnectionWin::SetSurfaceType( RenderSurface::Type type )
\r
90 if( type == RenderSurface::WINDOW_RENDER_SURFACE )
\r
92 mDisplay = GetDC( GetForegroundWindow() );
\r
96 void DisplayConnectionWin::SetGraphicsInterface( GraphicsInterface& graphics )
\r
98 mGraphics = &graphics;
\r
101 } // namespace Adaptor
\r
103 } // namespace Internal
\r
105 } // namespace Dali
\r