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 #ifndef _EGL_DISPATCH_H
17 #define _EGL_DISPATCH_H
18 
19 #include "egl_proc.h"
20 
21 struct egl_dispatch {
22     eglGetError_t eglGetError;
23     eglGetDisplay_t eglGetDisplay;
24     eglInitialize_t eglInitialize;
25     eglTerminate_t eglTerminate;
26     eglQueryString_t eglQueryString;
27     eglGetConfigs_t eglGetConfigs;
28     eglChooseConfig_t eglChooseConfig;
29     eglGetConfigAttrib_t eglGetConfigAttrib;
30     eglCreateWindowSurface_t eglCreateWindowSurface;
31     eglCreatePbufferSurface_t eglCreatePbufferSurface;
32     eglCreatePixmapSurface_t eglCreatePixmapSurface;
33     eglDestroySurface_t eglDestroySurface;
34     eglQuerySurface_t eglQuerySurface;
35     eglBindAPI_t eglBindAPI;
36     eglQueryAPI_t eglQueryAPI;
37     eglWaitClient_t eglWaitClient;
38     eglReleaseThread_t eglReleaseThread;
39     eglCreatePbufferFromClientBuffer_t eglCreatePbufferFromClientBuffer;
40     eglSurfaceAttrib_t eglSurfaceAttrib;
41     eglBindTexImage_t eglBindTexImage;
42     eglReleaseTexImage_t eglReleaseTexImage;
43     eglSwapInterval_t eglSwapInterval;
44     eglCreateContext_t eglCreateContext;
45     eglDestroyContext_t eglDestroyContext;
46     eglMakeCurrent_t eglMakeCurrent;
47     eglGetCurrentContext_t eglGetCurrentContext;
48     eglGetCurrentSurface_t eglGetCurrentSurface;
49     eglGetCurrentDisplay_t eglGetCurrentDisplay;
50     eglQueryContext_t eglQueryContext;
51     eglWaitGL_t eglWaitGL;
52     eglWaitNative_t eglWaitNative;
53     eglSwapBuffers_t eglSwapBuffers;
54     eglCopyBuffers_t eglCopyBuffers;
55     eglGetProcAddress_t eglGetProcAddress;
56     eglLockSurfaceKHR_t eglLockSurfaceKHR;
57     eglUnlockSurfaceKHR_t eglUnlockSurfaceKHR;
58     eglCreateImageKHR_t eglCreateImageKHR;
59     eglDestroyImageKHR_t eglDestroyImageKHR;
60     eglCreateSyncKHR_t eglCreateSyncKHR;
61     eglDestroySyncKHR_t eglDestroySyncKHR;
62     eglClientWaitSyncKHR_t eglClientWaitSyncKHR;
63     eglSignalSyncKHR_t eglSignalSyncKHR;
64     eglGetSyncAttribKHR_t eglGetSyncAttribKHR;
65     eglSetSwapRectangleANDROID_t eglSetSwapRectangleANDROID;
66     //Accessors
set_eglGetErroregl_dispatch67     eglGetError_t set_eglGetError(eglGetError_t f) { eglGetError_t retval = eglGetError; eglGetError = f; return retval;}
set_eglGetDisplayegl_dispatch68     eglGetDisplay_t set_eglGetDisplay(eglGetDisplay_t f) { eglGetDisplay_t retval = eglGetDisplay; eglGetDisplay = f; return retval;}
set_eglInitializeegl_dispatch69     eglInitialize_t set_eglInitialize(eglInitialize_t f) { eglInitialize_t retval = eglInitialize; eglInitialize = f; return retval;}
set_eglTerminateegl_dispatch70     eglTerminate_t set_eglTerminate(eglTerminate_t f) { eglTerminate_t retval = eglTerminate; eglTerminate = f; return retval;}
set_eglQueryStringegl_dispatch71     eglQueryString_t set_eglQueryString(eglQueryString_t f) { eglQueryString_t retval = eglQueryString; eglQueryString = f; return retval;}
set_eglGetConfigsegl_dispatch72     eglGetConfigs_t set_eglGetConfigs(eglGetConfigs_t f) { eglGetConfigs_t retval = eglGetConfigs; eglGetConfigs = f; return retval;}
set_eglChooseConfigegl_dispatch73     eglChooseConfig_t set_eglChooseConfig(eglChooseConfig_t f) { eglChooseConfig_t retval = eglChooseConfig; eglChooseConfig = f; return retval;}
set_eglGetConfigAttribegl_dispatch74     eglGetConfigAttrib_t set_eglGetConfigAttrib(eglGetConfigAttrib_t f) { eglGetConfigAttrib_t retval = eglGetConfigAttrib; eglGetConfigAttrib = f; return retval;}
set_eglCreateWindowSurfaceegl_dispatch75     eglCreateWindowSurface_t set_eglCreateWindowSurface(eglCreateWindowSurface_t f) { eglCreateWindowSurface_t retval = eglCreateWindowSurface; eglCreateWindowSurface = f; return retval;}
set_eglCreatePbufferSurfaceegl_dispatch76     eglCreatePbufferSurface_t set_eglCreatePbufferSurface(eglCreatePbufferSurface_t f) { eglCreatePbufferSurface_t retval = eglCreatePbufferSurface; eglCreatePbufferSurface = f; return retval;}
set_eglCreatePixmapSurfaceegl_dispatch77     eglCreatePixmapSurface_t set_eglCreatePixmapSurface(eglCreatePixmapSurface_t f) { eglCreatePixmapSurface_t retval = eglCreatePixmapSurface; eglCreatePixmapSurface = f; return retval;}
set_eglDestroySurfaceegl_dispatch78     eglDestroySurface_t set_eglDestroySurface(eglDestroySurface_t f) { eglDestroySurface_t retval = eglDestroySurface; eglDestroySurface = f; return retval;}
set_eglQuerySurfaceegl_dispatch79     eglQuerySurface_t set_eglQuerySurface(eglQuerySurface_t f) { eglQuerySurface_t retval = eglQuerySurface; eglQuerySurface = f; return retval;}
set_eglBindAPIegl_dispatch80     eglBindAPI_t set_eglBindAPI(eglBindAPI_t f) { eglBindAPI_t retval = eglBindAPI; eglBindAPI = f; return retval;}
set_eglQueryAPIegl_dispatch81     eglQueryAPI_t set_eglQueryAPI(eglQueryAPI_t f) { eglQueryAPI_t retval = eglQueryAPI; eglQueryAPI = f; return retval;}
set_eglWaitClientegl_dispatch82     eglWaitClient_t set_eglWaitClient(eglWaitClient_t f) { eglWaitClient_t retval = eglWaitClient; eglWaitClient = f; return retval;}
set_eglReleaseThreadegl_dispatch83     eglReleaseThread_t set_eglReleaseThread(eglReleaseThread_t f) { eglReleaseThread_t retval = eglReleaseThread; eglReleaseThread = f; return retval;}
set_eglCreatePbufferFromClientBufferegl_dispatch84     eglCreatePbufferFromClientBuffer_t set_eglCreatePbufferFromClientBuffer(eglCreatePbufferFromClientBuffer_t f) { eglCreatePbufferFromClientBuffer_t retval = eglCreatePbufferFromClientBuffer; eglCreatePbufferFromClientBuffer = f; return retval;}
set_eglSurfaceAttribegl_dispatch85     eglSurfaceAttrib_t set_eglSurfaceAttrib(eglSurfaceAttrib_t f) { eglSurfaceAttrib_t retval = eglSurfaceAttrib; eglSurfaceAttrib = f; return retval;}
set_eglBindTexImageegl_dispatch86     eglBindTexImage_t set_eglBindTexImage(eglBindTexImage_t f) { eglBindTexImage_t retval = eglBindTexImage; eglBindTexImage = f; return retval;}
set_eglReleaseTexImageegl_dispatch87     eglReleaseTexImage_t set_eglReleaseTexImage(eglReleaseTexImage_t f) { eglReleaseTexImage_t retval = eglReleaseTexImage; eglReleaseTexImage = f; return retval;}
set_eglSwapIntervalegl_dispatch88     eglSwapInterval_t set_eglSwapInterval(eglSwapInterval_t f) { eglSwapInterval_t retval = eglSwapInterval; eglSwapInterval = f; return retval;}
set_eglCreateContextegl_dispatch89     eglCreateContext_t set_eglCreateContext(eglCreateContext_t f) { eglCreateContext_t retval = eglCreateContext; eglCreateContext = f; return retval;}
set_eglDestroyContextegl_dispatch90     eglDestroyContext_t set_eglDestroyContext(eglDestroyContext_t f) { eglDestroyContext_t retval = eglDestroyContext; eglDestroyContext = f; return retval;}
set_eglMakeCurrentegl_dispatch91     eglMakeCurrent_t set_eglMakeCurrent(eglMakeCurrent_t f) { eglMakeCurrent_t retval = eglMakeCurrent; eglMakeCurrent = f; return retval;}
set_eglGetCurrentContextegl_dispatch92     eglGetCurrentContext_t set_eglGetCurrentContext(eglGetCurrentContext_t f) { eglGetCurrentContext_t retval = eglGetCurrentContext; eglGetCurrentContext = f; return retval;}
set_eglGetCurrentSurfaceegl_dispatch93     eglGetCurrentSurface_t set_eglGetCurrentSurface(eglGetCurrentSurface_t f) { eglGetCurrentSurface_t retval = eglGetCurrentSurface; eglGetCurrentSurface = f; return retval;}
set_eglGetCurrentDisplayegl_dispatch94     eglGetCurrentDisplay_t set_eglGetCurrentDisplay(eglGetCurrentDisplay_t f) { eglGetCurrentDisplay_t retval = eglGetCurrentDisplay; eglGetCurrentDisplay = f; return retval;}
set_eglQueryContextegl_dispatch95     eglQueryContext_t set_eglQueryContext(eglQueryContext_t f) { eglQueryContext_t retval = eglQueryContext; eglQueryContext = f; return retval;}
set_eglWaitGLegl_dispatch96     eglWaitGL_t set_eglWaitGL(eglWaitGL_t f) { eglWaitGL_t retval = eglWaitGL; eglWaitGL = f; return retval;}
set_eglWaitNativeegl_dispatch97     eglWaitNative_t set_eglWaitNative(eglWaitNative_t f) { eglWaitNative_t retval = eglWaitNative; eglWaitNative = f; return retval;}
set_eglSwapBuffersegl_dispatch98     eglSwapBuffers_t set_eglSwapBuffers(eglSwapBuffers_t f) { eglSwapBuffers_t retval = eglSwapBuffers; eglSwapBuffers = f; return retval;}
set_eglCopyBuffersegl_dispatch99     eglCopyBuffers_t set_eglCopyBuffers(eglCopyBuffers_t f) { eglCopyBuffers_t retval = eglCopyBuffers; eglCopyBuffers = f; return retval;}
set_eglGetProcAddressegl_dispatch100     eglGetProcAddress_t set_eglGetProcAddress(eglGetProcAddress_t f) { eglGetProcAddress_t retval = eglGetProcAddress; eglGetProcAddress = f; return retval;}
set_eglLockSurfaceKHRegl_dispatch101     eglLockSurfaceKHR_t set_eglLockSurfaceKHR(eglLockSurfaceKHR_t f) { eglLockSurfaceKHR_t retval = eglLockSurfaceKHR; eglLockSurfaceKHR = f; return retval;}
set_eglUnlockSurfaceKHRegl_dispatch102     eglUnlockSurfaceKHR_t set_eglUnlockSurfaceKHR(eglUnlockSurfaceKHR_t f) { eglUnlockSurfaceKHR_t retval = eglUnlockSurfaceKHR; eglUnlockSurfaceKHR = f; return retval;}
set_eglCreateImageKHRegl_dispatch103     eglCreateImageKHR_t set_eglCreateImageKHR(eglCreateImageKHR_t f) { eglCreateImageKHR_t retval = eglCreateImageKHR; eglCreateImageKHR = f; return retval;}
set_eglDestroyImageKHRegl_dispatch104     eglDestroyImageKHR_t set_eglDestroyImageKHR(eglDestroyImageKHR_t f) { eglDestroyImageKHR_t retval = eglDestroyImageKHR; eglDestroyImageKHR = f; return retval;}
set_eglCreateSyncKHRegl_dispatch105     eglCreateSyncKHR_t set_eglCreateSyncKHR(eglCreateSyncKHR_t f) { eglCreateSyncKHR_t retval = eglCreateSyncKHR; eglCreateSyncKHR = f; return retval;}
set_eglDestroySyncKHRegl_dispatch106     eglDestroySyncKHR_t set_eglDestroySyncKHR(eglDestroySyncKHR_t f) { eglDestroySyncKHR_t retval = eglDestroySyncKHR; eglDestroySyncKHR = f; return retval;}
set_eglClientWaitSyncKHRegl_dispatch107     eglClientWaitSyncKHR_t set_eglClientWaitSyncKHR(eglClientWaitSyncKHR_t f) { eglClientWaitSyncKHR_t retval = eglClientWaitSyncKHR; eglClientWaitSyncKHR = f; return retval;}
set_eglSignalSyncKHRegl_dispatch108     eglSignalSyncKHR_t set_eglSignalSyncKHR(eglSignalSyncKHR_t f) { eglSignalSyncKHR_t retval = eglSignalSyncKHR; eglSignalSyncKHR = f; return retval;}
set_eglGetSyncAttribKHRegl_dispatch109     eglGetSyncAttribKHR_t set_eglGetSyncAttribKHR(eglGetSyncAttribKHR_t f) { eglGetSyncAttribKHR_t retval = eglGetSyncAttribKHR; eglGetSyncAttribKHR = f; return retval;}
set_eglSetSwapRectangleANDROIDegl_dispatch110     eglSetSwapRectangleANDROID_t set_eglSetSwapRectangleANDROID(eglSetSwapRectangleANDROID_t f) { eglSetSwapRectangleANDROID_t retval = eglSetSwapRectangleANDROID; eglSetSwapRectangleANDROID = f; return retval;}
111 };
112 
113 egl_dispatch *create_egl_dispatch(void *gles_andorid);
114 
115 #endif
116