• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 * Copyright (C) 2011 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 #pragma once
17 
18 #include "OpenGLESDispatch/gldefs.h"
19 #include "OpenGLESDispatch/gles_functions.h"
20 #include "KHR/khrplatform.h"
21 
22 #include "OpenGLESDispatch/gles1_only_static_translator_namespaced_header.h"
23 #include "OpenGLESDispatch/gles1_extensions_static_translator_namespaced_header.h"
24 #include "OpenGLESDispatch/gles_common_for_gles1_static_translator_namespaced_header.h"
25 #include "OpenGLESDispatch/gles_extensions_for_gles1_static_translator_namespaced_header.h"
26 
27 #include <stdint.h>
28 
29 namespace gfxstream {
30 namespace gl {
31 
32 // Define function pointer types.
33 #define GLES1_DISPATCH_DEFINE_TYPE(return_type,func_name,signature,callargs) \
34     typedef return_type (KHRONOS_APIENTRY * func_name ## _t) signature;
35 
36 LIST_GLES1_FUNCTIONS(GLES1_DISPATCH_DEFINE_TYPE,GLES1_DISPATCH_DEFINE_TYPE)
37     LIST_GLES12_TR_FUNCTIONS(GLES1_DISPATCH_DEFINE_TYPE)
38 
39 struct GLESv1Dispatch {
40 #define GLES1_DISPATCH_DECLARE_POINTER(return_type,func_name,signature,callargs) \
41         func_name ## _t func_name;
42     LIST_GLES1_FUNCTIONS(GLES1_DISPATCH_DECLARE_POINTER,
43                          GLES1_DISPATCH_DECLARE_POINTER)
44 
45     bool initialized = false;
46 };
47 
48 #undef GLES1_DISPATCH_DECLARE_POINTER
49 #undef GLES1_DISPATCH_DEFINE_TYPE
50 
51 bool gles1_dispatch_init(GLESv1Dispatch* dispatch_table);
52 
53 // Used to initialize the decoder.
54 void* gles1_dispatch_get_proc_func(const char* name, void* userData);
55 
56 // Used to check for unimplemented.
57 void gles1_unimplemented();
58 
59 }  // namespace gl
60 }  // namespace gfxstream
61