4 * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
8 * Vitaliy Cherepanov <v.cherepanov@samsung.com>
10 * This library is free software; you can redistribute it and/or modify it under
11 * the terms of the GNU Lesser General Public License as published by the
12 * Free Software Foundation; either version 2.1 of the License, or (at your option)
15 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
16 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this library; if not, write to the Free Software Foundation, Inc., 51
22 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 * - Samsung RnD Institute Russia
29 //disable tizen redefines
35 * this include to make C native open gl functions
40 #include "da_gles20_tizen.cpp"
45 extern "C" EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
47 typedef EGLBoolean (*methodType)(EGLDisplay, EGLSurface);
48 BEFORE_EGL(eglSwapBuffers);
49 EGLBoolean ret = eglSwapBuffersp(dpy, surface);
50 error = eglGetError();
51 AFTER_NO_PARAM('d', ret, APITYPE_CONTEXT, "");
55 #define eglSwapBuffers _SglSwapBuffers
57 EGLBoolean _SglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
59 typedef EGLBoolean (*methodType)(EGLDisplay, EGLSurface);
60 BEFORE_OSP_UIFW(_SglSwapBuffers);
61 EGLBoolean ret = _SglSwapBuffersp(dpy, surface);
62 error = eglGetError();
63 AFTER_NO_PARAM('d', ret, APITYPE_CONTEXT, "");
68 #undef eglGetProcAddress
69 extern "C" EGLAPI __eglMustCastToProperFunctionPointerType
70 eglGetProcAddress(const char* procname)
72 typedef EGLAPI __eglMustCastToProperFunctionPointerType
73 (*methodType)(const char* procname);
74 __eglMustCastToProperFunctionPointerType ret = NULL;
76 BEFORE_EGL(eglGetProcAddress);
79 INIT_LIB(LIBSELF, RTLD_LAZY | RTLD_GLOBAL);
80 ret = (typeof(ret)) dlsym(lib_handle[LIBSELF], procname);
81 if (dlerror() != NULL)
86 // we don't have <procname> function in our lib
87 // so we need find original function
88 ret = eglGetProcAddressp(procname);
89 error = eglGetError();
92 AFTER_NO_PARAM('p', ret, APITYPE_CONTEXT, "");
96 #define eglGetProcAddress _eglGetProcAddress