1b85b2756d1e247f8314bb591700fb175d7346631keunyoung/*
2b85b2756d1e247f8314bb591700fb175d7346631keunyoung* Copyright (C) 2011 The Android Open Source Project
3b85b2756d1e247f8314bb591700fb175d7346631keunyoung*
4b85b2756d1e247f8314bb591700fb175d7346631keunyoung* Licensed under the Apache License, Version 2.0 (the "License");
5b85b2756d1e247f8314bb591700fb175d7346631keunyoung* you may not use this file except in compliance with the License.
6b85b2756d1e247f8314bb591700fb175d7346631keunyoung* You may obtain a copy of the License at
7b85b2756d1e247f8314bb591700fb175d7346631keunyoung*
8b85b2756d1e247f8314bb591700fb175d7346631keunyoung* http://www.apache.org/licenses/LICENSE-2.0
9b85b2756d1e247f8314bb591700fb175d7346631keunyoung*
10b85b2756d1e247f8314bb591700fb175d7346631keunyoung* Unless required by applicable law or agreed to in writing, software
11b85b2756d1e247f8314bb591700fb175d7346631keunyoung* distributed under the License is distributed on an "AS IS" BASIS,
12b85b2756d1e247f8314bb591700fb175d7346631keunyoung* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13b85b2756d1e247f8314bb591700fb175d7346631keunyoung* See the License for the specific language governing permissions and
14b85b2756d1e247f8314bb591700fb175d7346631keunyoung* limitations under the License.
15b85b2756d1e247f8314bb591700fb175d7346631keunyoung*/
16b85b2756d1e247f8314bb591700fb175d7346631keunyoung#ifndef _EGL_DISPATCH_H
17b85b2756d1e247f8314bb591700fb175d7346631keunyoung#define _EGL_DISPATCH_H
18b85b2756d1e247f8314bb591700fb175d7346631keunyoung
19b85b2756d1e247f8314bb591700fb175d7346631keunyoung#include "egl_proc.h"
20b85b2756d1e247f8314bb591700fb175d7346631keunyoung
21b85b2756d1e247f8314bb591700fb175d7346631keunyoungstruct egl_dispatch {
22b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglGetError_t eglGetError;
23b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglGetDisplay_t eglGetDisplay;
24b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglInitialize_t eglInitialize;
25b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglTerminate_t eglTerminate;
26b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglQueryString_t eglQueryString;
27b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglGetConfigs_t eglGetConfigs;
28b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglChooseConfig_t eglChooseConfig;
29b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglGetConfigAttrib_t eglGetConfigAttrib;
30b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglCreateWindowSurface_t eglCreateWindowSurface;
31b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglCreatePbufferSurface_t eglCreatePbufferSurface;
32b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglCreatePixmapSurface_t eglCreatePixmapSurface;
33b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglDestroySurface_t eglDestroySurface;
34b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglQuerySurface_t eglQuerySurface;
35b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglBindAPI_t eglBindAPI;
36b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglQueryAPI_t eglQueryAPI;
37b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglWaitClient_t eglWaitClient;
38b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglReleaseThread_t eglReleaseThread;
39b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglCreatePbufferFromClientBuffer_t eglCreatePbufferFromClientBuffer;
40b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglSurfaceAttrib_t eglSurfaceAttrib;
41b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglBindTexImage_t eglBindTexImage;
42b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglReleaseTexImage_t eglReleaseTexImage;
43b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglSwapInterval_t eglSwapInterval;
44b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglCreateContext_t eglCreateContext;
45b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglDestroyContext_t eglDestroyContext;
46b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglMakeCurrent_t eglMakeCurrent;
47b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglGetCurrentContext_t eglGetCurrentContext;
48b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglGetCurrentSurface_t eglGetCurrentSurface;
49b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglGetCurrentDisplay_t eglGetCurrentDisplay;
50b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglQueryContext_t eglQueryContext;
51b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglWaitGL_t eglWaitGL;
52b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglWaitNative_t eglWaitNative;
53b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglSwapBuffers_t eglSwapBuffers;
54b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglCopyBuffers_t eglCopyBuffers;
55b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglGetProcAddress_t eglGetProcAddress;
56b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglLockSurfaceKHR_t eglLockSurfaceKHR;
57b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglUnlockSurfaceKHR_t eglUnlockSurfaceKHR;
58b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglCreateImageKHR_t eglCreateImageKHR;
59b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglDestroyImageKHR_t eglDestroyImageKHR;
60b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglCreateSyncKHR_t eglCreateSyncKHR;
61b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglDestroySyncKHR_t eglDestroySyncKHR;
62b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglClientWaitSyncKHR_t eglClientWaitSyncKHR;
63b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglSignalSyncKHR_t eglSignalSyncKHR;
64b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglGetSyncAttribKHR_t eglGetSyncAttribKHR;
65b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglSetSwapRectangleANDROID_t eglSetSwapRectangleANDROID;
66b85b2756d1e247f8314bb591700fb175d7346631keunyoung    //Accessors
67b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglGetError_t set_eglGetError(eglGetError_t f) { eglGetError_t retval = eglGetError; eglGetError = f; return retval;}
68b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglGetDisplay_t set_eglGetDisplay(eglGetDisplay_t f) { eglGetDisplay_t retval = eglGetDisplay; eglGetDisplay = f; return retval;}
69b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglInitialize_t set_eglInitialize(eglInitialize_t f) { eglInitialize_t retval = eglInitialize; eglInitialize = f; return retval;}
70b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglTerminate_t set_eglTerminate(eglTerminate_t f) { eglTerminate_t retval = eglTerminate; eglTerminate = f; return retval;}
71b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglQueryString_t set_eglQueryString(eglQueryString_t f) { eglQueryString_t retval = eglQueryString; eglQueryString = f; return retval;}
72b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglGetConfigs_t set_eglGetConfigs(eglGetConfigs_t f) { eglGetConfigs_t retval = eglGetConfigs; eglGetConfigs = f; return retval;}
73b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglChooseConfig_t set_eglChooseConfig(eglChooseConfig_t f) { eglChooseConfig_t retval = eglChooseConfig; eglChooseConfig = f; return retval;}
74b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglGetConfigAttrib_t set_eglGetConfigAttrib(eglGetConfigAttrib_t f) { eglGetConfigAttrib_t retval = eglGetConfigAttrib; eglGetConfigAttrib = f; return retval;}
75b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglCreateWindowSurface_t set_eglCreateWindowSurface(eglCreateWindowSurface_t f) { eglCreateWindowSurface_t retval = eglCreateWindowSurface; eglCreateWindowSurface = f; return retval;}
76b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglCreatePbufferSurface_t set_eglCreatePbufferSurface(eglCreatePbufferSurface_t f) { eglCreatePbufferSurface_t retval = eglCreatePbufferSurface; eglCreatePbufferSurface = f; return retval;}
77b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglCreatePixmapSurface_t set_eglCreatePixmapSurface(eglCreatePixmapSurface_t f) { eglCreatePixmapSurface_t retval = eglCreatePixmapSurface; eglCreatePixmapSurface = f; return retval;}
78b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglDestroySurface_t set_eglDestroySurface(eglDestroySurface_t f) { eglDestroySurface_t retval = eglDestroySurface; eglDestroySurface = f; return retval;}
79b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglQuerySurface_t set_eglQuerySurface(eglQuerySurface_t f) { eglQuerySurface_t retval = eglQuerySurface; eglQuerySurface = f; return retval;}
80b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglBindAPI_t set_eglBindAPI(eglBindAPI_t f) { eglBindAPI_t retval = eglBindAPI; eglBindAPI = f; return retval;}
81b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglQueryAPI_t set_eglQueryAPI(eglQueryAPI_t f) { eglQueryAPI_t retval = eglQueryAPI; eglQueryAPI = f; return retval;}
82b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglWaitClient_t set_eglWaitClient(eglWaitClient_t f) { eglWaitClient_t retval = eglWaitClient; eglWaitClient = f; return retval;}
83b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglReleaseThread_t set_eglReleaseThread(eglReleaseThread_t f) { eglReleaseThread_t retval = eglReleaseThread; eglReleaseThread = f; return retval;}
84b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglCreatePbufferFromClientBuffer_t set_eglCreatePbufferFromClientBuffer(eglCreatePbufferFromClientBuffer_t f) { eglCreatePbufferFromClientBuffer_t retval = eglCreatePbufferFromClientBuffer; eglCreatePbufferFromClientBuffer = f; return retval;}
85b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglSurfaceAttrib_t set_eglSurfaceAttrib(eglSurfaceAttrib_t f) { eglSurfaceAttrib_t retval = eglSurfaceAttrib; eglSurfaceAttrib = f; return retval;}
86b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglBindTexImage_t set_eglBindTexImage(eglBindTexImage_t f) { eglBindTexImage_t retval = eglBindTexImage; eglBindTexImage = f; return retval;}
87b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglReleaseTexImage_t set_eglReleaseTexImage(eglReleaseTexImage_t f) { eglReleaseTexImage_t retval = eglReleaseTexImage; eglReleaseTexImage = f; return retval;}
88b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglSwapInterval_t set_eglSwapInterval(eglSwapInterval_t f) { eglSwapInterval_t retval = eglSwapInterval; eglSwapInterval = f; return retval;}
89b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglCreateContext_t set_eglCreateContext(eglCreateContext_t f) { eglCreateContext_t retval = eglCreateContext; eglCreateContext = f; return retval;}
90b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglDestroyContext_t set_eglDestroyContext(eglDestroyContext_t f) { eglDestroyContext_t retval = eglDestroyContext; eglDestroyContext = f; return retval;}
91b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglMakeCurrent_t set_eglMakeCurrent(eglMakeCurrent_t f) { eglMakeCurrent_t retval = eglMakeCurrent; eglMakeCurrent = f; return retval;}
92b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglGetCurrentContext_t set_eglGetCurrentContext(eglGetCurrentContext_t f) { eglGetCurrentContext_t retval = eglGetCurrentContext; eglGetCurrentContext = f; return retval;}
93b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglGetCurrentSurface_t set_eglGetCurrentSurface(eglGetCurrentSurface_t f) { eglGetCurrentSurface_t retval = eglGetCurrentSurface; eglGetCurrentSurface = f; return retval;}
94b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglGetCurrentDisplay_t set_eglGetCurrentDisplay(eglGetCurrentDisplay_t f) { eglGetCurrentDisplay_t retval = eglGetCurrentDisplay; eglGetCurrentDisplay = f; return retval;}
95b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglQueryContext_t set_eglQueryContext(eglQueryContext_t f) { eglQueryContext_t retval = eglQueryContext; eglQueryContext = f; return retval;}
96b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglWaitGL_t set_eglWaitGL(eglWaitGL_t f) { eglWaitGL_t retval = eglWaitGL; eglWaitGL = f; return retval;}
97b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglWaitNative_t set_eglWaitNative(eglWaitNative_t f) { eglWaitNative_t retval = eglWaitNative; eglWaitNative = f; return retval;}
98b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglSwapBuffers_t set_eglSwapBuffers(eglSwapBuffers_t f) { eglSwapBuffers_t retval = eglSwapBuffers; eglSwapBuffers = f; return retval;}
99b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglCopyBuffers_t set_eglCopyBuffers(eglCopyBuffers_t f) { eglCopyBuffers_t retval = eglCopyBuffers; eglCopyBuffers = f; return retval;}
100b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglGetProcAddress_t set_eglGetProcAddress(eglGetProcAddress_t f) { eglGetProcAddress_t retval = eglGetProcAddress; eglGetProcAddress = f; return retval;}
101b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglLockSurfaceKHR_t set_eglLockSurfaceKHR(eglLockSurfaceKHR_t f) { eglLockSurfaceKHR_t retval = eglLockSurfaceKHR; eglLockSurfaceKHR = f; return retval;}
102b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglUnlockSurfaceKHR_t set_eglUnlockSurfaceKHR(eglUnlockSurfaceKHR_t f) { eglUnlockSurfaceKHR_t retval = eglUnlockSurfaceKHR; eglUnlockSurfaceKHR = f; return retval;}
103b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglCreateImageKHR_t set_eglCreateImageKHR(eglCreateImageKHR_t f) { eglCreateImageKHR_t retval = eglCreateImageKHR; eglCreateImageKHR = f; return retval;}
104b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglDestroyImageKHR_t set_eglDestroyImageKHR(eglDestroyImageKHR_t f) { eglDestroyImageKHR_t retval = eglDestroyImageKHR; eglDestroyImageKHR = f; return retval;}
105b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglCreateSyncKHR_t set_eglCreateSyncKHR(eglCreateSyncKHR_t f) { eglCreateSyncKHR_t retval = eglCreateSyncKHR; eglCreateSyncKHR = f; return retval;}
106b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglDestroySyncKHR_t set_eglDestroySyncKHR(eglDestroySyncKHR_t f) { eglDestroySyncKHR_t retval = eglDestroySyncKHR; eglDestroySyncKHR = f; return retval;}
107b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglClientWaitSyncKHR_t set_eglClientWaitSyncKHR(eglClientWaitSyncKHR_t f) { eglClientWaitSyncKHR_t retval = eglClientWaitSyncKHR; eglClientWaitSyncKHR = f; return retval;}
108b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglSignalSyncKHR_t set_eglSignalSyncKHR(eglSignalSyncKHR_t f) { eglSignalSyncKHR_t retval = eglSignalSyncKHR; eglSignalSyncKHR = f; return retval;}
109b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglGetSyncAttribKHR_t set_eglGetSyncAttribKHR(eglGetSyncAttribKHR_t f) { eglGetSyncAttribKHR_t retval = eglGetSyncAttribKHR; eglGetSyncAttribKHR = f; return retval;}
110b85b2756d1e247f8314bb591700fb175d7346631keunyoung    eglSetSwapRectangleANDROID_t set_eglSetSwapRectangleANDROID(eglSetSwapRectangleANDROID_t f) { eglSetSwapRectangleANDROID_t retval = eglSetSwapRectangleANDROID; eglSetSwapRectangleANDROID = f; return retval;}
111b85b2756d1e247f8314bb591700fb175d7346631keunyoung};
112b85b2756d1e247f8314bb591700fb175d7346631keunyoung
113b85b2756d1e247f8314bb591700fb175d7346631keunyoungegl_dispatch *create_egl_dispatch(void *gles_andorid);
114b85b2756d1e247f8314bb591700fb175d7346631keunyoung
115b85b2756d1e247f8314bb591700fb175d7346631keunyoung#endif
116