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 <GLES3/gl31.h>
20 
21 #include <OpenGLESDispatch/gles_functions.h>
22 
23 // Define function pointer types.
24 #define GLES3_DISPATCH_DEFINE_TYPE(return_type, func_name, signature, callargs) \
25     typedef return_type(KHRONOS_APIENTRY* func_name##_t) signature;
26 
27 #define GLES3_DISPATCH_DECLARE_POINTER(return_type, func_name, signature, callargs) \
28     func_name##_t func_name;
29 
30 LIST_GLES3_FUNCTIONS(GLES3_DISPATCH_DEFINE_TYPE, GLES3_DISPATCH_DEFINE_TYPE)
31 
32 struct GLESv3Dispatch {
33     LIST_GLES3_FUNCTIONS(GLES3_DISPATCH_DECLARE_POINTER, GLES3_DISPATCH_DECLARE_POINTER)
34 };
35 
36 #undef GLES3_DISPATCH_DEFINE_TYPE
37 #undef GLES3_DISPATCH_DECLARE_POINTER
38 
39 bool gles3_dispatch_init();
40 
41 extern GLESv3Dispatch s_gles3;
42