1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program Tester Core
3 * ----------------------------------------
5 * Copyright 2016 The Android Open Source Project
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 * \brief Win32 platform port.
22 *//*--------------------------------------------------------------------*/
24 #include "tcuWin32Platform.hpp"
25 #include "tcuWGLContextFactory.hpp"
26 #include "tcuWin32EGLNativeDisplayFactory.hpp"
27 #include "egluGLContextFactory.hpp"
34 Platform::Platform (void)
35 : m_instance (GetModuleHandle(NULL))
36 , m_vulkanPlatform (m_instance)
38 // Set process priority to lower.
39 SetPriorityClass(GetCurrentProcess(), BELOW_NORMAL_PRIORITY_CLASS);
42 wgl::ContextFactory* factory = DE_NULL;
46 factory = new wgl::ContextFactory(m_instance);
48 catch (const std::exception& e)
50 print("Warning: WGL not supported: %s\n", e.what());
57 m_contextFactoryRegistry.registerFactory(factory);
67 m_nativeDisplayFactoryRegistry.registerFactory(new win32::EGLNativeDisplayFactory(m_instance));
68 m_contextFactoryRegistry.registerFactory(new eglu::GLContextFactory(m_nativeDisplayFactoryRegistry));
71 Platform::~Platform (void)
75 bool Platform::processEvents (void)
78 while (PeekMessage(&msg, (HWND)-1, 0, 0, PM_REMOVE))
80 DispatchMessage(&msg);
81 if (msg.message == WM_QUIT)
91 tcu::Platform* createPlatform (void)
93 return new tcu::win32::Platform();