1 /*
2  * Copyright (C) 2018 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <EGL/egl.h>
20 #include <EGL/eglext.h>
21 
22 #include <egl_functions.h>
23 #include <egl_extensions_functions.h>
24 
25 #define EGL_DEFINE_TYPE(return_type, function_name, signature, callargs) \
26     typedef return_type(EGLAPIENTRY* function_name##_t) signature;
27 
28 #define EGL_DECLARE_MEMBER(return_type, function_name, signature, callargs) \
29     function_name##_t function_name;
30 
31 LIST_EGL_FUNCTIONS(EGL_DEFINE_TYPE)
32 LIST_EGL_EXTENSIONS_FUNCTIONS(EGL_DEFINE_TYPE)
33 
34 struct EGLDispatch {
35     LIST_EGL_FUNCTIONS(EGL_DECLARE_MEMBER)
36     LIST_EGL_EXTENSIONS_FUNCTIONS(EGL_DECLARE_MEMBER)
37 };
38 
39 bool egl_dispatch_init();
40 
41 extern EGLDispatch s_egl;
42