2 * Copyright (C) 2011 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #include "OpenGLESDispatch/gldefs.h"
19 #include "OpenGLESDispatch/gles_functions.h"
20 #include "KHR/khrplatform.h"
22 // Define function pointer types.
23 #define GLES2_DISPATCH_DEFINE_TYPE(return_type,func_name,signature,callargs) \
24 typedef return_type (KHRONOS_APIENTRY * func_name ## _t) signature;
26 LIST_GLES2_FUNCTIONS(GLES2_DISPATCH_DEFINE_TYPE,GLES2_DISPATCH_DEFINE_TYPE)
28 struct GLESv2Dispatch {
29 bool initialized = false;
30 #define GLES2_DISPATCH_DECLARE_POINTER(return_type,func_name,signature,callargs) \
31 func_name ## _t func_name;
32 LIST_GLES2_FUNCTIONS(GLES2_DISPATCH_DECLARE_POINTER,
33 GLES2_DISPATCH_DECLARE_POINTER)
36 #undef GLES2_DISPATCH_DECLARE_POINTER
37 #undef GLES2_DISPATCH_DEFINE_TYPE
39 bool gles2_dispatch_init(const char *path, GLESv2Dispatch* dispatch_table);
41 // Used to initialize the decoder.
42 void* gles2_dispatch_get_proc_func(const char* name, void* userData);