1 #ifndef _EGLUPLATFORM_HPP
2 #define _EGLUPLATFORM_HPP
3 /*-------------------------------------------------------------------------
4 * drawElements Quality Program Tester Core
5 * ----------------------------------------
7 * Copyright 2014 The Android Open Source Project
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 * \brief EGL platform interface.
24 *//*--------------------------------------------------------------------*/
26 #include "tcuDefs.hpp"
27 #include "egluNativeDisplay.hpp"
28 #include "gluRenderContext.hpp"
33 class FunctionLibrary;
39 /*--------------------------------------------------------------------*//*!
40 * \brief EGL platform interface
42 * EGL platform interface provides mechanism to implement platform-specific
43 * bits of EGL API for use in EGL tests, or OpenGL (ES) context creation.
45 * A single platform can support multiple native object types. This is
46 * accomplished by registering multiple object factories. Command line
47 * parameters (such as --deqp-egl-display-type=) are used to select
50 * See following classes for complete description of the porting layer:
52 * * eglu::NativeDisplay, created by eglu::NativeDisplayFactory
53 * * eglu::NativeWindow, created by eglu::NativeWindowFactory
54 * * eglu::NativePixmap, created by eglu::NativePixmapFactory
56 * If you implement EGL support, you may use it to enable GL support by
57 * adding eglu::GLContextFactory to m_contextFactoryRegistry in your
58 * glu::Platform implementation.
60 * EGL platform implementation is required by EGL tests. OpenGL (ES) and
61 * OpenCL tests can benefit from, but do not require EGL platform
63 *//*--------------------------------------------------------------------*/
68 // Code outside porting layer will never attempt to delete eglu::Platform
69 virtual ~Platform (void);
71 const NativeDisplayFactoryRegistry& getNativeDisplayFactoryRegistry (void) const { return m_nativeDisplayFactoryRegistry; }
73 /*--------------------------------------------------------------------*//*!
74 * \brief Get fallback GL library
76 * EGL tests use eglGetProcAddress() to load API entry points. However,
77 * if the platform does not support EGL_KHR_get_all_proc_addresses extension,
78 * core API entry points must be loaded using alternative method, namely
79 * this default GL function library.
81 * You may implement platform-specific way for loading GL entry points
82 * by implementing this method.
84 * Default implementation provides entry points for ES2 and ES3 APIs
85 * if binary is directly linked against GLES library.
87 * \param contextType GL context type
88 * \param cmdLine Reserved for future use
89 *//*--------------------------------------------------------------------*/
90 virtual tcu::FunctionLibrary* createDefaultGLFunctionLibrary (glu::ApiType apiType, const tcu::CommandLine& cmdLine) const;
94 /*--------------------------------------------------------------------*//*!
95 * \brief Native display factory registry
97 * Native display factory registry holds list of eglu::NativeDisplayFactory
98 * objects that can create eglu::NativeDisplay instances. You should
99 * implement eglu::NativeDisplay and eglu::NativeDisplayFactory and add
100 * instance of that factory implementation to this registry.
102 * --deqp-egl-display-type command line argument is used to select the
103 * display factory to use. If no type is given in command line, first entry
105 *//*--------------------------------------------------------------------*/
106 NativeDisplayFactoryRegistry m_nativeDisplayFactoryRegistry;
111 #endif // _EGLUPLATFORM_HPP