[FIX] opengl api 42/25142/8
authorVitaliy Cherepanov <v.cherepanov@samsung.com>
Wed, 30 Jul 2014 08:22:00 +0000 (12:22 +0400)
committerVitaliy Andreevich <v.cherepanov@samsung.com>
Mon, 4 Aug 2014 11:46:17 +0000 (04:46 -0700)
Change-Id: I7828ca4af6b4f4985ea43a6e17be7ed6459ea714

12 files changed:
Makefile
helper/common_probe_init.c
helper/libdaprobe.c
include/common_probe_init.h
include/da_gl_api_func_list.h [new file with mode: 0644]
include/da_gles20.h
include/dahelper.h
include/daprobe.h
probe_graphics/da_evas_gl.c
probe_graphics/da_gl_api_init.c [new file with mode: 0644]
probe_graphics/da_gles20_native.cpp
probe_graphics/da_gles20_tizen.cpp

index b175428..f6dae95 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -98,7 +98,8 @@ TIZEN_SRCS =  $(COMMON_SRCS) $(CAPI_SRCS)\
                ./helper/common_probe_init.c                            \
                ./probe_memory/libdanew.cpp                                     \
                ./probe_graphics/da_evas_gl.c                           \
-               ./probe_graphics/da_gles20_tizen.cpp            \
+               ./probe_graphics/da_gl_api_init.c                       \
+               ./probe_graphics/da_gles20_tizen.cpp                    \
                ./probe_graphics/da_gles20_native.cpp
 
 ASM_SRC = ./helper/da_call_original.S
index 4ecabd7..277cfe5 100644 (file)
 #include "common_probe_init.h"
 
 //#define EGL_TEST
+Evas_GL_API *__gl_api;
+void (*real_glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat *params);
+void (*real_glGetIntegerv)(GLenum pname, GLint * params);
+void (*real_glGetProgramiv)(GLuint program, GLenum pname, GLint *params);
+void (*real_glGetShaderiv)(GLuint shader, GLenum pname, GLint *params);
+void (*real_glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize,
+                              GLsizei *length, GLint *size, GLenum *type,
+                              char *name);
+void (*real_glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize,
+                               GLsizei *length, GLint *size, GLenum *type,
+                               char *name);
+void (*real_glGetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei *length,
+                              char *source);
+
+void set_real_func(const char *func_name, void **func_pointer,
+                  ORIGINAL_LIBRARY id)
+{
+       void *faddr;
+       void *_id;
+
+       _id = dlopen(lib_string[id], RTLD_LAZY);
+       if (_id == NULL)
+               probe_terminate_with_err("dlopen failed", func_name, id);
+
+       faddr = dlsym(_id, func_name);
+       if (faddr == NULL || dlerror() != NULL)
+               probe_terminate_with_err("function not found in lib", func_name,
+                                        id);
+
+       memcpy(func_pointer, &faddr, sizeof(faddr));
+}
+
+#define INIT_REAL_GL(func)\
+       do {                                                                    \
+                set_real_func(#func, (void **)&real##_##func, LIBGLES20);      \
+       } while (0)
+
+int __init_gl_functions__(void)
+{
+       /* init gl API */
+       __init_gl_api__();
+
+       /* init real call functions */
+       INIT_REAL_GL(glGetVertexAttribfv);
+       INIT_REAL_GL(glGetProgramiv);
+       INIT_REAL_GL(glGetShaderiv);
+       INIT_REAL_GL(glGetActiveAttrib);
+       INIT_REAL_GL(glGetActiveUniform);
+       INIT_REAL_GL(glGetShaderSource);
+       INIT_REAL_GL(glGetIntegerv);
+
+       return 0;
+}
 
 void probe_terminate_with_err(const char *msg, const char *func_name,
                              ORIGINAL_LIBRARY id)
@@ -39,7 +92,7 @@ void probe_terminate_with_err(const char *msg, const char *func_name,
        char error_msg[1024];
        const char *lib_name = "unknown";
 
-       if (id < NUM_ORIGINAL_LIBRARY)
+       if (id != LIB_NO && id < NUM_ORIGINAL_LIBRARY)
                lib_name = lib_string[id];
        sprintf(error_msg, "%s : [%s], %s", msg, func_name, lib_name);
        perror(error_msg);
@@ -47,7 +100,6 @@ void probe_terminate_with_err(const char *msg, const char *func_name,
        //wait for flush
        sleep(1);
        exit(0);
-
 }
 
 ////////////////////////////////////////////////////////////////////////////
@@ -94,7 +146,6 @@ void init_probe_egl(const char *func_name, void **func_pointer,
 }
 #endif
 
-
 void init_probe_gl(const char *func_name, void **func_pointer,
                   ORIGINAL_LIBRARY id, int blockresult, int32_t vAPI_ID)
 {
@@ -105,15 +156,17 @@ void init_probe_gl(const char *func_name, void **func_pointer,
        if (lib_handle[id] == ((void *)0)) {
                lib_handle[id] = dlopen(lib_string[id], RTLD_LAZY);
                if (lib_handle[id] == ((void *)0))
-                       probe_terminate_with_err("dlopen failed", func_name, id);
+                       probe_terminate_with_err("dlopen failed", func_name,
+                                                id);
 
                setProbePoint(&tempProbeInfo);
                if (blockresult != 0) {
                        /* get max value */
                        char maxValString[64];
                        GLint maxVal[2];
-                       glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVal[0]);
-                       glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxVal[1]);
+                       real_glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVal[0]);
+                       real_glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS,
+                                          &maxVal[1]);
                        sprintf(maxValString, "%d,%d", maxVal[0], maxVal[1]);
                        PREPARE_LOCAL_BUF();
                        PACK_COMMON_BEGIN(MSG_PROBE_GL, vAPI_ID, "", 0);
index 4090e62..ed7c422 100755 (executable)
@@ -59,6 +59,7 @@
 #include "binproto.h"
 #include "daforkexec.h"
 #include "damaps.h"
+#include "common_probe_init.h"
 
 #define APP_INSTALL_PATH               "/opt/apps"
 #define TISEN_APP_POSTFIX                      ".exe"
@@ -459,6 +460,9 @@ void __attribute__((constructor)) _init_probe()
        /* init library */
        _init_();
 
+       /* init gl functions */
+       __init_gl_functions__();
+
        char msg[DA_LOG_MAX];
        sprintf(msg, "<-lib construnctor");
        PRINTMSG(msg);
index f2daf25..0e8f4f0 100644 (file)
@@ -33,6 +33,7 @@ extern "C" {
 #endif
 
 #include "dahelper.h"
+#include "da_gles20.h"
 ////////////////////////////////////////////////////////////////////////////
 //egl init probe function
 //  params:
@@ -51,6 +52,24 @@ extern void init_probe_gl(const char *func_name, void **func_pointer,
 extern void probe_terminate_with_err(const char *msg, const char *func_name,
                                     ORIGINAL_LIBRARY id);
 
+void __init_gl_api__(void);
+int __init_gl_functions__(void);
+
+/* links to real functions to call in probes */
+extern void (*real_glGetVertexAttribfv)(GLuint index, GLenum pname,
+                                       GLfloat *params);
+extern void (*real_glGetIntegerv)(GLenum pname, GLint * params);
+extern void (*real_glGetProgramiv)(GLuint program, GLenum pname, GLint *params);
+extern void (*real_glGetShaderiv)(GLuint shader, GLenum pname, GLint *params);
+extern void (*real_glGetActiveAttrib)(GLuint program, GLuint index,
+                                     GLsizei bufSize, GLsizei *length,
+                                     GLint *size, GLenum *type, char *name);
+extern void (*real_glGetActiveUniform)(GLuint program, GLuint index,
+                                      GLsizei bufSize, GLsizei *length,
+                                      GLint *size, GLenum *type, char *name);
+extern void (*real_glGetShaderSource)(GLuint shader, GLsizei bufSize,
+                                     GLsizei *length, char *source);
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif
diff --git a/include/da_gl_api_func_list.h b/include/da_gl_api_func_list.h
new file mode 100644 (file)
index 0000000..5da8ca0
--- /dev/null
@@ -0,0 +1,177 @@
+/*
+ *  DA probe
+ *
+ * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ *
+ * Vitaliy Cherepanov <v.cherepanov@samsung.com>
+ *
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Contributors:
+ * - Samsung RnD Institute Russia
+ *
+ */
+
+#ifndef _DA_GL_API_FUNC_LIST_H
+#define _DA_GL_API_FUNC_LIST_H
+
+#define GL_ALL_FUNCTIONS \
+ X(glActiveTexture) \
+ X(glAttachShader) \
+ X(glBindAttribLocation) \
+ X(glBindBuffer) \
+ X(glBindFramebuffer) \
+ X(glBindRenderbuffer) \
+ X(glBindTexture) \
+ X(glBlendColor) \
+ X(glBlendEquation) \
+ X(glBlendEquationSeparate) \
+ X(glBlendFunc) \
+ X(glBlendFuncSeparate) \
+ X(glBufferData) \
+ X(glBufferSubData) \
+ X(glCheckFramebufferStatus) \
+ X(glClear) \
+ X(glClearColor) \
+ X(glClearDepthf) \
+ X(glClearStencil) \
+ X(glColorMask) \
+ X(glCompileShader) \
+ X(glCompressedTexImage2D) \
+ X(glCompressedTexSubImage2D) \
+ X(glCopyTexImage2D) \
+ X(glCopyTexSubImage2D) \
+ X(glCreateProgram) \
+ X(glCreateShader) \
+ X(glCullFace) \
+ X(glDeleteBuffers) \
+ X(glDeleteFramebuffers) \
+ X(glDeleteProgram) \
+ X(glDeleteRenderbuffers) \
+ X(glDeleteShader) \
+ X(glDeleteTextures) \
+ X(glDepthFunc) \
+ X(glDepthMask) \
+ X(glDepthRangef) \
+ X(glDetachShader) \
+ X(glDisable) \
+ X(glDisableVertexAttribArray) \
+ X(glDrawArrays) \
+ X(glDrawElements) \
+ X(glEnable) \
+ X(glEnableVertexAttribArray) \
+ X(glFinish) \
+ X(glFlush) \
+ X(glFramebufferRenderbuffer) \
+ X(glFramebufferTexture2D) \
+ X(glFrontFace) \
+ X(glGenBuffers) \
+ X(glGenFramebuffers) \
+ X(glGenRenderbuffers) \
+ X(glGenTextures) \
+ X(glGenerateMipmap) \
+ X(glGetBooleanv) \
+ X(glGetFloatv) \
+ X(glGetIntegerv) \
+ X(glGetActiveAttrib) \
+ X(glGetActiveUniform) \
+ X(glGetAttachedShaders) \
+ X(glGetAttribLocation) \
+ X(glGetBufferParameteriv) \
+ X(glGetError) \
+ X(glGetFramebufferAttachmentParameteriv) \
+ X(glGetProgramInfoLog) \
+ X(glGetProgramiv) \
+ X(glGetRenderbufferParameteriv) \
+ X(glGetShaderInfoLog) \
+ X(glGetShaderPrecisionFormat) \
+ X(glGetShaderSource) \
+ X(glGetShaderiv) \
+ X(glGetString) \
+ X(glGetTexParameterfv) \
+ X(glGetTexParameteriv) \
+ X(glGetUniformfv) \
+ X(glGetUniformiv) \
+ X(glGetUniformLocation) \
+ X(glGetVertexAttribfv) \
+ X(glGetVertexAttribiv) \
+ X(glGetVertexAttribPointerv) \
+ X(glHint) \
+ X(glIsBuffer) \
+ X(glIsEnabled) \
+ X(glIsFramebuffer) \
+ X(glIsProgram) \
+ X(glIsRenderbuffer) \
+ X(glIsShader) \
+ X(glIsTexture) \
+ X(glLineWidth) \
+ X(glLinkProgram) \
+ X(glPixelStorei) \
+ X(glPolygonOffset) \
+ X(glReadPixels) \
+ X(glReleaseShaderCompiler) \
+ X(glRenderbufferStorage) \
+ X(glSampleCoverage) \
+ X(glScissor) \
+ X(glShaderBinary) \
+ X(glShaderSource) \
+ X(glStencilFunc) \
+ X(glStencilFuncSeparate) \
+ X(glStencilMask) \
+ X(glStencilMaskSeparate) \
+ X(glStencilOp) \
+ X(glStencilOpSeparate) \
+ X(glTexImage2D) \
+ X(glTexParameterf) \
+ X(glTexParameterfv) \
+ X(glTexParameteri) \
+ X(glTexParameteriv) \
+ X(glTexSubImage2D) \
+ X(glUniform1f) \
+ X(glUniform2f) \
+ X(glUniform3f) \
+ X(glUniform4f) \
+ X(glUniform1fv) \
+ X(glUniform2fv) \
+ X(glUniform3fv) \
+ X(glUniform4fv) \
+ X(glUniform1i) \
+ X(glUniform2i) \
+ X(glUniform3i) \
+ X(glUniform4i) \
+ X(glUniform1iv) \
+ X(glUniform2iv) \
+ X(glUniform3iv) \
+ X(glUniform4iv) \
+ X(glUniformMatrix2fv) \
+ X(glUniformMatrix3fv) \
+ X(glUniformMatrix4fv) \
+ X(glUseProgram) \
+ X(glValidateProgram) \
+ X(glVertexAttrib1f) \
+ X(glVertexAttrib2f) \
+ X(glVertexAttrib3f) \
+ X(glVertexAttrib4f) \
+ X(glVertexAttrib1fv) \
+ X(glVertexAttrib2fv) \
+ X(glVertexAttrib3fv) \
+ X(glVertexAttrib4fv) \
+ X(glVertexAttribPointer) \
+ X(glViewport)
+
+
+#endif /*_DA_GL_API_FUNC_LIST_H */
index d3e3cf8..1d6dcbc 100644 (file)
@@ -85,7 +85,7 @@ extern EGLContext eglGetCurrentContext(void);
                                              GL_shader_size, min);             \
        } while (0)
 
-#define BEFORE(FUNCNAME)                                               \
+#define BEFORE_GL_ORIG(FUNCNAME)                                       \
        DECLARE_VARIABLE_STANDARD_NORET;                                \
        GLenum error = GL_NO_ERROR;                                     \
        static methodType FUNCNAME ## p = 0;                            \
@@ -99,6 +99,19 @@ extern EGLContext eglGetCurrentContext(void);
                              LIBGLES20, blockresult, vAPI_ID);         \
        }
 
+#define BEFORE_GL_API(FUNCNAME)                                                \
+       DECLARE_VARIABLE_STANDARD_NORET;                                \
+       GLenum error = GL_NO_ERROR;                                     \
+       int32_t vAPI_ID = API_ID_ ## FUNCNAME;                          \
+       uint64_t start_nsec = 0;                                        \
+       PRE_PROBEBLOCK();                                               \
+       if(blockresult != 0)                                            \
+               start_nsec = get_current_nsec();                        \
+       if(!__gl_api->FUNCNAME) {                                               \
+               probe_terminate_with_err("api not initialized",         \
+                                        #FUNCNAME, LIBGLES20);         \
+       }
+
 #define INIT_LIB_ID_STR(LIB_ID, LIB_STR, KEYS)                                                 \
                if (lib_handle[LIB_ID] == ((void *) 0)) {               \
                        lib_handle[LIB_ID] = dlopen(LIB_STR, RTLD_LAZY | RTLD_GLOBAL); \
@@ -171,6 +184,9 @@ extern EGLContext eglGetCurrentContext(void);
 
 GLenum glGetError(void);
 void glGetIntegerv(GLenum pname, GLint * params);
+extern Evas_GL_API *__gl_api;
+extern void save_orig_gl_api_list(Evas_GL_API *api);
+extern void change_gl_api_list(Evas_GL_API *api);
 
 #endif /* DA_GLES20_H_ */
 
index 5a1f790..1cffa8e 100755 (executable)
@@ -142,6 +142,7 @@ extern int app_efl_main_flg;
 
 typedef enum
 {
+       LIB_NO = -1,
        LIBC = 0,
        LIBPTHREAD = 1,
        LIBELEMENTARY = 2,
index 3e62798..a16d3bd 100644 (file)
@@ -233,7 +233,7 @@ typedef struct {
                                probeBlockStart();                                                                      \
                                FUNCTIONPOINTER = dlsym(RTLD_NEXT, #FUNCNAME);          \
                                if(FUNCTIONPOINTER == NULL || dlerror() != NULL)        \
-                                       probe_terminate_with_err("function not found", #FUNCNAME, -1);          \
+                                       probe_terminate_with_err("function not found", #FUNCNAME, LIB_NO);              \
                                probeBlockEnd();                                                                        \
                        }                                                                                                               \
                } while(0)
index 4ed385f..8706284 100644 (file)
@@ -75,7 +75,6 @@ void evas_gl_context_destroy(Evas_GL *evas_gl, Evas_GL_Context *ctx)
              evas_gl, ctx);
 }
 
-
 Evas_GL *evas_gl_new(Evas *e)
 {
        typedef Evas_GL *(*methodType)(Evas *e);
@@ -114,7 +113,8 @@ Evas_GL_Surface *evas_gl_surface_create(Evas_GL *evas_gl, Evas_GL_Config *cfg,
 Evas_GL_Context *evas_gl_context_create(Evas_GL *evas_gl,
                                        Evas_GL_Context *share_ctx)
 {
-       typedef Evas_GL_Context *(*methodType)(Evas_GL *evas_gl, Evas_GL_Context *share_ctx);
+       typedef Evas_GL_Context *(*methodType)(Evas_GL *evas_gl,
+                                              Evas_GL_Context *share_ctx);
        BEFORE_EVAS_GL(evas_gl_context_create);
        Evas_GL_Context *res = evas_gl_context_createp(evas_gl, share_ctx);
        GL_GET_ERROR();
@@ -177,9 +177,12 @@ Evas_GL_API *evas_gl_api_get(Evas_GL *evas_gl)
        BEFORE_EVAS_GL(evas_gl_api_get);
        Evas_GL_API *res = evas_gl_api_getp(evas_gl);
 
+       /* save original api functions and rewrite it by probes */
+       save_orig_gl_api_list(res);
+       change_gl_api_list(res);
+
        GL_GET_ERROR();
        AFTER('p', res, APITYPE_CONTEXT, "", "p",
              evas_gl);
        return res;
 }
-
diff --git a/probe_graphics/da_gl_api_init.c b/probe_graphics/da_gl_api_init.c
new file mode 100644 (file)
index 0000000..e01125d
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ *  DA probe
+ *
+ * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ *
+ * Vitaliy Cherepanov <v.cherepanov@samsung.com>
+ *
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <unistd.h>
+#include "da_gles20.h"
+#include "binproto.h"
+#include "common_probe_init.h"
+
+/* GL __local_* functions prototypes */
+#define X(func) extern void __local_##func(void);
+#include "da_gl_api_func_list.h"
+       GL_ALL_FUNCTIONS;
+#undef X
+/* --------------------------------- */
+
+
+Evas_GL_API *__gl_api = NULL;
+
+void __init_gl_api__(void)
+{
+       if (__gl_api == NULL)
+               __gl_api = malloc(sizeof(*__gl_api));
+       memset(__gl_api, 0, sizeof(*__gl_api));
+}
+
+void save_orig_gl_api_list(Evas_GL_API *api)
+{
+       memcpy(__gl_api, api, sizeof(*api));
+}
+
+/* IMPORTANT this code must be right before change_gl_api_list function!
+ *
+ * next define is GL api replacing by probe functions
+ *
+ */
+#define X(func) \
+       do {                                                    \
+               api->func = (typeof(api->func)) __local_##func; \
+               if (api->func == NULL)                          \
+                       PRINTWRN("api->%s not setted", #func);  \
+       } while(0);
+#include "da_gl_api_func_list.h"
+/* --------------------------------------------------------------------- */
+
+void change_gl_api_list(Evas_GL_API *api)
+{
+       /* change links */
+       GL_ALL_FUNCTIONS;
+}
+
+#undef X
index 51fbed9..8b4a7d0 100644 (file)
@@ -1,10 +1,12 @@
 /*
  *  DA probe
  *
- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact:
  *
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
  * Vitaliy Cherepanov <v.cherepanov@samsung.com>
  *
  * This library is free software; you can redistribute it and/or modify it under
  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  *
  * Contributors:
+ * - S-Core Co., Ltd
  * - Samsung RnD Institute Russia
  *
  */
 
-//disable tizen redefines
-#define _GL2_MACRO_H_
-#define _GL_MACRO_H_
-
+#include "da_gles20.h"
+#include "daprobe.h"
+#include "binproto.h"
 #include "common_probe_init.h"
-extern "C" {
-/*
- * this include to make C native open gl functions
- * probe prototypes
- *
- */
 
-#include "da_gles20_tizen.cpp"
+#ifndef REAL_NAME
+       #define REAL_NAME(func) func
+#endif
+
+#ifndef CALL_ORIG
+       #define CALL_ORIG(func, ...) func##p(__VA_ARGS__)
+#endif
+
+#ifndef BEFORE
+       #define BEFORE BEFORE_GL_ORIG
+#endif
+
+static char contextValue[MAX_GL_CONTEXT_VALUE_SIZE];
+static enum DaOptions _sopt = OPT_GLES;
+static __thread GLenum gl_error_external = GL_NO_ERROR;
+
+static void __ui_array_to_str(char *to, GLuint *arr ,int count)
+{
+       int i = 0;
+
+       for (i = 0; i < count; i++)
+               to += sprintf(to, "%u, ", *arr++);
+
+       if (count != 0) {
+               to -= 2;
+               *to = '\0';
+       }
+}
+
+GLenum REAL_NAME(glGetError)(void)
+{
+       typedef GLenum (*methodType)(void);
+       BEFORE(glGetError);
+       GLenum ret = CALL_ORIG(glGetError,);
+
+       if (gl_error_external == GL_NO_ERROR)
+               gl_error_external = ret;
+
+       if (blockresult) {
+               //external call
+               ret = gl_error_external;
+               gl_error_external = GL_NO_ERROR;
+       }
+
+       AFTER_NO_PARAM('d', ret, APITYPE_CONTEXT, "");
+
+       return ret;
+}
+
+// ==================================================================
+// A 2
+// ==================================================================
+
+void REAL_NAME(glActiveTexture)(GLenum texture)
+{
+       typedef void (*methodType)(GLenum);
+       BEFORE(glActiveTexture);
+       CALL_ORIG(glActiveTexture, texture);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x",
+             (uint64_t)(texture));
+}
+
+void REAL_NAME(glAttachShader)(GLuint program, GLuint shader)
+{
+       typedef void (*methodType)(GLuint, GLuint);
+       BEFORE(glAttachShader);
+       CALL_ORIG(glAttachShader, program, shader);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dd", program, shader);
+}
+
+// ==================================================================
+// B 12
+// ==================================================================
+
+void REAL_NAME(glBindAttribLocation)(GLuint program, GLuint index, const char *name)
+{
+       typedef void (*methodType)(GLuint, GLuint, const char *);
+       BEFORE(glBindAttribLocation);
+       CALL_ORIG(glBindAttribLocation, program, index, name);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dds",
+             program, index, name);
+}
+
+void REAL_NAME(glBindBuffer)(GLenum target, GLuint buffer)
+{
+       typedef void (*methodType)(GLenum, GLuint);
+       BEFORE(glBindBuffer);
+       CALL_ORIG(glBindBuffer, target, buffer);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xd",
+             (uint64_t)(target), buffer);
+}
+
+void REAL_NAME(glBindFramebuffer)(GLenum target, GLuint framebuffer)
+{
+       typedef void (*methodType)(GLenum, GLuint);
+       BEFORE(glBindFramebuffer);
+       CALL_ORIG(glBindFramebuffer, target, framebuffer);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xd",
+             (uint64_t)(target), framebuffer);
+}
+
+void REAL_NAME(glBindRenderbuffer)(GLenum target, GLuint renderbuffer)
+{
+       typedef void (*methodType)(GLenum, GLuint);
+       BEFORE(glBindRenderbuffer);
+       CALL_ORIG(glBindRenderbuffer, target, renderbuffer);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xd",
+             (uint64_t)(target), renderbuffer);
+}
+
+void REAL_NAME(glBindTexture)(GLenum target, GLuint texture)
+{
+       typedef void (*methodType)(GLenum, GLuint);
+       BEFORE(glBindTexture);
+       CALL_ORIG(glBindTexture, target, texture);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xd",
+             (uint64_t)(target), texture);
+}
+
+void REAL_NAME(glBlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+       typedef void (*methodType)(GLclampf, GLclampf, GLclampf, GLclampf);
+       BEFORE(glBlendColor);
+       CALL_ORIG(glBlendColor, red, green, blue, alpha);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ffff",
+             red, green, blue, alpha);
+}
+
+void REAL_NAME(glBlendEquation)(GLenum mode)
+{
+       typedef void (*methodType)(GLenum);
+       BEFORE(glBlendEquation);
+       CALL_ORIG(glBlendEquation, mode);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x",
+             (uint64_t)(mode));
+}
+
+void REAL_NAME(glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha)
+{
+       typedef void (*methodType)(GLenum, GLenum);
+       BEFORE(glBlendEquationSeparate);
+       CALL_ORIG(glBlendEquationSeparate, modeRGB, modeAlpha);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xx",
+             (uint64_t)(modeRGB), (uint64_t)(modeAlpha));
+}
+
+void REAL_NAME(glBlendFunc)(GLenum sfactor, GLenum dfactor)
+{
+       typedef void (*methodType)(GLenum, GLenum);
+       BEFORE(glBlendFunc);
+       CALL_ORIG(glBlendFunc, sfactor, dfactor);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xx",
+             (uint64_t)(sfactor), (uint64_t)(dfactor));
+}
+
+void REAL_NAME(glBlendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha,
+                        GLenum dstAlpha)
+{
+       typedef void (*methodType)(GLenum, GLenum, GLenum, GLenum);
+       BEFORE(glBlendFuncSeparate);
+       CALL_ORIG(glBlendFuncSeparate, srcRGB, dstRGB, srcAlpha, dstAlpha);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxxx",
+             (uint64_t)(srcRGB), (uint64_t)(dstRGB),
+             (uint64_t)(srcAlpha), (uint64_t)(dstAlpha));
+}
+
+void REAL_NAME(glBufferData)(GLenum target, GLsizeiptr size, const GLvoid * data,
+                 GLenum usage)
+{
+       typedef void (*methodType)(GLenum, GLsizeiptr, const GLvoid *, GLenum);
+       BEFORE(glBufferData);
+       CALL_ORIG(glBufferData, target, size, data, usage);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxpx",
+             (uint64_t)(target), (uint64_t)(size),
+             voidp_to_uint64(data), (uint64_t)(usage));
+}
+
+void REAL_NAME(glBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size,
+                    const GLvoid * data)
+{
+       typedef void (*methodType)(GLenum, GLintptr, GLsizeiptr,
+                                  const GLvoid *);
+       BEFORE(glBufferSubData);
+       CALL_ORIG(glBufferSubData, target, offset, size, data);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxxp",
+             (uint64_t)(target), (uint64_t)(offset),
+             (uint64_t)(size), voidp_to_uint64(data));
+}
+
+// ==================================================================
+// C 14
+// ==================================================================
+
+GLenum REAL_NAME(glCheckFramebufferStatus)(GLenum target)
+{
+       typedef GLenum (*methodType)(GLenum);
+       BEFORE(glCheckFramebufferStatus);
+       GLenum ret = CALL_ORIG(glCheckFramebufferStatus, target);
+       GL_GET_ERROR();
+       AFTER('d', ret, APITYPE_CONTEXT, "", "x",
+             (uint64_t)(target));
+
+       return ret;
+}
+
+void REAL_NAME(glClear)(GLbitfield mask)
+{
+       typedef void (*methodType)(GLbitfield);
+       BEFORE(glClear);
+       CALL_ORIG(glClear, mask);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x",
+             (uint64_t)(mask));
+}
+
+void REAL_NAME(glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+       typedef void (*methodType)(GLclampf, GLclampf, GLclampf, GLclampf);
+       BEFORE(glClearColor);
+       CALL_ORIG(glClearColor, red, green, blue, alpha);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ffff",
+             red, green, blue, alpha);
+}
+
+void REAL_NAME(glClearDepthf)(GLclampf depth)
+{
+       typedef void (*methodType)(GLclampf);
+       BEFORE(glClearDepthf);
+       CALL_ORIG(glClearDepthf, depth);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "f", depth);
+}
+
+void REAL_NAME(glClearStencil)(GLint s)
+{
+       typedef void (*methodType)(GLint);
+       BEFORE(glClearStencil);
+       CALL_ORIG(glClearStencil, s);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "d", s);
+}
+
+void REAL_NAME(glColorMask)(GLboolean red, GLboolean green, GLboolean blue,
+                GLboolean alpha)
+{
+       typedef void (*methodType)(GLboolean, GLboolean, GLboolean, GLboolean);
+       BEFORE(glColorMask);
+       CALL_ORIG(glColorMask, red, green, blue, alpha);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dddd",
+             red, green, blue, alpha);
+}
+
+void REAL_NAME(glCompileShader)(GLuint shader)
+{
+       typedef void (*methodType)(GLuint);
+       BEFORE(glCompileShader);
+       CALL_ORIG(glCompileShader, shader);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x",
+             (uint64_t)(shader));
+}
+
+void REAL_NAME(glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat,
+                           GLsizei width, GLsizei height, GLint border,
+                           GLsizei imageSize, const GLvoid * data)
+{
+       typedef void (*methodType)(GLenum, GLint, GLenum, GLsizei, GLsizei,
+                                  GLint, GLsizei, const GLvoid *);
+       BEFORE(glCompressedTexImage2D);
+       CALL_ORIG(glCompressedTexImage2D, target, level, internalformat, width,
+                 height, border, imageSize, data);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xdxddddp",
+             (uint64_t)(target), level,
+             (uint64_t)(internalformat), width, height, border, imageSize,
+             voidp_to_uint64(data));
+}
+
+void REAL_NAME(glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset,
+                              GLint yoffset, GLsizei width, GLsizei height,
+                              GLenum format, GLsizei imageSize,
+                              const GLvoid * data)
+{
+       typedef void (*methodType)(GLenum, GLint, GLint, GLint, GLsizei,
+                                  GLsizei, GLenum, GLsizei, const GLvoid *);
+       BEFORE(glCompressedTexSubImage2D);
+       CALL_ORIG(glCompressedTexSubImage2D, target, level, xoffset, yoffset,
+                 width, height, format, imageSize, data);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xdddddxdp",
+             (uint64_t)(target), level, xoffset, yoffset, width, height,
+             (uint64_t)(format), imageSize, voidp_to_uint64(data));
+}
+
+void REAL_NAME(glCopyTexImage2D)(GLenum target, GLint level, GLenum internalformat,
+                     GLint x, GLint y, GLsizei width, GLsizei height,
+                     GLint border)
+{
+       typedef void (*methodType)(GLenum, GLint, GLenum, GLint, GLint,
+                                  GLsizei, GLsizei, GLint);
+       BEFORE(glCopyTexImage2D);
+       CALL_ORIG(glCopyTexImage2D, target, level, internalformat, x, y, width,
+                 height, border);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xdxddddd",
+             (uint64_t)(target), level,
+             (uint64_t)(internalformat), x, y, width, height, border);
+}
+
+void REAL_NAME(glCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset,
+                        GLint yoffset, GLint x, GLint y, GLsizei width,
+                        GLsizei height)
+{
+       typedef void (*methodType)(GLenum, GLint, GLint, GLint, GLint, GLint,
+                                  GLsizei, GLsizei);
+       BEFORE(glCopyTexSubImage2D);
+       CALL_ORIG(glCopyTexSubImage2D, target, level, xoffset, yoffset, x, y,
+                 width, height);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xddddddd",
+             (uint64_t)(target), level, xoffset, yoffset, x, y, width,
+             height);
+}
+
+GLuint REAL_NAME(glCreateProgram)(void)
+{
+       typedef GLuint (*methodType)(void);
+       BEFORE(glCreateProgram);
+       GLuint ret = CALL_ORIG(glCreateProgram,);
+       GL_GET_ERROR();
+       AFTER_NO_PARAM('d', ret, APITYPE_CONTEXT, "");
+
+       return ret;
+}
+
+GLuint REAL_NAME(glCreateShader)(GLenum shaderType)
+{
+       typedef GLuint (*methodType)(GLenum);
+       BEFORE(glCreateShader);
+       GLuint ret = CALL_ORIG(glCreateShader, shaderType);
+       GL_GET_ERROR();
+       AFTER('d', ret, APITYPE_CONTEXT, "", "x", (uint64_t)(shaderType));
+
+       return ret;
+}
+
+void REAL_NAME(glCullFace)(GLenum mode)
+{
+       typedef void (*methodType)(GLenum);
+       BEFORE(glCullFace);
+       CALL_ORIG(glCullFace, mode);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x",
+             (uint64_t)(mode));
+}
+
+// ==================================================================
+// D 14
+// ==================================================================
+
+void REAL_NAME(glDeleteBuffers)(GLsizei n, const GLuint * buffers)
+{
+       typedef void (*methodType)(GLsizei, const GLuint *);
+       BEFORE(glDeleteBuffers);
+       CALL_ORIG(glDeleteBuffers, n, buffers);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dp",
+             n, voidp_to_uint64(buffers));
+}
+
+void REAL_NAME(glDeleteFramebuffers)(GLsizei n, const GLuint * framebuffers)
+{
+       typedef void (*methodType)(GLsizei, const GLuint *);
+       BEFORE(glDeleteFramebuffers);
+       CALL_ORIG(glDeleteFramebuffers, n, framebuffers);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dp",
+             n, voidp_to_uint64(framebuffers));
+}
+
+void REAL_NAME(glDeleteProgram)(GLuint program)
+{
+       typedef void (*methodType)(GLuint);
+       BEFORE(glDeleteProgram);
+       CALL_ORIG(glDeleteProgram, program);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "d", program);
+}
+
+void REAL_NAME(glDeleteRenderbuffers)(GLsizei n, const GLuint * renderbuffers)
+{
+       typedef void (*methodType)(GLsizei, const GLuint *);
+       BEFORE(glDeleteRenderbuffers);
+       CALL_ORIG(glDeleteRenderbuffers, n, renderbuffers);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dp",
+             n, voidp_to_uint64(renderbuffers));
+}
+
+void REAL_NAME(glDeleteShader)(GLuint shader)
+{
+       typedef void (*methodType)(GLuint);
+       BEFORE(glDeleteShader);
+       CALL_ORIG(glDeleteShader, shader);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "d", shader);
+}
+
+void REAL_NAME(glDeleteTextures)(GLsizei n, const GLuint *textures)
+{
+       typedef void (*methodType)(GLsizei, const GLuint *);
+       char buf[128] = "";
+
+       BEFORE(glDeleteTextures);
+       CALL_ORIG(glDeleteTextures, n, textures);
+       GL_GET_ERROR();
+       if (error == GL_NO_ERROR)
+               __ui_array_to_str(buf, (GLuint *)textures, n);
+
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, buf, "dp",
+             n, voidp_to_uint64(textures));
+}
+
+void REAL_NAME(glDepthFunc)(GLenum func)
+{
+       typedef void (*methodType)(GLenum);
+       BEFORE(glDepthFunc);
+       CALL_ORIG(glDepthFunc, func);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x",
+             (uint64_t)(func));
+}
+
+void REAL_NAME(glDepthMask)(GLboolean flag)
+{
+       typedef void (*methodType)(GLboolean);
+       BEFORE(glDepthMask);
+       CALL_ORIG(glDepthMask, flag);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x",
+             (uint64_t)(flag));
+}
+
+void REAL_NAME(glDepthRangef)(GLclampf nearVal, GLclampf farVal)
+{
+       typedef void (*methodType)(GLclampf, GLclampf);
+       BEFORE(glDepthRangef);
+       CALL_ORIG(glDepthRangef, nearVal, farVal);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ff",
+             nearVal, farVal);
+}
+
+void REAL_NAME(glDetachShader)(GLuint program, GLuint shader)
+{
+       typedef void (*methodType)(GLuint, GLuint);
+       BEFORE(glDetachShader);
+       CALL_ORIG(glDetachShader, program, shader);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dd",
+             program, shader);
+}
+
+void REAL_NAME(glDisable)(GLenum cap)
+{
+       typedef void (*methodType)(GLenum);
+       BEFORE(glDisable);
+       CALL_ORIG(glDisable, cap);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x", (uint64_t)(cap));
+}
+
+void REAL_NAME(glDisableVertexAttribArray)(GLuint index)
+{
+       typedef void (*methodType)(GLuint);
+       BEFORE(glDisableVertexAttribArray);
+       CALL_ORIG(glDisableVertexAttribArray, index);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "d", index);
+}
+
+void REAL_NAME(glDrawArrays)(GLenum mode, GLint first, GLsizei count)
+{
+       typedef void (*methodType)(GLenum, GLint, GLsizei);
+       BEFORE(glDrawArrays);
+       CALL_ORIG(glDrawArrays, mode, first, count);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xdd",
+             (uint64_t)(mode), first, count);
+}
+
+void REAL_NAME(glDrawElements)(GLenum mode, GLsizei count, GLenum type,
+               const GLvoid *indices)
+{
+       typedef void (*methodType)(GLenum, GLsizei, GLenum, const GLvoid *);
+       BEFORE(glDrawElements);
+       CALL_ORIG(glDrawElements, mode, count, type, indices);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xdxp",
+             (uint64_t)(mode), count, (uint64_t)(type), indices);
+}
+
+// ==================================================================
+// E 2
+// ==================================================================
+
+void REAL_NAME(glEnable)(GLenum cap)
+{
+       typedef void (*methodType)(GLenum);
+       BEFORE(glEnable);
+       CALL_ORIG(glEnable, cap);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x", (uint64_t)(cap));
+}
+
+void REAL_NAME(glEnableVertexAttribArray)(GLuint index)
+{
+       typedef void (*methodType)(GLuint);
+       BEFORE(glEnableVertexAttribArray);
+       CALL_ORIG(glEnableVertexAttribArray, index);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "d", index);
+}
+
+// ==================================================================
+// F 5
+// ==================================================================
+
+void REAL_NAME(glFinish)(void)
+{
+       typedef void (*methodType)(void);
+       BEFORE(glFinish);
+       CALL_ORIG(glFinish,);
+       GL_GET_ERROR();
+       AFTER_NO_PARAM('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "");
+}
+
+void REAL_NAME(glFlush)(void)
+{
+       typedef void (*methodType)(void);
+       BEFORE(glFlush);
+       CALL_ORIG(glFlush,);
+       GL_GET_ERROR();
+       AFTER_NO_PARAM('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "");
+}
+
+void REAL_NAME(glFramebufferRenderbuffer)(GLenum target, GLenum attachment,
+                              GLenum renderbuffertarget, GLuint renderbuffer)
+{
+       typedef void (*methodType)(GLenum, GLenum, GLenum, GLuint);
+       BEFORE(glFramebufferRenderbuffer);
+       CALL_ORIG(glFramebufferRenderbuffer, target, attachment,
+                 renderbuffertarget, renderbuffer);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxxd",
+             (uint64_t)(target), (uint64_t)(attachment),
+             (uint64_t)(renderbuffertarget), renderbuffer);
+}
+
+void REAL_NAME(glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget,
+                           GLuint texture, GLint level)
+{
+       typedef void (*methodType)(GLenum, GLenum, GLenum, GLuint, GLint);
+       BEFORE(glFramebufferTexture2D);
+       CALL_ORIG(glFramebufferTexture2D, target, attachment, textarget,
+                 texture, level);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxxdd",
+             (uint64_t)(target), (uint64_t)(attachment),
+             (uint64_t)(textarget), texture, level);
+}
+
+void REAL_NAME(glFrontFace)(GLenum mode)
+{
+       typedef void (*methodType)(GLenum);
+       BEFORE(glFrontFace);
+       CALL_ORIG(glFrontFace, mode);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x",
+             (uint64_t)(mode));
+}
+
+// ==================================================================
+// G 31
+// ==================================================================
+
+void REAL_NAME(glGenBuffers)(GLsizei n, GLuint * buffers)
+{
+       typedef void (*methodType)(GLsizei, GLuint *);
+       char buf[128] = "";
+
+       BEFORE(glGenBuffers);
+       CALL_ORIG(glGenBuffers, n, buffers);
+       GL_GET_ERROR();
+       if (error == GL_NO_ERROR)
+               __ui_array_to_str(buf, buffers, n);
+
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, buf, "dp",
+             n, voidp_to_uint64(buffers));
+}
+
+void REAL_NAME(glGenFramebuffers)(GLsizei n, GLuint * framebuffers)
+{
+       typedef void (*methodType)(GLsizei, GLuint *);
+       BEFORE(glGenFramebuffers);
+       CALL_ORIG(glGenFramebuffers, n, framebuffers);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dp",
+             n, voidp_to_uint64(framebuffers));
+}
+
+void REAL_NAME(glGenRenderbuffers)(GLsizei n, GLuint * renderbuffers)
+{
+       typedef void (*methodType)(GLsizei, GLuint *);
+       BEFORE(glGenRenderbuffers);
+       CALL_ORIG(glGenRenderbuffers, n, renderbuffers);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dp",
+             n, voidp_to_uint64(renderbuffers));
+}
+
+void REAL_NAME(glGenTextures)(GLsizei n, GLuint * textures)
+{
+       typedef void (*methodType)(GLsizei, GLuint *);
+       char buf[128] = "";
+
+       BEFORE(glGenTextures);
+       CALL_ORIG(glGenTextures, n, textures);
+       GL_GET_ERROR();
+       if (error == GL_NO_ERROR)
+               __ui_array_to_str(buf, textures, n);
+
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, buf, "dp",
+             n, voidp_to_uint64(textures));
+}
+
+void REAL_NAME(glGenerateMipmap)(GLenum target)
+{
+       typedef void (*methodType)(GLenum);
+       BEFORE(glGenerateMipmap);
+       CALL_ORIG(glGenerateMipmap, target);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x",
+             (uint64_t)(target));
+}
+
+//lsh_get
+void REAL_NAME(glGetBooleanv)(GLenum pname, GLboolean * params)
+{
+       typedef void (*methodType)(GLenum, GLboolean *);
+       BEFORE(glGetBooleanv);
+       CALL_ORIG(glGetBooleanv, pname, params);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x",
+             (uint64_t)(pname));
+}
+
+//lsh_get
+void REAL_NAME(glGetFloatv)(GLenum pname, GLfloat * params)
+{
+       typedef void (*methodType)(GLenum, GLfloat *);
+       BEFORE(glGetFloatv);
+       CALL_ORIG(glGetFloatv, pname, params);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x",
+             (uint64_t)(pname));
+}
+
+//lsh_get
+void REAL_NAME(glGetIntegerv)(GLenum pname, GLint * params)
+{
+       typedef void (*methodType)(GLenum, GLint *);
+       BEFORE(glGetIntegerv);
+       CALL_ORIG(glGetIntegerv, pname, params);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x",
+             (uint64_t)(pname));
+}
+
+//lsh_get
+void REAL_NAME(glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize,
+                      GLsizei *length, GLint *size, GLenum *type, char *name)
+{
+       typedef void (*methodType)(GLuint, GLuint, GLsizei, GLsizei *, GLint *,
+                                  GLenum *, char *);
+       BEFORE(glGetActiveAttrib);
+       CALL_ORIG(glGetActiveAttrib, program, index, bufSize, length, size,
+                 type, name);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddd",
+             program, index, bufSize);
+}
+
+//lsh_get
+void REAL_NAME(glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize,
+                       GLsizei *length, GLint *size, GLenum *type, char *name)
+{
+       typedef void (*methodType)(GLuint, GLuint, GLsizei, GLsizei *, GLint *,
+                                  GLenum *, char *);
+       BEFORE(glGetActiveUniform);
+       CALL_ORIG(glGetActiveUniform, program, index, bufSize, length, size,
+                 type, name);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddd",
+             program, index, bufSize);
+}
+
+//lsh_get
+void REAL_NAME(glGetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei *count,
+                         GLuint *shaders)
+{
+       typedef void (*methodType)(GLuint, GLsizei, GLsizei *, GLuint *);
+       BEFORE(glGetAttachedShaders);
+       CALL_ORIG(glGetAttachedShaders, program, maxCount, count, shaders);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dd",
+             program, maxCount);
+}
+
+//lsh_get
+int REAL_NAME(glGetAttribLocation)(GLuint program, const char *name)
+{
+       typedef int (*methodType)(GLuint, const char*);
+       BEFORE(glGetAttribLocation);
+       int ret = CALL_ORIG(glGetAttribLocation, program, name);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xs",
+             (uint64_t)(program), name);
+       return ret;
+}
+
+//lsh_get
+void REAL_NAME(glGetBufferParameteriv)(GLenum target, GLenum value, GLint * data)
+{
+       typedef void (*methodType)(GLenum, GLenum, GLint *);
+       BEFORE(glGetBufferParameteriv);
+       CALL_ORIG(glGetBufferParameteriv, target, value, data);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xx",
+             (uint64_t)(target), (uint64_t)(value));
+}
+
+//lsh_get
+void REAL_NAME(glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment,
+                                          GLenum pname, GLint * params)
+{
+       typedef void (*methodType)(GLenum, GLenum, GLenum, GLint *);
+       BEFORE(glGetFramebufferAttachmentParameteriv);
+       CALL_ORIG(glGetFramebufferAttachmentParameteriv, target, attachment,
+                 pname, params);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxx",
+             (uint64_t)(target), (uint64_t)(attachment), (uint64_t)(pname));
+}
+
+//lsh_get
+void REAL_NAME(glGetProgramInfoLog)(GLuint program, GLsizei maxLength, GLsizei *length,
+                        char *infoLog)
+{
+       typedef void (*methodType)(GLuint, GLsizei, GLsizei *, char *);
+       BEFORE(glGetProgramInfoLog);
+       CALL_ORIG(glGetProgramInfoLog, program, maxLength, length, infoLog);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dd",
+             program, maxLength);
+}
+
+//lsh_get
+void REAL_NAME(glGetProgramiv)(GLuint program, GLenum pname, GLint *params)
+{
+       typedef void (*methodType)(GLuint, GLenum, GLint *);
+       BEFORE(glGetProgramiv);
+       CALL_ORIG(glGetProgramiv, program, pname, params);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dx",
+             program, (uint64_t)(pname));
+}
+
+//lsh_get
+void REAL_NAME(glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint *params)
+{
+       typedef void (*methodType)(GLenum, GLenum, GLint *);
+       BEFORE(glGetRenderbufferParameteriv);
+       CALL_ORIG(glGetRenderbufferParameteriv, target, pname, params);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xx",
+             (uint64_t)(target), (uint64_t)(pname));
+}
+
+//lsh_get
+void REAL_NAME(glGetShaderInfoLog)(GLuint shader, GLsizei maxLength, GLsizei *length,
+                       char *infoLog)
+{
+       typedef void (*methodType)(GLuint, GLsizei, GLsizei *, char *);
+       BEFORE(glGetShaderInfoLog);
+       CALL_ORIG(glGetShaderInfoLog, shader, maxLength, length, infoLog);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dd",
+             shader, maxLength);
+}
+
+//lsh_get
+void REAL_NAME(glGetShaderPrecisionFormat)(GLenum shaderType, GLenum precisionType,
+                               GLint *range, GLint *precision)
+{
+       typedef void (*methodType)(GLenum, GLenum, GLint *, GLint *);
+       BEFORE(glGetShaderPrecisionFormat);
+       CALL_ORIG(glGetShaderPrecisionFormat, shaderType, precisionType, range,
+                 precision);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xx",
+             (uint64_t)(shaderType), (uint64_t)(precisionType));
+}
+
+//lsh_get
+void REAL_NAME(glGetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei *length,
+                      char *source)
+{
+       typedef void (*methodType)(GLuint, GLsizei, GLsizei *, char *);
+       BEFORE(glGetShaderSource);
+       CALL_ORIG(glGetShaderSource, shader, bufSize, length, source);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dd",
+             shader, bufSize);
+}
+
+//lsh_get
+void REAL_NAME(glGetShaderiv)(GLuint shader, GLenum pname, GLint *params)
+{
+       typedef void (*methodType)(GLuint, GLenum, GLint *);
+       BEFORE(glGetShaderiv);
+       CALL_ORIG(glGetShaderiv, shader, pname, params);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dx",
+             shader, (uint64_t)(pname));
+}
+
+const GLubyte *REAL_NAME(glGetString)(GLenum name)
+{
+       typedef const GLubyte *(*methodType)(GLenum);
+       BEFORE(glGetString);
+       const GLubyte *ret = CALL_ORIG(glGetString, name);
+       GL_GET_ERROR();
+       AFTER('p', ret, APITYPE_CONTEXT, "", "x", (uint64_t)(name));
+
+       return ret;
+}
+
+//lsh_get
+void REAL_NAME(glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat * params)
+{
+       typedef void (*methodType)(GLenum, GLenum, GLfloat *);
+       BEFORE(glGetTexParameterfv);
+       CALL_ORIG(glGetTexParameterfv, target, pname, params);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xx",
+             (uint64_t)(target), (uint64_t)(pname));
+}
+
+//lsh_get
+void REAL_NAME(glGetTexParameteriv)(GLenum target, GLenum pname, GLint * params)
+{
+       typedef void (*methodType)(GLenum, GLenum, GLint *);
+       BEFORE(glGetTexParameteriv);
+       CALL_ORIG(glGetTexParameteriv, target, pname, params);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xx",
+             (uint64_t)(target), (uint64_t)(pname));
+}
+
+//lsh_get
+void REAL_NAME(glGetUniformfv)(GLuint program, GLint location, GLfloat *params)
+{
+       typedef void (*methodType)(GLuint, GLuint, GLfloat *);
+       BEFORE(glGetUniformfv);
+       CALL_ORIG(glGetUniformfv, program, location, params);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dd",
+             program, location);
+}
+
+//lsh_get
+void REAL_NAME(glGetUniformiv)(GLuint program, GLint location, GLint *params)
+{
+       typedef void (*methodType)(GLuint, GLuint, GLint *);
+       BEFORE(glGetUniformiv);
+       CALL_ORIG(glGetUniformiv, program, location, params);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dd",
+             program, location);
+}
+
+//lsh_get
+GLint REAL_NAME(glGetUniformLocation)(GLuint program, const char *name)
+{
+       typedef GLint (*methodType)(GLuint, const char *);
+       BEFORE(glGetUniformLocation);
+       GLint ret = CALL_ORIG(glGetUniformLocation, program, name);
+       GL_GET_ERROR();
+       AFTER('d', ret, APITYPE_CONTEXT, "", "d", program);
+
+       return ret;
+}
+
+//lsh_get
+void REAL_NAME(glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat *params)
+{
+       typedef void (*methodType)(GLuint, GLenum, GLfloat *);
+       BEFORE(glGetVertexAttribfv);
+       CALL_ORIG(glGetVertexAttribfv, index, pname, params);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dx",
+             index, (uint64_t)(pname));
+}
+
+//lsh_get
+void REAL_NAME(glGetVertexAttribiv)(GLuint index, GLenum pname, GLint *params)
+{
+       typedef void (*methodType)(GLuint, GLenum, GLint *);
+       BEFORE(glGetVertexAttribiv);
+       CALL_ORIG(glGetVertexAttribiv, index, pname, params);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dx",
+             index, (uint64_t)(pname));
+}
+
+//lsh_get
+void REAL_NAME(glGetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid **pointer)
+{
+       typedef void (*methodType)(GLuint, GLenum, GLvoid **);
+       BEFORE(glGetVertexAttribPointerv);
+       CALL_ORIG(glGetVertexAttribPointerv, index, pname, pointer);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dx",
+             index, (uint64_t)(pname));
+}
+
+// ==================================================================
+// H 1
+// ==================================================================
+
+void REAL_NAME(glHint)(GLenum target, GLenum mode)
+{
+       typedef void (*methodType)(GLenum, GLenum);
+       BEFORE(glHint);
+       CALL_ORIG(glHint, target, mode);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xx",
+             (uint64_t)(target), (uint64_t)(mode));
+}
+
+// ==================================================================
+// I 7
+// ==================================================================
+
+GLboolean REAL_NAME(glIsBuffer)(GLuint buffer)
+{
+       typedef GLboolean (*methodType)(GLuint);
+       BEFORE(glIsBuffer);
+       GLboolean ret = CALL_ORIG(glIsBuffer, buffer);
+       GL_GET_ERROR();
+       AFTER('c', ret, APITYPE_CONTEXT, "", "d", buffer);
+
+       return ret;
+}
+
+GLboolean REAL_NAME(glIsEnabled)(GLenum cap)
+{
+       typedef GLboolean (*methodType)(GLenum);
+       BEFORE(glIsEnabled);
+       GLboolean ret = CALL_ORIG(glIsEnabled, cap);
+       GL_GET_ERROR();
+       AFTER('c', ret, APITYPE_CONTEXT, "", "x", (uint64_t)(cap));
+
+       return ret;
+}
+
+GLboolean REAL_NAME(glIsFramebuffer)(GLuint framebuffer)
+{
+       typedef GLboolean (*methodType)(GLuint);
+       BEFORE(glIsFramebuffer);
+       GLboolean ret = CALL_ORIG(glIsFramebuffer, framebuffer);
+       GL_GET_ERROR();
+       AFTER('c', ret, APITYPE_CONTEXT, "", "d", framebuffer);
+
+       return ret;
+}
+
+GLboolean REAL_NAME(glIsProgram)(GLuint program)
+{
+       typedef GLboolean (*methodType)(GLuint);
+       BEFORE(glIsProgram);
+       GLboolean ret = CALL_ORIG(glIsProgram, program);
+       GL_GET_ERROR();
+       AFTER('c', ret, APITYPE_CONTEXT, "", "d", program);
+
+       return ret;
+}
+
+GLboolean REAL_NAME(glIsRenderbuffer)(GLuint renderbuffer)
+{
+       typedef GLboolean (*methodType)(GLuint);
+       BEFORE(glIsRenderbuffer);
+       GLboolean ret = CALL_ORIG(glIsRenderbuffer, renderbuffer);
+       GL_GET_ERROR();
+       AFTER('c', ret, APITYPE_CONTEXT, "", "d", renderbuffer);
+
+       return ret;
+}
+
+GLboolean REAL_NAME(glIsShader)(GLuint shader)
+{
+       typedef GLboolean (*methodType)(GLuint);
+       BEFORE(glIsShader);
+       GLboolean ret = CALL_ORIG(glIsShader, shader);
+       GL_GET_ERROR();
+       AFTER('c', ret, APITYPE_CONTEXT, "", "d", shader);
+
+       return ret;
+}
+
+GLboolean REAL_NAME(glIsTexture)(GLuint texture)
+{
+       typedef GLboolean (*methodType)(GLuint);
+       BEFORE(glIsTexture);
+       GLboolean ret = CALL_ORIG(glIsTexture, texture);
+       GL_GET_ERROR();
+       AFTER('c', ret, APITYPE_CONTEXT, "", "d", texture);
+
+       return ret;
+}
+
+// ==================================================================
+// L 2
+// ==================================================================
+
+void REAL_NAME(glLineWidth)(GLfloat width)
+{
+       typedef void (*methodType)(GLfloat);
+       BEFORE(glLineWidth);
+       CALL_ORIG(glLineWidth, width);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "f", width);
+}
+
+void REAL_NAME(glLinkProgram)(GLuint program)
+{
+       typedef void (*methodType)(GLuint);
+       BEFORE(glLinkProgram);
+       CALL_ORIG(glLinkProgram, program);
+       GL_GET_ERROR();
+       char buf[512] = "";
+       if (error == GL_NO_ERROR) {
+               char *to = buf;
+               int i;
+               GLint activeNum[1];
+               GLint maxLength[1];
+               GLsizei length[1];
+               GLint size[1];
+               GLenum type[1];
+
+               real_glGetProgramiv(program, GL_ACTIVE_ATTRIBUTES, activeNum);
+               real_glGetProgramiv(program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH,
+                                   maxLength);
+
+               char name1[maxLength[0]];
+               to += sprintf(to, "%d", activeNum[0]);
+               for (i = 0; i < activeNum[0]; i++) {
+                       real_glGetActiveAttrib(program, i, maxLength[0], length,
+                                              size, type, name1);
+                       to += sprintf(to, ",%d,%s,%d,%x", i, name1, size[0],
+                                     type[0]);
+               }
+
+               real_glGetProgramiv(program, GL_ACTIVE_UNIFORMS, activeNum);
+               real_glGetProgramiv(program, GL_ACTIVE_UNIFORM_MAX_LENGTH,
+                                   maxLength);
+
+               char name2[maxLength[0]];
+               to += sprintf(to, ",%d", activeNum[0]);
+               for (i = 0; i < activeNum[0]; i++) {
+                       real_glGetActiveUniform(program, i, maxLength[0],
+                                               length, size, type, name2);
+                       to += sprintf(to, ",%d,%s,%d,%x", i, name2, size[0],
+                                     type[0]);
+               }
+       }
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, buf, "d",
+             program);
+}
+
+// ==================================================================
+// P 2
+// ==================================================================
+
+void REAL_NAME(glPixelStorei)(GLenum pname, GLint param)
+{
+       typedef void (*methodType)(GLenum, GLint);
+       BEFORE(glPixelStorei);
+       CALL_ORIG(glPixelStorei, pname, param);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xd",
+             (uint64_t)(pname), param);
+}
+
+void REAL_NAME(glPolygonOffset)(GLfloat factor, GLfloat units)
+{
+       typedef void (*methodType)(GLfloat, GLfloat);
+       BEFORE(glPolygonOffset);
+       CALL_ORIG(glPolygonOffset, factor, units);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ff",
+             factor, units);
+}
+
+// ==================================================================
+// R 3
+// ==================================================================
+
+//lsh_get
+void REAL_NAME(glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height,
+                 GLenum format, GLenum type, GLvoid * data)
+{
+       typedef void (*methodType)(GLint, GLint, GLsizei, GLsizei, GLenum,
+                                  GLenum, GLvoid *);
+       BEFORE(glReadPixels);
+       CALL_ORIG(glReadPixels, x, y, width, height, format, type, data);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "",
+             "ddddxx", x, y, width, height,
+             (uint64_t)(format), (uint64_t)(type));
+}
+
+void REAL_NAME(glReleaseShaderCompiler)(void)
+{
+       typedef void (*methodType)(void);
+       BEFORE(glReleaseShaderCompiler);
+       CALL_ORIG(glReleaseShaderCompiler,);
+       GL_GET_ERROR();
+       AFTER_NO_PARAM('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "");
+}
+
+void REAL_NAME(glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width,
+                          GLsizei height)
+{
+       typedef void (*methodType)(GLenum, GLenum, GLsizei, GLsizei);
+       BEFORE(glRenderbufferStorage);
+       CALL_ORIG(glRenderbufferStorage, target, internalformat, width, height);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxdd",
+             (uint64_t)(target), (uint64_t)(internalformat), width, height);
+}
+
+// ==================================================================
+// S 10
+// ==================================================================
+
+void REAL_NAME(glSampleCoverage)(GLclampf value, GLboolean invert)
+{
+       typedef void (*methodType)(GLclampf, GLboolean);
+       BEFORE(glSampleCoverage);
+       CALL_ORIG(glSampleCoverage, value, invert);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "fx",
+             value, (uint64_t)(invert));
+}
+
+void REAL_NAME(glScissor)(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+       typedef void (*methodType)(GLint, GLint, GLsizei, GLsizei);
+       BEFORE(glScissor);
+       CALL_ORIG(glScissor, x, y, width, height);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dddd",
+             x, y, width, height);
+}
+
+//lsh_param
+void REAL_NAME(glShaderBinary)(GLsizei n, const GLuint *shaders, GLenum binaryformat,
+                   const void *binary, GLsizei length)
+{
+       typedef void (*methodType)(GLsizei, const GLuint *, GLenum,
+                                  const void *, GLsizei);
+       BEFORE(glShaderBinary);
+       CALL_ORIG(glShaderBinary, n, shaders, binaryformat, binary, length);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "",
+             "dpxpd", n, voidp_to_uint64(shaders),
+             (uint64_t)(binaryformat), voidp_to_uint64(binary), length);
+}
+
+//lsh_param
+void REAL_NAME(glShaderSource)(GLuint shader, GLsizei count, const char **string,
+                   const GLint *length)
+{
+       typedef void (*methodType)(GLuint, GLsizei, const char **,
+                                  const GLint*);
+       BEFORE(glShaderSource);
+       CALL_ORIG(glShaderSource, shader, count, string, length);
+       GL_GET_ERROR();
+       if (error == GL_NO_ERROR) {
+               GLint length[1];
+               real_glGetShaderiv(shader, GL_SHADER_SOURCE_LENGTH, length);
+               char buf[length[0]];
+               real_glGetShaderSource(shader, length[0], NULL, buf);
+               AFTER_SHADER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, buf,
+                            length[0], "ddpp", shader, count,
+                            voidp_to_uint64(string), voidp_to_uint64(length));
+       } else {
+               AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "",
+                     "ddpp", shader, count,
+                     voidp_to_uint64(string), voidp_to_uint64(length));
+       }
+}
+
+void REAL_NAME(glStencilFunc)(GLenum func, GLint ref, GLuint mask)
+{
+       typedef void (*methodType)(GLenum, GLint, GLint);
+       BEFORE(glStencilFunc);
+       CALL_ORIG(glStencilFunc, func, ref, mask);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xdd",
+             (uint64_t)(func), ref, mask);
+}
+
+void REAL_NAME(glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask)
+{
+       typedef void (*methodType)(GLenum, GLenum, GLint, GLuint);
+       BEFORE(glStencilFuncSeparate);
+       CALL_ORIG(glStencilFuncSeparate, face, func, ref, mask);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxdd",
+             (uint64_t)(face), (uint64_t)(func), ref, mask);
+}
+
+void REAL_NAME(glStencilMask)(GLuint mask)
+{
+       typedef void (*methodType)(GLuint);
+       BEFORE(glStencilMask);
+       CALL_ORIG(glStencilMask, mask);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "d", mask);
+}
+
+void REAL_NAME(glStencilMaskSeparate)(GLenum face, GLuint mask)
+{
+       typedef void (*methodType)(GLenum, GLuint);
+       BEFORE(glStencilMaskSeparate);
+       CALL_ORIG(glStencilMaskSeparate, face, mask);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xd",
+             (uint64_t)(face), mask);
+}
+
+void REAL_NAME(glStencilOp)(GLenum sfail, GLenum dpfail, GLenum dppass)
+{
+       typedef void (*methodType)(GLenum, GLenum, GLenum);
+       BEFORE(glStencilOp);
+       CALL_ORIG(glStencilOp, sfail, dpfail, dppass);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxx",
+             (uint64_t)(sfail), (uint64_t)(dpfail),
+             (uint64_t)(dppass));
+}
+
+void REAL_NAME(glStencilOpSeparate)(GLenum face, GLenum sfail, GLenum dpfail,
+                        GLenum dppass)
+{
+       typedef void (*methodType)(GLenum, GLenum, GLenum, GLenum);
+       BEFORE(glStencilOpSeparate);
+       CALL_ORIG(glStencilOpSeparate, face, sfail, dpfail, dppass);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxxx",
+             (uint64_t)(face), (uint64_t)(sfail), (uint64_t)(dpfail),
+             (uint64_t)(dppass));
+}
+
+// ==================================================================
+// T 6
+// ==================================================================
+
+void REAL_NAME(glTexImage2D)(GLenum target, GLint level, GLenum internalformat,
+                 GLsizei width, GLsizei height, GLint border, GLenum format,
+                 GLenum type, const GLvoid *data)
+{
+       typedef void (*methodType)(GLenum, GLint, GLint, GLsizei, GLsizei,
+                                  GLint, GLenum, GLenum, const GLvoid *);
+       BEFORE(glTexImage2D);
+       CALL_ORIG(glTexImage2D, target, level, internalformat, width,
+                 height, border, format, type, data);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xdddddxxp",
+             (uint64_t)(target), level, internalformat, width, height,
+             border, (uint64_t)(format), (uint64_t)(type),
+             voidp_to_uint64(data));
+}
+
+void REAL_NAME(glTexParameterf)(GLenum target, GLenum pname, GLfloat param)
+{
+       typedef void (*methodType)(GLenum, GLenum, GLfloat);
+       BEFORE(glTexParameterf);
+       CALL_ORIG(glTexParameterf, target, pname, param);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxf",
+             (uint64_t)(target), (uint64_t)(pname), param);
+}
+
+void REAL_NAME(glTexParameterfv)(GLenum target, GLenum pname, const GLfloat * params)
+{
+       typedef void (*methodType)(GLenum, GLenum, const GLfloat *);
+       BEFORE(glTexParameterfv);
+       CALL_ORIG(glTexParameterfv, target, pname, params);
+       GL_GET_ERROR();
+       if (error == GL_NO_ERROR) {
+               char param0[8];
+               sprintf(param0, "%x", (GLenum)params[0]);
+               AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, param0, "xxp",
+                     (uint64_t)(target), (uint64_t)(pname),
+                     voidp_to_uint64(params));
+       } else {
+               AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxp",
+                     (uint64_t)(target), (uint64_t)(pname),
+                     voidp_to_uint64(params));
+       }
+}
+
+void REAL_NAME(glTexParameteri)(GLenum target, GLenum pname, GLint param)
+{
+       typedef void (*methodType)(GLenum, GLenum, GLint);
+       BEFORE(glTexParameteri);
+       CALL_ORIG(glTexParameteri, target, pname, param);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxx",
+             (uint64_t)(target), (uint64_t)(pname),
+             (uint64_t)(param));
+}
+
+void REAL_NAME(glTexParameteriv)(GLenum target, GLenum pname, const GLint * params)
+{
+       typedef void (*methodType)(GLenum, GLenum, const GLint *);
+       BEFORE(glTexParameteriv);
+       CALL_ORIG(glTexParameteriv, target, pname, params);
+       GL_GET_ERROR();
+       if (error == GL_NO_ERROR) {
+               char param0[8];
+               sprintf(param0, "%x", (GLenum)params[0]);
+               AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, param0, "xxp",
+                     (uint64_t)(target), (uint64_t)(pname),
+                     voidp_to_uint64(params));
+       } else {
+               AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxp",
+                     (uint64_t)(target),
+                     (uint64_t)(pname),
+                     voidp_to_uint64(params));
+       }
+}
+
+void REAL_NAME(glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset,
+                    GLsizei width, GLsizei height, GLenum format, GLenum type,
+                    const GLvoid * data)
+{
+       typedef void (*methodType)(GLenum, GLint, GLint, GLint, GLsizei,
+                                  GLsizei, GLenum, GLenum, const GLvoid *);
+       BEFORE(glTexSubImage2D);
+       CALL_ORIG(glTexSubImage2D, target, level, xoffset, yoffset, width,
+                 height, format, type, data);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "",
+             "xdddddxxp",
+             (uint64_t)(target), level, xoffset, yoffset, width, height,
+             (uint64_t)(format), (uint64_t)(type), voidp_to_uint64(data));
+}
+
+// ==================================================================
+// U 20
+// ==================================================================
+
+void REAL_NAME(glUniform1f)(GLint location, GLfloat v0)
+{
+       typedef void (*methodType)(GLint, GLfloat);
+       BEFORE(glUniform1f);
+       CALL_ORIG(glUniform1f, location, v0);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "df",
+             location, v0);
+}
+
+void REAL_NAME(glUniform2f)(GLint location, GLfloat v0, GLfloat v1)
+{
+       typedef void (*methodType)(GLint, GLfloat, GLfloat);
+       BEFORE(glUniform2f);
+       CALL_ORIG(glUniform2f, location, v0, v1);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dff",
+             location, v0, v1);
+}
+
+void REAL_NAME(glUniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+{
+       typedef void (*methodType)(GLint, GLfloat, GLfloat, GLfloat);
+       BEFORE(glUniform3f);
+       CALL_ORIG(glUniform3f, location, v0, v1, v2);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dfff",
+             location, v0, v1, v2);
+}
+
+void REAL_NAME(glUniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+{
+       typedef void (*methodType)(GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+       BEFORE(glUniform4f);
+       CALL_ORIG(glUniform4f, location, v0, v1, v2, v3);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dffff",
+             location, v0, v1, v2, v3);
+}
+
+void REAL_NAME(glUniform1fv)(GLint location, GLsizei count, const GLfloat *value)
+{
+       typedef void (*methodType)(GLint, GLsizei, const GLfloat *);
+       BEFORE(glUniform1fv);
+       CALL_ORIG(glUniform1fv, location, count, value);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddF",
+             location, count, count * 1, voidp_to_uint64(value));
+}
+
+void REAL_NAME(glUniform2fv)(GLint location, GLsizei count, const GLfloat *value)
+{
+       typedef void (*methodType)(GLint, GLsizei, const GLfloat *);
+       BEFORE(glUniform2fv);
+       CALL_ORIG(glUniform2fv, location, count, value);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddF",
+             location, count, count * 2, voidp_to_uint64(value));
+}
+
+void REAL_NAME(glUniform3fv)(GLint location, GLsizei count, const GLfloat *value)
+{
+       typedef void (*methodType)(GLint, GLsizei, const GLfloat *);
+       BEFORE(glUniform3fv);
+       CALL_ORIG(glUniform3fv, location, count, value);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddF",
+             location, count, count * 3, voidp_to_uint64(value));
+}
+
+void REAL_NAME(glUniform4fv)(GLint location, GLsizei count, const GLfloat *value)
+{
+       typedef void (*methodType)(GLint, GLsizei, const GLfloat *);
+       BEFORE(glUniform4fv);
+       CALL_ORIG(glUniform4fv, location, count, value);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddF",
+             location, count, count * 4, voidp_to_uint64(value));
+}
+
+void REAL_NAME(glUniform1i)(GLint location, GLint v0)
+{
+       typedef void (*methodType)(GLint, GLint);
+       BEFORE(glUniform1i);
+       CALL_ORIG(glUniform1i, location, v0);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dd",
+             location, v0);
+}
+
+void REAL_NAME(glUniform2i)(GLint location, GLint v0, GLint v1)
+{
+       typedef void (*methodType)(GLint, GLint, GLint);
+       BEFORE(glUniform2i);
+       CALL_ORIG(glUniform2i, location, v0, v1);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddd",
+             location, v0, v1);
+}
+
+void REAL_NAME(glUniform3i)(GLint location, GLint v0, GLint v1, GLint v2)
+{
+       typedef void (*methodType)(GLint, GLint, GLint, GLint);
+       BEFORE(glUniform3i);
+       CALL_ORIG(glUniform3i, location, v0, v1, v2);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dddd",
+             location, v0, v1, v2);
+}
+
+void REAL_NAME(glUniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+       typedef void (*methodType)(GLint, GLint, GLint, GLint, GLint);
+       BEFORE(glUniform4i);
+       CALL_ORIG(glUniform4i, location, v0, v1, v2, v3);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddddd",
+             location, v0, v1, v2, v3);
+}
+
+void REAL_NAME(glUniform1iv)(GLint location, GLsizei count, const GLint *value)
+{
+       typedef void (*methodType)(GLint, GLsizei, const GLint *);
+       BEFORE(glUniform1iv);
+       CALL_ORIG(glUniform1iv, location, count, value);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddD",
+             location, count, count * 1, voidp_to_uint64(value));
+}
+
+void REAL_NAME(glUniform2iv)(GLint location, GLsizei count, const GLint *value)
+{
+       typedef void (*methodType)(GLint, GLsizei, const GLint *);
+       BEFORE(glUniform2iv);
+       CALL_ORIG(glUniform2iv, location, count, value);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddD",
+             location, count, count * 2, voidp_to_uint64(value));
+}
+
+void REAL_NAME(glUniform3iv)(GLint location, GLsizei count, const GLint *value)
+{
+       typedef void (*methodType)(GLint, GLsizei, const GLint *);
+       BEFORE(glUniform3iv);
+       CALL_ORIG(glUniform3iv, location, count, value);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddD",
+             location, count, count * 3, voidp_to_uint64(value));
+}
+
+void REAL_NAME(glUniform4iv)(GLint location, GLsizei count, const GLint *value)
+{
+       typedef void (*methodType)(GLint, GLsizei, const GLint *);
+       BEFORE(glUniform4iv);
+       CALL_ORIG(glUniform4iv, location, count, value);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddD",
+             location, count, count * 4, voidp_to_uint64(value));
+}
+
+void REAL_NAME(glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose,
+                       const GLfloat *value)
+{
+       typedef void (*methodType)(GLint, GLsizei, GLboolean, const GLfloat *);
+       BEFORE(glUniformMatrix2fv);
+       CALL_ORIG(glUniformMatrix2fv, location, count, transpose, value);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddxF",
+             location, count, (uint64_t)(transpose), count * 2 * 2,
+             voidp_to_uint64(value));
+}
+
+void REAL_NAME(glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose,
+                       const GLfloat *value)
+{
+       typedef void (*methodType)(GLint, GLsizei, GLboolean, const GLfloat *);
+       BEFORE(glUniformMatrix3fv);
+       CALL_ORIG(glUniformMatrix3fv, location, count, transpose, value);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddxF",
+             location, count, (uint64_t)(transpose), count * 3 * 3,
+             voidp_to_uint64(value));
+}
+
+void REAL_NAME(glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose,
+                       const GLfloat *value)
+{
+       typedef void (*methodType)(GLint, GLsizei, GLboolean, const GLfloat *);
+       BEFORE(glUniformMatrix4fv);
+       CALL_ORIG(glUniformMatrix4fv, location, count, transpose, value);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddxF",
+             location, count, (uint64_t)(transpose), count * 4 * 4,
+             voidp_to_uint64(value));
+}
+
+void REAL_NAME(glUseProgram)(GLuint program)
+{
+       typedef void (*methodType)(GLuint);
+       BEFORE(glUseProgram);
+       CALL_ORIG(glUseProgram, program);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "d",
+             program);
+}
+
+// ==================================================================
+// V 7
+// ==================================================================
+
+void REAL_NAME(glValidateProgram)(GLuint program)
+{
+       typedef void (*methodType)(GLuint);
+       BEFORE(glValidateProgram);
+       CALL_ORIG(glValidateProgram, program);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "d",
+             program);
+}
+
+void REAL_NAME(glVertexAttrib1f)(GLuint index, GLfloat v0)
+{
+       typedef void (*methodType)(GLuint, GLfloat);
+       BEFORE(glVertexAttrib1f);
+       CALL_ORIG(glVertexAttrib1f, index, v0);
+
+       GLfloat cv[4];
+       real_glGetVertexAttribfv(index, GL_CURRENT_VERTEX_ATTRIB, cv);
+       sprintf(contextValue, "%f,%f,%f,%f", cv[0], cv[1], cv[2], cv[3]);
+
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, contextValue, "df",
+             index, v0);
+}
+
+void REAL_NAME(glVertexAttrib2f)(GLuint index, GLfloat v0, GLfloat v1)
+{
+       typedef void (*methodType)(GLuint, GLfloat, GLfloat);
+       BEFORE(glVertexAttrib2f);
+       CALL_ORIG(glVertexAttrib2f, index, v0, v1);
+
+       GLfloat cv[4];
+       real_glGetVertexAttribfv(index, GL_CURRENT_VERTEX_ATTRIB, cv);
+       sprintf(contextValue, "%f,%f,%f,%f", cv[0], cv[1], cv[2], cv[3]);
+
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, contextValue, "dff",
+             index, v0, v1);
+}
+
+void REAL_NAME(glVertexAttrib3f)(GLuint index, GLfloat v0, GLfloat v1, GLfloat v2)
+{
+       typedef void (*methodType)(GLuint, GLfloat, GLfloat, GLfloat);
+       BEFORE(glVertexAttrib3f);
+       CALL_ORIG(glVertexAttrib3f, index, v0, v1, v2);
+
+       GLfloat cv[4];
+       real_glGetVertexAttribfv(index, GL_CURRENT_VERTEX_ATTRIB, cv);
+       sprintf(contextValue, "%f,%f,%f,%f", cv[0], cv[1], cv[2], cv[3]);
+
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, contextValue, "dfff",
+             index, v0, v1, v2);
+}
+
+void REAL_NAME(glVertexAttrib4f)(GLuint index, GLfloat v0, GLfloat v1, GLfloat v2,
+                     GLfloat v3)
+{
+       typedef void (*methodType)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+       BEFORE(glVertexAttrib4f);
+       CALL_ORIG(glVertexAttrib4f, index, v0, v1, v2, v3);
+
+       GLfloat cv[4];
+       real_glGetVertexAttribfv(index, GL_CURRENT_VERTEX_ATTRIB, cv);
+       sprintf(contextValue, "%f,%f,%f,%f", cv[0], cv[1], cv[2], cv[3]);
+
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, contextValue, "dffff",
+             index, v0, v1, v2, v3);
+}
+
+void REAL_NAME(glVertexAttrib1fv)(GLuint index, const GLfloat *v)
+{
+       typedef void (*methodType)(GLuint, const GLfloat *);
+       BEFORE(glVertexAttrib1fv);
+       CALL_ORIG(glVertexAttrib1fv, index, v);
+
+       GLfloat cv[4];
+       real_glGetVertexAttribfv(index, GL_CURRENT_VERTEX_ATTRIB, cv);
+       sprintf(contextValue, "%f,%f,%f,%f", cv[0], cv[1], cv[2], cv[3]);
+
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, contextValue,
+             "dp", index, voidp_to_uint64(v));
+}
+
+void REAL_NAME(glVertexAttrib2fv)(GLuint index, const GLfloat *v)
+{
+       typedef void (*methodType)(GLuint, const GLfloat *);
+       BEFORE(glVertexAttrib2fv);
+       CALL_ORIG(glVertexAttrib2fv, index, v);
+
+       GLfloat cv[4];
+       real_glGetVertexAttribfv(index, GL_CURRENT_VERTEX_ATTRIB, cv);
+       sprintf(contextValue, "%f,%f,%f,%f", cv[0], cv[1], cv[2], cv[3]);
+
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, contextValue,
+             "dp", index, voidp_to_uint64(v));
+}
+
+void REAL_NAME(glVertexAttrib3fv)(GLuint index, const GLfloat *v)
+{
+       typedef void (*methodType)(GLuint, const GLfloat *);
+       BEFORE(glVertexAttrib3fv);
+       CALL_ORIG(glVertexAttrib3fv, index, v);
+
+       GLfloat cv[4];
+       real_glGetVertexAttribfv(index, GL_CURRENT_VERTEX_ATTRIB, cv);
+       sprintf(contextValue, "%f,%f,%f,%f", cv[0], cv[1], cv[2], cv[3]);
+
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, contextValue,
+             "dp", index, voidp_to_uint64(v));
+}
+
+void REAL_NAME(glVertexAttrib4fv)(GLuint index, const GLfloat *v)
+{
+       typedef void (*methodType)(GLuint, const GLfloat *);
+       BEFORE(glVertexAttrib4fv);
+       CALL_ORIG(glVertexAttrib4fv, index, v);
+       GLfloat cv[4];
+       real_glGetVertexAttribfv(index, GL_CURRENT_VERTEX_ATTRIB, cv);
+       sprintf(contextValue, "%f,%f,%f,%f", cv[0], cv[1], cv[2], cv[3]);
+
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, contextValue,
+             "dp", index, voidp_to_uint64(v));
+}
+
+void REAL_NAME(glVertexAttribPointer)(GLuint index, GLint size, GLenum type,
+                          GLboolean normalized, GLsizei stride,
+                          const GLvoid *pointer)
+{
+       typedef void (*methodType)(GLuint, GLint, GLenum, GLboolean, GLsizei,
+                                  const GLvoid *);
+       BEFORE(glVertexAttribPointer);
+       CALL_ORIG(glVertexAttribPointer, index, size, type, normalized, stride,
+                 pointer);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddxxdp",
+             index, size, (uint64_t)(type), (uint64_t)(normalized),
+             stride, voidp_to_uint64(pointer));
+}
+
+void REAL_NAME(glViewport)(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+       typedef void (*methodType)(GLint, GLint, GLsizei, GLsizei);
+
+       BEFORE(glViewport);
 
-} /* extern C */
+       CALL_ORIG(glViewport, x, y, width, height);
+       GL_GET_ERROR();
+       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dddd",
+             x, y, width, height);
+}
 
-#undef _GL2_MACRO_H_
-#undef _GL_MACRO_H_
+#undef CALL_ORIG
+#undef BEFORE
index 2b6f58e..c9dc784 100644 (file)
@@ -1,12 +1,10 @@
 /*
  *  DA probe
  *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact:
  *
- * Sanghyun Lee <sanghyunnim.lee@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
  * Vitaliy Cherepanov <v.cherepanov@samsung.com>
  *
  * This library is free software; you can redistribute it and/or modify it under
  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  *
  * Contributors:
- * - S-Core Co., Ltd
  * - Samsung RnD Institute Russia
  *
  */
 
-#include "da_gles20.h"
-#include "daprobe.h"
-#include "binproto.h"
-#include "common_probe_init.h"
-
-static char contextValue[MAX_GL_CONTEXT_VALUE_SIZE];
-static enum DaOptions _sopt = OPT_GLES;
-static __thread GLenum gl_error_external = GL_NO_ERROR;
-
-// ==================================================================
-// A 2
-// ==================================================================
-
-void glActiveTexture(GLenum texture) {
-       typedef void (*methodType)(GLenum);
-       BEFORE(glActiveTexture);
-       glActiveTexturep(texture);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x",
-             (uint64_t)(texture));
-}
-
-void glAttachShader(GLuint program, GLuint shader) {
-       typedef void (*methodType)(GLuint, GLuint);
-       BEFORE(glAttachShader);
-       glAttachShaderp(program, shader);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dd",
-                       program, shader);
-}
-
-// ==================================================================
-// B 12
-// ==================================================================
-
-void glBindAttribLocation(GLuint program, GLuint index, const char *name) {
-       typedef void (*methodType)(GLuint, GLuint, const char *);
-       BEFORE(glBindAttribLocation);
-       glBindAttribLocationp(program, index, name);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dds",
-                       program, index, name);
-}
-
-void glBindBuffer(GLenum target, GLuint buffer) {
-       typedef void (*methodType)(GLenum, GLuint);
-       BEFORE(glBindBuffer);
-       glBindBufferp(target, buffer);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xd",
-             (uint64_t)(target), buffer);
-}
-
-void glBindFramebuffer(GLenum target, GLuint framebuffer) {
-       typedef void (*methodType)(GLenum, GLuint);
-       BEFORE(glBindFramebuffer);
-       glBindFramebufferp(target, framebuffer);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xd",
-             (uint64_t)(target), framebuffer);
-}
-
-void glBindRenderbuffer(GLenum target, GLuint renderbuffer) {
-       typedef void (*methodType)(GLenum, GLuint);
-       BEFORE(glBindRenderbuffer);
-       glBindRenderbufferp(target, renderbuffer);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xd",
-             (uint64_t)(target), renderbuffer);
-}
-
-void glBindTexture(GLenum target, GLuint texture) {
-       typedef void (*methodType)(GLenum, GLuint);
-       BEFORE(glBindTexture);
-       glBindTexturep(target, texture);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xd",
-             (uint64_t)(target), texture);
-}
-
-void glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
-       typedef void (*methodType)(GLclampf, GLclampf, GLclampf, GLclampf);
-       BEFORE(glBlendColor);
-       glBlendColorp(red, green, blue, alpha);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ffff",
-                       red, green, blue, alpha);
-}
-
-void glBlendEquation(GLenum mode) {
-       typedef void (*methodType)(GLenum);
-       BEFORE(glBlendEquation);
-       glBlendEquationp(mode);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x",
-             (uint64_t)(mode));
-}
-
-void glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) {
-       typedef void (*methodType)(GLenum, GLenum);
-       BEFORE(glBlendEquationSeparate);
-       glBlendEquationSeparatep(modeRGB, modeAlpha);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xx",
-             (uint64_t)(modeRGB), (uint64_t)(modeAlpha));
-}
-
-void glBlendFunc(GLenum sfactor, GLenum dfactor) {
-       typedef void (*methodType)(GLenum, GLenum);
-       BEFORE(glBlendFunc);
-       glBlendFuncp(sfactor, dfactor);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xx",
-             (uint64_t)(sfactor), (uint64_t)(dfactor));
-}
-
-void glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha,
-               GLenum dstAlpha) {
-       typedef void (*methodType)(GLenum, GLenum, GLenum, GLenum);
-       BEFORE(glBlendFuncSeparate);
-       glBlendFuncSeparatep(srcRGB, dstRGB, srcAlpha, dstAlpha);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxxx",
-             (uint64_t)(srcRGB), (uint64_t)(dstRGB),
-             (uint64_t)(srcAlpha), (uint64_t)(dstAlpha));
-}
-
-void glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data,
-               GLenum usage) {
-       typedef void (*methodType)(GLenum, GLsizeiptr, const GLvoid *, GLenum);
-       BEFORE(glBufferData);
-       glBufferDatap(target, size, data, usage);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxpx",
-             (uint64_t)(target), (uint64_t)(size),
-             voidp_to_uint64(data), (uint64_t)(usage));
-}
-
-void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size,
-               const GLvoid * data) {
-       typedef void (*methodType)(GLenum, GLintptr, GLsizeiptr, const GLvoid *);
-       BEFORE(glBufferSubData);
-       glBufferSubDatap(target, offset, size, data);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxxp",
-             (uint64_t)(target), (uint64_t)(offset),
-             (uint64_t)(size), voidp_to_uint64(data));
-}
-
-// ==================================================================
-// C 14
-// ==================================================================
-
-GLenum glCheckFramebufferStatus(GLenum target) {
-       typedef GLenum (*methodType)(GLenum);
-       BEFORE(glCheckFramebufferStatus);
-       GLenum ret = glCheckFramebufferStatusp(target);
-       GL_GET_ERROR();
-       AFTER('d', ret, APITYPE_CONTEXT, "", "x",
-             (uint64_t)(target));
-
-       return ret;
-}
-
-void glClear(GLbitfield mask) {
-       typedef void (*methodType)(GLbitfield);
-       BEFORE(glClear);
-       glClearp(mask);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x",
-             (uint64_t)(mask));
-}
-
-void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
-       typedef void (*methodType)(GLclampf, GLclampf, GLclampf, GLclampf);
-       BEFORE(glClearColor);
-       glClearColorp(red, green, blue, alpha);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ffff",
-                       red, green, blue, alpha);
-}
-
-void glClearDepthf(GLclampf depth) {
-       typedef void (*methodType)(GLclampf);
-       BEFORE(glClearDepthf);
-       glClearDepthfp(depth);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "f", depth);
-}
-
-void glClearStencil(GLint s) {
-       typedef void (*methodType)(GLint);
-       BEFORE(glClearStencil);
-       glClearStencilp(s);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "d", s);
-}
-
-void glColorMask(GLboolean red, GLboolean green, GLboolean blue,
-               GLboolean alpha) {
-       typedef void (*methodType)(GLboolean, GLboolean, GLboolean, GLboolean);
-       BEFORE(glColorMask);
-       glColorMaskp(red, green, blue, alpha);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dddd",
-                       red, green, blue, alpha);
-}
-
-void glCompileShader(GLuint shader) {
-       typedef void (*methodType)(GLuint);
-       BEFORE(glCompileShader);
-       glCompileShaderp(shader);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x", (uint64_t)(shader));
-}
-
-void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
-               GLsizei width, GLsizei height, GLint border, GLsizei imageSize,
-               const GLvoid * data) {
-       typedef void (*methodType)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint,
-                       GLsizei, const GLvoid *);
-       BEFORE(glCompressedTexImage2D);
-       glCompressedTexImage2Dp(target, level, internalformat, width, height,
-                       border, imageSize, data);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xdxddddp",
-             (uint64_t)(target), level,
-             (uint64_t)(internalformat), width, height, border, imageSize,
-             voidp_to_uint64(data));
-}
-
-void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset,
-               GLint yoffset, GLsizei width, GLsizei height, GLenum format,
-               GLsizei imageSize, const GLvoid * data) {
-       typedef void (*methodType)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei,
-                       GLenum, GLsizei, const GLvoid *);
-       BEFORE(glCompressedTexSubImage2D);
-       glCompressedTexSubImage2Dp(target, level, xoffset, yoffset, width, height,
-                       format, imageSize, data);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xdddddxdp",
-             (uint64_t)(target), level, xoffset, yoffset, width, height,
-             (uint64_t)(format), imageSize, voidp_to_uint64(data));
-}
-
-void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat,
-               GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
-       typedef void (*methodType)(GLenum, GLint, GLenum, GLint, GLint, GLsizei,
-                       GLsizei, GLint);
-       BEFORE(glCopyTexImage2D);
-       glCopyTexImage2Dp(target, level, internalformat, x, y, width, height,
-                       border);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xdxddddd",
-             (uint64_t)(target), level,
-             (uint64_t)(internalformat), x, y, width, height, border);
-}
-
-void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset,
-               GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
-       typedef void (*methodType)(GLenum, GLint, GLint, GLint, GLint, GLint,
-                       GLsizei, GLsizei);
-       BEFORE(glCopyTexSubImage2D);
-       glCopyTexSubImage2Dp(target, level, xoffset, yoffset, x, y, width, height);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xddddddd",
-             (uint64_t)(target), level, xoffset, yoffset, x, y, width,
-             height);
-}
-
-GLuint glCreateProgram(void) {
-       typedef GLuint (*methodType)(void);
-       BEFORE(glCreateProgram);
-       GLuint ret = glCreateProgramp();
-       GL_GET_ERROR();
-       AFTER_NO_PARAM('d', ret, APITYPE_CONTEXT, "");
-
-       return ret;
-}
-
-GLuint glCreateShader(GLenum shaderType) {
-       typedef GLuint (*methodType)(GLenum);
-       BEFORE(glCreateShader);
-       GLuint ret = glCreateShaderp(shaderType);
-       GL_GET_ERROR();
-       AFTER('d', ret, APITYPE_CONTEXT, "", "x", (uint64_t)(shaderType));
-
-       return ret;
-}
-
-void glCullFace(GLenum mode) {
-       typedef void (*methodType)(GLenum);
-       BEFORE(glCullFace);
-       glCullFacep(mode);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x", (uint64_t)(mode));
-}
-
-// ==================================================================
-// D 14
-// ==================================================================
-
-void glDeleteBuffers(GLsizei n, const GLuint * buffers) {
-       typedef void (*methodType)(GLsizei, const GLuint *);
-       BEFORE(glDeleteBuffers);
-       glDeleteBuffersp(n, buffers);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dp",
-             n, voidp_to_uint64(buffers));
-}
-
-void glDeleteFramebuffers(GLsizei n, const GLuint * framebuffers) {
-       typedef void (*methodType)(GLsizei, const GLuint *);
-       BEFORE(glDeleteFramebuffers);
-       glDeleteFramebuffersp(n, framebuffers);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dp",
-             n, voidp_to_uint64(framebuffers));
-}
-
-void glDeleteProgram(GLuint program) {
-       typedef void (*methodType)(GLuint);
-       BEFORE(glDeleteProgram);
-       glDeleteProgramp(program);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "d",
-                       program);
-}
-
-void glDeleteRenderbuffers(GLsizei n, const GLuint * renderbuffers) {
-       typedef void (*methodType)(GLsizei, const GLuint *);
-       BEFORE(glDeleteRenderbuffers);
-       glDeleteRenderbuffersp(n, renderbuffers);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dp",
-             n, voidp_to_uint64(renderbuffers));
-}
-
-void glDeleteShader(GLuint shader) {
-       typedef void (*methodType)(GLuint);
-       BEFORE(glDeleteShader);
-       glDeleteShaderp(shader);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "d", shader);
-}
-
-void glDeleteTextures(GLsizei n, const GLuint * textures) {
-       typedef void (*methodType)(GLsizei, const GLuint *);
-       BEFORE(glDeleteTextures);
-       glDeleteTexturesp(n, textures);
-       GL_GET_ERROR();
-       if (error == GL_NO_ERROR) {
-               char buf[128] = "";
-               int bufP = 0;
-               for (int i = 0; i < n; i++) {
-                       bufP += sprintf(buf + bufP, "%u", textures[i]);
-                       if (i != n - 1) {
-                               bufP += sprintf(buf + bufP, ",");
-                       }
-               }
-               AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, buf, "dp",
-                     n, voidp_to_uint64(textures));
-       } else {
-               AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dp",
-                     n, voidp_to_uint64(textures));
-       }
-}
-
-void glDepthFunc(GLenum func) {
-       typedef void (*methodType)(GLenum);
-       BEFORE(glDepthFunc);
-       glDepthFuncp(func);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x", (uint64_t)(func));
-}
-
-void glDepthMask(GLboolean flag) {
-       typedef void (*methodType)(GLboolean);
-       BEFORE(glDepthMask);
-       glDepthMaskp(flag);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x", (uint64_t)(flag));
-}
-
-void glDepthRangef(GLclampf nearVal, GLclampf farVal) {
-       typedef void (*methodType)(GLclampf, GLclampf);
-       BEFORE(glDepthRangef);
-       glDepthRangefp(nearVal, farVal);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ff",
-                       nearVal, farVal);
-}
-
-void glDetachShader(GLuint program, GLuint shader) {
-       typedef void (*methodType)(GLuint, GLuint);
-       BEFORE(glDetachShader);
-       glDetachShaderp(program, shader);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dd",
-                       program, shader);
-}
-
-void glDisable(GLenum cap) {
-       typedef void (*methodType)(GLenum);
-       BEFORE(glDisable);
-       glDisablep(cap);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x", (uint64_t)(cap));
-}
-
-void glDisableVertexAttribArray(GLuint index) {
-       typedef void (*methodType)(GLuint);
-       BEFORE(glDisableVertexAttribArray);
-       glDisableVertexAttribArrayp(index);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "d", index);
-}
-
-void glDrawArrays(GLenum mode, GLint first, GLsizei count) {
-       typedef void (*methodType)(GLenum, GLint, GLsizei);
-       BEFORE(glDrawArrays);
-       glDrawArraysp(mode, first, count);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xdd",
-             (uint64_t)(mode), first, count);
-}
-
-void glDrawElements(GLenum mode, GLsizei count, GLenum type,
-               const GLvoid * indices) {
-       typedef void (*methodType)(GLenum, GLsizei, GLenum, const GLvoid *);
-       BEFORE(glDrawElements);
-       glDrawElementsp(mode, count, type, indices);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xdxp",
-             (uint64_t)(mode), count, (uint64_t)(type), indices);
-}
-
-// ==================================================================
-// E 2
-// ==================================================================
-
-void glEnable(GLenum cap) {
-       typedef void (*methodType)(GLenum);
-       BEFORE(glEnable);
-       glEnablep(cap);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x", (uint64_t)(cap));
-}
-
-void glEnableVertexAttribArray(GLuint index) {
-       typedef void (*methodType)(GLuint);
-       BEFORE(glEnableVertexAttribArray);
-       glEnableVertexAttribArrayp(index);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "d", index);
-}
-
-// ==================================================================
-// F 5
-// ==================================================================
-
-void glFinish(void) {
-       typedef void (*methodType)(void);
-       BEFORE(glFinish);
-       glFinishp();
-       GL_GET_ERROR();
-       AFTER_NO_PARAM('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "");
-}
-
-void glFlush(void) {
-       typedef void (*methodType)(void);
-       BEFORE(glFlush);
-       glFlushp();
-       GL_GET_ERROR();
-       AFTER_NO_PARAM('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "");
-}
-
-void glFramebufferRenderbuffer(GLenum target, GLenum attachment,
-               GLenum renderbuffertarget, GLuint renderbuffer) {
-       typedef void (*methodType)(GLenum, GLenum, GLenum, GLuint);
-       BEFORE(glFramebufferRenderbuffer);
-       glFramebufferRenderbufferp(target, attachment, renderbuffertarget,
-                       renderbuffer);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxxd",
-             (uint64_t)(target), (uint64_t)(attachment),
-             (uint64_t)(renderbuffertarget), renderbuffer);
-}
-
-void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget,
-               GLuint texture, GLint level) {
-       typedef void (*methodType)(GLenum, GLenum, GLenum, GLuint, GLint);
-       BEFORE(glFramebufferTexture2D);
-       glFramebufferTexture2Dp(target, attachment, textarget, texture, level);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxxdd",
-             (uint64_t)(target), (uint64_t)(attachment),
-             (uint64_t)(textarget), texture, level);
-}
-
-void glFrontFace(GLenum mode) {
-       typedef void (*methodType)(GLenum);
-       BEFORE(glFrontFace);
-       glFrontFacep(mode);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x",
-             (uint64_t)(mode));
-}
-
-// ==================================================================
-// G 31
-// ==================================================================
-
-void glGenBuffers(GLsizei n, GLuint * buffers) {
-       typedef void (*methodType)(GLsizei, GLuint *);
-       BEFORE(glGenBuffers);
-       glGenBuffersp(n, buffers);
-       GL_GET_ERROR();
-       if (error == GL_NO_ERROR) {
-               char buf[128] = "";
-               int bufP = 0;
-               for (int i = 0; i < n; i++) {
-                       bufP += sprintf(buf + bufP, "%u", buffers[i]);
-                       if (i != n - 1) {
-                               bufP += sprintf(buf + bufP, ",");
-                       }
-               }
-               AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, buf, "dp",
-                     n, voidp_to_uint64(buffers));
-       } else {
-               AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dp",
-                     n, voidp_to_uint64(buffers));
-       }
-}
-
-void glGenFramebuffers(GLsizei n, GLuint * framebuffers) {
-       typedef void (*methodType)(GLsizei, GLuint *);
-       BEFORE(glGenFramebuffers);
-       glGenFramebuffersp(n, framebuffers);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dp",
-             n, voidp_to_uint64(framebuffers));
-}
-
-void glGenRenderbuffers(GLsizei n, GLuint * renderbuffers) {
-       typedef void (*methodType)(GLsizei, GLuint *);
-       BEFORE(glGenRenderbuffers);
-       glGenRenderbuffersp(n, renderbuffers);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dp",
-             n, voidp_to_uint64(renderbuffers));
-}
-
-void glGenTextures(GLsizei n, GLuint * textures) {
-       typedef void (*methodType)(GLsizei, GLuint *);
-       BEFORE(glGenTextures);
-       glGenTexturesp(n, textures);
-       GL_GET_ERROR();
-       if (error == GL_NO_ERROR) {
-               char buf[128] = "";
-               int bufP = 0;
-               for (int i = 0; i < n; i++) {
-                       bufP += sprintf(buf + bufP, "%u", textures[i]);
-                       if (i != n - 1) {
-                               bufP += sprintf(buf + bufP, ",");
-                       }
-               }
-               AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, buf, "dp",
-                     n, voidp_to_uint64(textures));
-       } else {
-               AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dp",
-                     n, voidp_to_uint64(textures));
-       }
-}
-
-void glGenerateMipmap(GLenum target) {
-       typedef void (*methodType)(GLenum);
-       BEFORE(glGenerateMipmap);
-       glGenerateMipmapp(target);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x", (uint64_t)(target));
-}
-
-//lsh_get
-void glGetBooleanv(GLenum pname, GLboolean * params) {
-       typedef void (*methodType)(GLenum, GLboolean *);
-       BEFORE(glGetBooleanv);
-       glGetBooleanvp(pname, params);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x", (uint64_t)(pname));
-}
-
-//lsh_get
-void glGetFloatv(GLenum pname, GLfloat * params) {
-       typedef void (*methodType)(GLenum, GLfloat *);
-       BEFORE(glGetFloatv);
-       glGetFloatvp(pname, params);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x", (uint64_t)(pname));
-}
-
-//lsh_get
-void glGetIntegerv(GLenum pname, GLint * params) {
-       typedef void (*methodType)(GLenum, GLint *);
-       BEFORE(glGetIntegerv);
-       glGetIntegervp(pname, params);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "x", (uint64_t)(pname));
-}
-
-//lsh_get
-void glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufSize,
-               GLsizei *length, GLint *size, GLenum *type, char *name) {
-       typedef void (*methodType)(GLuint, GLuint, GLsizei, GLsizei *, GLint *,
-                       GLenum *, char *);
-       BEFORE(glGetActiveAttrib);
-       glGetActiveAttribp(program, index, bufSize, length, size, type, name);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddd",
-                       program, index, bufSize);
-}
-
-//lsh_get
-void glGetActiveUniform(GLuint program, GLuint index, GLsizei bufSize,
-               GLsizei *length, GLint *size, GLenum *type, char *name) {
-       typedef void (*methodType)(GLuint, GLuint, GLsizei, GLsizei *, GLint *,
-                       GLenum *, char *);
-       BEFORE(glGetActiveUniform);
-       glGetActiveUniformp(program, index, bufSize, length, size, type, name);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddd",
-                       program, index, bufSize);
-}
-
-//lsh_get
-void glGetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei *count,
-               GLuint *shaders) {
-       typedef void (*methodType)(GLuint, GLsizei, GLsizei *, GLuint *);
-       BEFORE(glGetAttachedShaders);
-       glGetAttachedShadersp(program, maxCount, count, shaders);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dd",
-                       program, maxCount);
-}
-
-//lsh_get
-int glGetAttribLocation(GLuint program, const char* name)
-{
-       typedef int (*methodType)(GLuint , const char*);
-       BEFORE(glGetAttribLocation);
-       int ret = glGetAttribLocationp(program, name);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xs",
-             (uint64_t)(program), name);
-       return ret;
-}
-
-//lsh_get
-void glGetBufferParameteriv(GLenum target, GLenum value, GLint * data) {
-       typedef void (*methodType)(GLenum, GLenum, GLint *);
-       BEFORE(glGetBufferParameteriv);
-       glGetBufferParameterivp(target, value, data);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xx",
-             (uint64_t)(target), (uint64_t)(value));
-}
-
-GLenum glGetError(void) {
-       typedef GLenum (*methodType)(void);
-       BEFORE(glGetError);
-       GLenum ret = glGetErrorp();
-
-       if (gl_error_external == GL_NO_ERROR)
-               gl_error_external = ret;
-
-       if (blockresult) {
-               //external call
-               ret = gl_error_external;
-               gl_error_external = GL_NO_ERROR;
-       }
-
-       AFTER_NO_PARAM('d', ret, APITYPE_CONTEXT, "");
-
-       return ret;
-}
-
-//lsh_get
-void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment,
-               GLenum pname, GLint * params) {
-       typedef void (*methodType)(GLenum, GLenum, GLenum, GLint *);
-       BEFORE(glGetFramebufferAttachmentParameteriv);
-       glGetFramebufferAttachmentParameterivp(target, attachment, pname, params);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxx",
-             (uint64_t)(target), (uint64_t)(attachment),
-             (uint64_t)(pname));
-}
-
-//lsh_get
-void glGetProgramInfoLog(GLuint program, GLsizei maxLength, GLsizei *length,
-               char *infoLog) {
-       typedef void (*methodType)(GLuint, GLsizei, GLsizei *, char *);
-       BEFORE(glGetProgramInfoLog);
-       glGetProgramInfoLogp(program, maxLength, length, infoLog);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dd",
-                       program, maxLength);
-}
-
-//lsh_get
-void glGetProgramiv(GLuint program, GLenum pname, GLint *params) {
-       typedef void (*methodType)(GLuint, GLenum, GLint *);
-       BEFORE(glGetProgramiv);
-       glGetProgramivp(program, pname, params);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dx",
-             program, (uint64_t)(pname));
-}
-
-//lsh_get
-void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint *params) {
-       typedef void (*methodType)(GLenum, GLenum, GLint *);
-       BEFORE(glGetRenderbufferParameteriv);
-       glGetRenderbufferParameterivp(target, pname, params);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xx",
-             (uint64_t)(target), (uint64_t)(pname));
-}
-
-//lsh_get
-void glGetShaderInfoLog(GLuint shader, GLsizei maxLength, GLsizei *length,
-               char *infoLog) {
-       typedef void (*methodType)(GLuint, GLsizei, GLsizei *, char *);
-       BEFORE(glGetShaderInfoLog);
-       glGetShaderInfoLogp(shader, maxLength, length, infoLog);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dd",
-                       shader, maxLength);
-}
-
-//lsh_get
-void glGetShaderPrecisionFormat(GLenum shaderType, GLenum precisionType,
-               GLint *range, GLint *precision) {
-       typedef void (*methodType)(GLenum, GLenum, GLint *, GLint *);
-       BEFORE(glGetShaderPrecisionFormat);
-       glGetShaderPrecisionFormatp(shaderType, precisionType, range, precision);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xx",
-             (uint64_t)(shaderType), (uint64_t)(precisionType));
-}
-
-//lsh_get
-void glGetShaderSource(GLuint shader, GLsizei bufSize, GLsizei *length,
-               char *source) {
-       typedef void (*methodType)(GLuint, GLsizei, GLsizei *, char *);
-       BEFORE(glGetShaderSource);
-       glGetShaderSourcep(shader, bufSize, length, source);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dd",
-                       shader, bufSize);
-}
-
-//lsh_get
-void glGetShaderiv(GLuint shader, GLenum pname, GLint *params) {
-       typedef void (*methodType)(GLuint, GLenum, GLint *);
-       BEFORE(glGetShaderiv);
-       glGetShaderivp(shader, pname, params);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dx",
-             shader, (uint64_t)(pname));
-}
-
-const GLubyte* glGetString(GLenum name) {
-       typedef const GLubyte* (*methodType)(GLenum);
-       BEFORE(glGetString);
-       const GLubyte* ret = glGetStringp(name);
-       GL_GET_ERROR();
-       AFTER('p', ret, APITYPE_CONTEXT, "", "x", (uint64_t)(name));
-
-       return ret;
-}
-
-//lsh_get
-void glGetTexParameterfv(GLenum target, GLenum pname, GLfloat * params) {
-       typedef void (*methodType)(GLenum, GLenum, GLfloat *);
-       BEFORE(glGetTexParameterfv);
-       glGetTexParameterfvp(target, pname, params);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xx",
-             (uint64_t)(target), (uint64_t)(pname));
-}
-
-//lsh_get
-void glGetTexParameteriv(GLenum target, GLenum pname, GLint * params) {
-       typedef void (*methodType)(GLenum, GLenum, GLint *);
-       BEFORE(glGetTexParameteriv);
-       glGetTexParameterivp(target, pname, params);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xx",
-             (uint64_t)(target), (uint64_t)(pname));
-}
-
-//lsh_get
-void glGetUniformfv(GLuint program, GLint location, GLfloat *params) {
-       typedef void (*methodType)(GLuint, GLuint, GLfloat *);
-       BEFORE(glGetUniformfv);
-       glGetUniformfvp(program, location, params);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dd",
-                       program, location);
-}
-
-//lsh_get
-void glGetUniformiv(GLuint program, GLint location, GLint *params) {
-       typedef void (*methodType)(GLuint, GLuint, GLint *);
-       BEFORE(glGetUniformiv);
-       glGetUniformivp(program, location, params);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dd",
-                       program, location);
-}
-
-//lsh_get
-GLint glGetUniformLocation(GLuint program, const char *name) {
-       typedef GLint (*methodType)(GLuint, const char *);
-       BEFORE(glGetUniformLocation);
-       GLint ret = glGetUniformLocationp(program, name);
-       GL_GET_ERROR();
-       AFTER('d', ret, APITYPE_CONTEXT, "", "d", program);
-
-       return ret;
-}
-
-//lsh_get
-void glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat *params) {
-       typedef void (*methodType)(GLuint, GLenum, GLfloat *);
-       BEFORE(glGetVertexAttribfv);
-       glGetVertexAttribfvp(index, pname, params);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dx",
-             index, (uint64_t)(pname));
-}
+//disable tizen redefines
+#define _GL2_MACRO_H_
+#define _GL_MACRO_H_
 
-//lsh_get
-void glGetVertexAttribiv(GLuint index, GLenum pname, GLint *params) {
-       typedef void (*methodType)(GLuint, GLenum, GLint *);
-       BEFORE(glGetVertexAttribiv);
-       glGetVertexAttribivp(index, pname, params);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dx",
-             index, (uint64_t)(pname));
-}
-
-//lsh_get
-void glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid **pointer) {
-       typedef void (*methodType)(GLuint, GLenum, GLvoid **);
-       BEFORE(glGetVertexAttribPointerv);
-       glGetVertexAttribPointervp(index, pname, pointer);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dx",
-             index, (uint64_t)(pname));
-}
-
-// ==================================================================
-// H 1
-// ==================================================================
-
-void glHint(GLenum target, GLenum mode) {
-       typedef void (*methodType)(GLenum, GLenum);
-       BEFORE(glHint);
-       glHintp(target, mode);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xx",
-             (uint64_t)(target), (uint64_t)(mode));
-}
-
-// ==================================================================
-// I 7
-// ==================================================================
-
-GLboolean glIsBuffer(GLuint buffer) {
-       typedef GLboolean (*methodType)(GLuint);
-       BEFORE(glIsBuffer);
-       GLboolean ret = glIsBufferp(buffer);
-       GL_GET_ERROR();
-       AFTER('c', ret, APITYPE_CONTEXT, "", "d", buffer);
-
-       return ret;
-}
-
-GLboolean glIsEnabled(GLenum cap) {
-       typedef GLboolean (*methodType)(GLenum);
-       BEFORE(glIsEnabled);
-       GLboolean ret = glIsEnabledp(cap);
-       GL_GET_ERROR();
-       AFTER('c', ret, APITYPE_CONTEXT, "", "x", (uint64_t)(cap));
-
-       return ret;
-}
-
-GLboolean glIsFramebuffer(GLuint framebuffer) {
-       typedef GLboolean (*methodType)(GLuint);
-       BEFORE(glIsFramebuffer);
-       GLboolean ret = glIsFramebufferp(framebuffer);
-       GL_GET_ERROR();
-       AFTER('c', ret, APITYPE_CONTEXT, "", "d", framebuffer);
-
-       return ret;
-}
-
-GLboolean glIsProgram(GLuint program) {
-       typedef GLboolean (*methodType)(GLuint);
-       BEFORE(glIsProgram);
-       GLboolean ret = glIsProgramp(program);
-       GL_GET_ERROR();
-       AFTER('c', ret, APITYPE_CONTEXT, "", "d", program);
-
-       return ret;
-}
-
-GLboolean glIsRenderbuffer(GLuint renderbuffer) {
-       typedef GLboolean (*methodType)(GLuint);
-       BEFORE(glIsRenderbuffer);
-       GLboolean ret = glIsRenderbufferp(renderbuffer);
-       GL_GET_ERROR();
-       AFTER('c', ret, APITYPE_CONTEXT, "", "d", renderbuffer);
-
-       return ret;
-}
-
-GLboolean glIsShader(GLuint shader) {
-       typedef GLboolean (*methodType)(GLuint);
-       BEFORE(glIsShader);
-       GLboolean ret = glIsShaderp(shader);
-       GL_GET_ERROR();
-       AFTER('c', ret, APITYPE_CONTEXT, "", "d", shader);
-
-       return ret;
-}
-
-GLboolean glIsTexture(GLuint texture) {
-       typedef GLboolean (*methodType)(GLuint);
-       BEFORE(glIsTexture);
-       GLboolean ret = glIsTexturep(texture);
-       GL_GET_ERROR();
-       AFTER('c', ret, APITYPE_CONTEXT, "", "d", texture);
-
-       return ret;
-}
-
-// ==================================================================
-// L 2
-// ==================================================================
-
-void glLineWidth(GLfloat width) {
-       typedef void (*methodType)(GLfloat);
-       BEFORE(glLineWidth);
-       glLineWidthp(width);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "f", width);
-}
-
-void glLinkProgram(GLuint program) {
-       typedef void (*methodType)(GLuint);
-       BEFORE(glLinkProgram);
-       glLinkProgramp(program);
-       GL_GET_ERROR();
-       char buf[512] = "";
-       if (error == GL_NO_ERROR) {
-               int bufP = 0;
-               GLint activeNum[1];
-               GLint maxLength[1];
-               glGetProgramiv(program, GL_ACTIVE_ATTRIBUTES, activeNum);
-               glGetProgramiv(program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, maxLength);
-               bufP += sprintf(buf + bufP, "%d", activeNum[0]);
-               for (int i = 0; i < activeNum[0]; i++) {
-                       GLsizei length[1];
-                       GLint size[1];
-                       GLenum type[1];
-                       char name[maxLength[0]];
-                       glGetActiveAttrib(program, i, maxLength[0], length, size, type,
-                                       name);
-                       bufP += sprintf(buf + bufP, ",%d,%s,%d,%x", i, name, size[0],
-                                       type[0]);
-               }
-
-               glGetProgramiv(program, GL_ACTIVE_UNIFORMS, activeNum);
-               glGetProgramiv(program, GL_ACTIVE_UNIFORM_MAX_LENGTH, maxLength);
-               bufP += sprintf(buf + bufP, ",%d", activeNum[0]);
-               for (int i = 0; i < activeNum[0]; i++) {
-                       GLsizei length[1];
-                       GLint size[1];
-                       GLenum type[1];
-                       char name[maxLength[0]];
-                       glGetActiveUniform(program, i, maxLength[0], length, size, type,
-                                       name);
-                       bufP += sprintf(buf + bufP, ",%d,%s,%d,%x", i, name, size[0],
-                                       type[0]);
-               }
-       }
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, buf, "d",
-                       program);
-}
-
-// ==================================================================
-// P 2
-// ==================================================================
-
-void glPixelStorei(GLenum pname, GLint param) {
-       typedef void (*methodType)(GLenum, GLint);
-       BEFORE(glPixelStorei);
-       glPixelStoreip(pname, param);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xd",
-             (uint64_t)(pname), param);
-}
-
-void glPolygonOffset(GLfloat factor, GLfloat units) {
-       typedef void (*methodType)(GLfloat, GLfloat);
-       BEFORE(glPolygonOffset);
-       glPolygonOffsetp(factor, units);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ff",
-                       factor, units);
-}
-
-// ==================================================================
-// R 3
-// ==================================================================
-
-//lsh_get
-void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
-               GLenum format, GLenum type, GLvoid * data) {
-       typedef void (*methodType)(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum,
-                       GLvoid *);
-       BEFORE(glReadPixels);
-       glReadPixelsp(x, y, width, height, format, type, data);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "",
-             "ddddxx", x, y, width, height,
-             (uint64_t)(format), (uint64_t)(type));
-}
-
-void glReleaseShaderCompiler(void) {
-       typedef void (*methodType)(void);
-       BEFORE(glReleaseShaderCompiler);
-       glReleaseShaderCompilerp();
-       GL_GET_ERROR();
-       AFTER_NO_PARAM('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "");
-}
-
-void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width,
-               GLsizei height) {
-       typedef void (*methodType)(GLenum, GLenum, GLsizei, GLsizei);
-       BEFORE(glRenderbufferStorage);
-       glRenderbufferStoragep(target, internalformat, width, height);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxdd",
-             (uint64_t)(target), (uint64_t)(internalformat),
-             width, height);
-}
-
-// ==================================================================
-// S 10
-// ==================================================================
-
-void glSampleCoverage(GLclampf value, GLboolean invert) {
-       typedef void (*methodType)(GLclampf, GLboolean);
-       BEFORE(glSampleCoverage);
-       glSampleCoveragep(value, invert);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "fx",
-                       value, (uint64_t)(invert));
-}
-
-void glScissor(GLint x, GLint y, GLsizei width, GLsizei height) {
-       typedef void (*methodType)(GLint, GLint, GLsizei, GLsizei);
-       BEFORE(glScissor);
-       glScissorp(x, y, width, height);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dddd",
-                       x, y, width, height);
-}
-
-//lsh_param
-void glShaderBinary(GLsizei n, const GLuint *shaders, GLenum binaryformat,
-               const void *binary, GLsizei length) {
-       typedef void (*methodType)(GLsizei, const GLuint *, GLenum, const void *,
-                       GLsizei);
-       BEFORE(glShaderBinary);
-       glShaderBinaryp(n, shaders, binaryformat, binary, length);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "",
-             "dpxpd", n, voidp_to_uint64(shaders),
-             (uint64_t)(binaryformat), voidp_to_uint64(binary), length);
-}
-
-//lsh_param
-void glShaderSource(GLuint shader, GLsizei count, const char** string,
-               const GLint* length) {
-       typedef void (*methodType)(GLuint, GLsizei, const char**, const GLint*);
-       BEFORE(glShaderSource);
-       glShaderSourcep(shader, count, string, length);
-       GL_GET_ERROR();
-       if (error == GL_NO_ERROR) {
-               GLint length[1];
-               glGetShaderiv(shader, GL_SHADER_SOURCE_LENGTH, length);
-               char buf[length[0]];
-               glGetShaderSource(shader, length[0], NULL, buf);
-               AFTER_SHADER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, buf,
-                            length[0], "ddpp", shader, count,
-                            voidp_to_uint64(string), voidp_to_uint64(length));
-       } else {
-               AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "",
-                     "ddpp", shader, count,
-                     voidp_to_uint64(string), voidp_to_uint64(length));
-       }
-}
-
-void glStencilFunc(GLenum func, GLint ref, GLuint mask) {
-       typedef void (*methodType)(GLenum, GLint, GLint);
-       BEFORE(glStencilFunc);
-       glStencilFuncp(func, ref, mask);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xdd",
-             (uint64_t)(func), ref, mask);
-}
-
-void glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) {
-       typedef void (*methodType)(GLenum, GLenum, GLint, GLuint);
-       BEFORE(glStencilFuncSeparate);
-       glStencilFuncSeparatep(face, func, ref, mask);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxdd",
-             (uint64_t)(face), (uint64_t)(func), ref, mask);
-}
-
-void glStencilMask(GLuint mask) {
-       typedef void (*methodType)(GLuint);
-       BEFORE(glStencilMask);
-       glStencilMaskp(mask);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "d", mask);
-}
-
-void glStencilMaskSeparate(GLenum face, GLuint mask) {
-       typedef void (*methodType)(GLenum, GLuint);
-       BEFORE(glStencilMaskSeparate);
-       glStencilMaskSeparatep(face, mask);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xd",
-             (uint64_t)(face), mask);
-}
-
-void glStencilOp(GLenum sfail, GLenum dpfail, GLenum dppass) {
-       typedef void (*methodType)(GLenum, GLenum, GLenum);
-       BEFORE(glStencilOp);
-       glStencilOpp(sfail, dpfail, dppass);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxx",
-             (uint64_t)(sfail), (uint64_t)(dpfail),
-             (uint64_t)(dppass));
-}
-
-void glStencilOpSeparate(GLenum face, GLenum sfail, GLenum dpfail,
-               GLenum dppass) {
-       typedef void (*methodType)(GLenum, GLenum, GLenum, GLenum);
-       BEFORE(glStencilOpSeparate);
-       glStencilOpSeparatep(face, sfail, dpfail, dppass);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxxx",
-             (uint64_t)(face), (uint64_t)(sfail), (uint64_t)(dpfail),
-             (uint64_t)(dppass));
-}
-
-// ==================================================================
-// T 6
-// ==================================================================
-
-void glTexImage2D(GLenum target, GLint level, GLenum internalformat,
-               GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type,
-               const GLvoid *data)
-{
-       typedef void (*methodType)(GLenum, GLint, GLint, GLsizei, GLsizei, GLint,
-                       GLenum, GLenum, const GLvoid *);
-       BEFORE(glTexImage2D);
-       glTexImage2Dp(target, level, internalformat, width, height, border, format,
-                       type, data);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xdddddxxp",
-             (uint64_t)(target), level, internalformat, width, height,
-             border, (uint64_t)(format), (uint64_t)(type),
-             voidp_to_uint64(data));
-}
-
-void glTexParameterf(GLenum target, GLenum pname, GLfloat param) {
-       typedef void (*methodType)(GLenum, GLenum, GLfloat);
-       BEFORE(glTexParameterf);
-       glTexParameterfp(target, pname, param);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxf",
-             (uint64_t)(target), (uint64_t)(pname), param);
-}
-
-void glTexParameterfv(GLenum target, GLenum pname, const GLfloat * params) {
-       typedef void (*methodType)(GLenum, GLenum, const GLfloat *);
-       BEFORE(glTexParameterfv);
-       glTexParameterfvp(target, pname, params);
-       GL_GET_ERROR();
-       if(error == GL_NO_ERROR) {
-               char param0[8];
-               sprintf(param0, "%x", (GLenum)params[0]);
-               AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, param0, "xxp",
-                     (uint64_t)(target), (uint64_t)(pname),
-                     voidp_to_uint64(params));
-       } else {
-               AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxp",
-                     (uint64_t)(target), (uint64_t)(pname),
-                     voidp_to_uint64(params));
-       }
-}
-
-void glTexParameteri(GLenum target, GLenum pname, GLint param) {
-       typedef void (*methodType)(GLenum, GLenum, GLint);
-       BEFORE(glTexParameteri);
-       glTexParameterip(target, pname, param);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxx",
-             (uint64_t)(target), (uint64_t)(pname),
-             (uint64_t)(param));
-}
-
-void glTexParameteriv(GLenum target, GLenum pname, const GLint * params) {
-       typedef void (*methodType)(GLenum, GLenum, const GLint *);
-       BEFORE(glTexParameteriv);
-       glTexParameterivp(target, pname, params);
-       GL_GET_ERROR();
-       if(error == GL_NO_ERROR) {
-               char param0[8];
-               sprintf(param0, "%x", (GLenum)params[0]);
-               AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, param0, "xxp",
-                     (uint64_t)(target), (uint64_t)(pname),
-                     voidp_to_uint64(params));
-       } else {
-               AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxp",
-                     (uint64_t)(target),
-                     (uint64_t)(pname),
-                     voidp_to_uint64(params));
-       }
-}
-
-void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
-               GLsizei width, GLsizei height, GLenum format, GLenum type,
-               const GLvoid * data) {
-       typedef void (*methodType)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei,
-                       GLenum, GLenum, const GLvoid *);
-       BEFORE(glTexSubImage2D);
-       glTexSubImage2Dp(target, level, xoffset, yoffset, width, height, format, type,
-                       data);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "",
-             "xdddddxxp",
-             (uint64_t)(target), level, xoffset, yoffset, width, height,
-             (uint64_t)(format), (uint64_t)(type), voidp_to_uint64(data));
-}
-
-// ==================================================================
-// U 20
-// ==================================================================
-
-void glUniform1f(GLint location, GLfloat v0) {
-       typedef void (*methodType)(GLint, GLfloat);
-       BEFORE(glUniform1f);
-       glUniform1fp(location, v0);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "df",
-                       location, v0);
-}
-
-void glUniform2f(GLint location, GLfloat v0, GLfloat v1) {
-       typedef void (*methodType)(GLint, GLfloat, GLfloat);
-       BEFORE(glUniform2f);
-       glUniform2fp(location, v0, v1);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dff",
-                       location, v0, v1);
-}
-
-void glUniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) {
-       typedef void (*methodType)(GLint, GLfloat, GLfloat, GLfloat);
-       BEFORE(glUniform3f);
-       glUniform3fp(location, v0, v1, v2);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dfff",
-                       location, v0, v1, v2);
-}
-
-void glUniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2,
-               GLfloat v3) {
-       typedef void (*methodType)(GLint, GLfloat, GLfloat, GLfloat, GLfloat);
-       BEFORE(glUniform4f);
-       glUniform4fp(location, v0, v1, v2, v3);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "",
-                       "dffff", location, v0, v1, v2, v3);
-}
-
-void glUniform1fv(GLint location, GLsizei count, const GLfloat *value) {
-       typedef void (*methodType)(GLint, GLsizei, const GLfloat *);
-       BEFORE(glUniform1fv);
-       glUniform1fvp(location, count, value);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddF",
-             location, count, count * 1, voidp_to_uint64(value));
-}
-
-void glUniform2fv(GLint location, GLsizei count, const GLfloat *value) {
-       typedef void (*methodType)(GLint, GLsizei, const GLfloat *);
-       BEFORE(glUniform2fv);
-       glUniform2fvp(location, count, value);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddF",
-             location, count, count * 2, voidp_to_uint64(value));
-}
-
-void glUniform3fv(GLint location, GLsizei count, const GLfloat *value) {
-       typedef void (*methodType)(GLint, GLsizei, const GLfloat *);
-       BEFORE(glUniform3fv);
-       glUniform3fvp(location, count, value);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddF",
-             location, count, count * 3, voidp_to_uint64(value));
-}
-
-void glUniform4fv(GLint location, GLsizei count, const GLfloat *value) {
-       typedef void (*methodType)(GLint, GLsizei, const GLfloat *);
-       BEFORE(glUniform4fv);
-       glUniform4fvp(location, count, value);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddF",
-             location, count, count * 4, voidp_to_uint64(value));
-}
-
-void glUniform1i(GLint location, GLint v0) {
-       typedef void (*methodType)(GLint, GLint);
-       BEFORE(glUniform1i);
-       glUniform1ip(location, v0);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dd",
-                       location, v0);
-}
-
-void glUniform2i(GLint location, GLint v0, GLint v1) {
-       typedef void (*methodType)(GLint, GLint, GLint);
-       BEFORE(glUniform2i);
-       glUniform2ip(location, v0, v1);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddd",
-                       location, v0, v1);
-}
-
-void glUniform3i(GLint location, GLint v0, GLint v1, GLint v2) {
-       typedef void (*methodType)(GLint, GLint, GLint, GLint);
-       BEFORE(glUniform3i);
-       glUniform3ip(location, v0, v1, v2);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dddd",
-                       location, v0, v1, v2);
-}
-
-void glUniform4i(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) {
-       typedef void (*methodType)(GLint, GLint, GLint, GLint, GLint);
-       BEFORE(glUniform4i);
-       glUniform4ip(location, v0, v1, v2, v3);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "",
-                       "ddddd", location, v0, v1, v2, v3);
-}
-
-void glUniform1iv(GLint location, GLsizei count, const GLint *value) {
-       typedef void (*methodType)(GLint, GLsizei, const GLint *);
-       BEFORE(glUniform1iv);
-       glUniform1ivp(location, count, value);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddD",
-             location, count, count * 1, voidp_to_uint64(value));
-}
-
-void glUniform2iv(GLint location, GLsizei count, const GLint *value) {
-       typedef void (*methodType)(GLint, GLsizei, const GLint *);
-       BEFORE(glUniform2iv);
-       glUniform2ivp(location, count, value);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddD",
-             location, count, count * 2, voidp_to_uint64(value));
-}
-
-void glUniform3iv(GLint location, GLsizei count, const GLint *value) {
-       typedef void (*methodType)(GLint, GLsizei, const GLint *);
-       BEFORE(glUniform3iv);
-       glUniform3ivp(location, count, value);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddD",
-             location, count, count * 3, voidp_to_uint64(value));
-}
-
-void glUniform4iv(GLint location, GLsizei count, const GLint *value) {
-       typedef void (*methodType)(GLint, GLsizei, const GLint *);
-       BEFORE(glUniform4iv);
-       glUniform4ivp(location, count, value);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddD",
-             location, count, count * 4, voidp_to_uint64(value));
-}
-
-void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose,
-               const GLfloat *value) {
-       typedef void (*methodType)(GLint, GLsizei, GLboolean, const GLfloat *);
-       BEFORE(glUniformMatrix2fv);
-       glUniformMatrix2fvp(location, count, transpose, value);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddxF",
-             location, count, (uint64_t)(transpose), count * 2 * 2,
-             voidp_to_uint64(value));
-}
-
-void glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose,
-               const GLfloat *value) {
-       typedef void (*methodType)(GLint, GLsizei, GLboolean, const GLfloat *);
-       BEFORE(glUniformMatrix3fv);
-       glUniformMatrix3fvp(location, count, transpose, value);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddxF",
-             location, count, (uint64_t)(transpose), count * 3 * 3,
-             voidp_to_uint64(value));
-}
-
-void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose,
-               const GLfloat *value) {
-       typedef void (*methodType)(GLint, GLsizei, GLboolean, const GLfloat *);
-       BEFORE(glUniformMatrix4fv);
-       glUniformMatrix4fvp(location, count, transpose, value);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddxF",
-             location, count, (uint64_t)(transpose), count * 4 * 4,
-             voidp_to_uint64(value));
-}
-
-
-void glUseProgram(GLuint program) {
-       typedef void (*methodType)(GLuint);
-       BEFORE(glUseProgram);
-       glUseProgramp(program);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "d",
-                       program);
-}
-
-// ==================================================================
-// V 7
-// ==================================================================
-
-void glValidateProgram(GLuint program) {
-       typedef void (*methodType)(GLuint);
-       BEFORE(glValidateProgram);
-       glValidateProgramp(program);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "d",
-                       program);
-}
-
-void glVertexAttrib1f(GLuint index, GLfloat v0) {
-       typedef void (*methodType)(GLuint, GLfloat);
-       BEFORE(glVertexAttrib1f);
-       glVertexAttrib1fp(index, v0);
-
-       GLfloat cv[4];
-       glGetVertexAttribfv(index, GL_CURRENT_VERTEX_ATTRIB, cv);
-       sprintf(contextValue, "%f,%f,%f,%f", cv[0], cv[1], cv[2], cv[3]);
-
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, contextValue,
-                       "df", index, v0);
-}
-
-void glVertexAttrib2f(GLuint index, GLfloat v0, GLfloat v1) {
-       typedef void (*methodType)(GLuint, GLfloat, GLfloat);
-       BEFORE(glVertexAttrib2f);
-       glVertexAttrib2fp(index, v0, v1);
-
-       GLfloat cv[4];
-       glGetVertexAttribfv(index, GL_CURRENT_VERTEX_ATTRIB, cv);
-       sprintf(contextValue, "%f,%f,%f,%f", cv[0], cv[1], cv[2], cv[3]);
-
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, contextValue,
-                       "dff", index, v0, v1);
-}
-
-void glVertexAttrib3f(GLuint index, GLfloat v0, GLfloat v1, GLfloat v2) {
-       typedef void (*methodType)(GLuint, GLfloat, GLfloat, GLfloat);
-       BEFORE(glVertexAttrib3f);
-       glVertexAttrib3fp(index, v0, v1, v2);
-
-       GLfloat cv[4];
-       glGetVertexAttribfv(index, GL_CURRENT_VERTEX_ATTRIB, cv);
-       sprintf(contextValue, "%f,%f,%f,%f", cv[0], cv[1], cv[2], cv[3]);
-
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, contextValue,
-                       "dfff", index, v0, v1, v2);
-}
-
-void glVertexAttrib4f(GLuint index, GLfloat v0, GLfloat v1, GLfloat v2,
-               GLfloat v3) {
-       typedef void (*methodType)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
-       BEFORE(glVertexAttrib4f);
-       glVertexAttrib4fp(index, v0, v1, v2, v3);
-
-       GLfloat cv[4];
-       glGetVertexAttribfv(index, GL_CURRENT_VERTEX_ATTRIB, cv);
-       sprintf(contextValue, "%f,%f,%f,%f", cv[0], cv[1], cv[2], cv[3]);
-
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, contextValue,
-                       "dffff", index, v0, v1, v2, v3);
-}
-
-void glVertexAttrib1fv(GLuint index, const GLfloat *v) {
-       typedef void (*methodType)(GLuint, const GLfloat *);
-       BEFORE(glVertexAttrib1fv);
-       glVertexAttrib1fvp(index, v);
-
-       GLfloat cv[4];
-       glGetVertexAttribfv(index, GL_CURRENT_VERTEX_ATTRIB, cv);
-       sprintf(contextValue, "%f,%f,%f,%f", cv[0], cv[1], cv[2], cv[3]);
-
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, contextValue,
-             "dp", index, voidp_to_uint64(v));
-}
-
-void glVertexAttrib2fv(GLuint index, const GLfloat *v) {
-       typedef void (*methodType)(GLuint, const GLfloat *);
-       BEFORE(glVertexAttrib2fv);
-       glVertexAttrib2fvp(index, v);
-
-       GLfloat cv[4];
-       glGetVertexAttribfv(index, GL_CURRENT_VERTEX_ATTRIB, cv);
-       sprintf(contextValue, "%f,%f,%f,%f", cv[0], cv[1], cv[2], cv[3]);
-
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, contextValue,
-             "dp", index, voidp_to_uint64(v));
-}
-
-void glVertexAttrib3fv(GLuint index, const GLfloat *v) {
-       typedef void (*methodType)(GLuint, const GLfloat *);
-       BEFORE(glVertexAttrib3fv);
-       glVertexAttrib3fvp(index, v);
-
-       GLfloat cv[4];
-       glGetVertexAttribfv(index, GL_CURRENT_VERTEX_ATTRIB, cv);
-       sprintf(contextValue, "%f,%f,%f,%f", cv[0], cv[1], cv[2], cv[3]);
+#include "common_probe_init.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, contextValue,
-             "dp", index, voidp_to_uint64(v));
-}
+#define REAL_NAME(func) __local_##func
+#define BEFORE BEFORE_GL_API
+#define CALL_ORIG(func, ...) __gl_api->func(__VA_ARGS__)
 
-void glVertexAttrib4fv(GLuint index, const GLfloat *v) {
-       typedef void (*methodType)(GLuint, const GLfloat *);
-       BEFORE(glVertexAttrib4fv);
-       glVertexAttrib4fvp(index, v);
-       GLfloat cv[4];
-       glGetVertexAttribfv(index, GL_CURRENT_VERTEX_ATTRIB, cv);
-       sprintf(contextValue, "%f,%f,%f,%f", cv[0], cv[1], cv[2], cv[3]);
+/*
+ * this include to make tizen open gl api functions
+ * probe prototypes
+ *
+ */
+#include "da_gles20_native.cpp"
 
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, contextValue,
-             "dp", index, voidp_to_uint64(v));
-}
+#ifdef __cplusplus
+} /* extern C */
+#endif
 
-void glVertexAttribPointer(GLuint index, GLint size, GLenum type,
-               GLboolean normalized, GLsizei stride, const GLvoid * pointer) {
-       typedef void (*methodType)(GLuint, GLint, GLenum, GLboolean, GLsizei,
-                       const GLvoid *);
-       BEFORE(glVertexAttribPointer);
-       glVertexAttribPointerp(index, size, type, normalized, stride, pointer);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "ddxxdp",
-             index, size, (uint64_t)(type), (uint64_t)(normalized),
-             stride, voidp_to_uint64(pointer));
-}
+#undef _GL2_MACRO_H_
+#undef _GL_MACRO_H_
 
-void glViewport(GLint x, GLint y, GLsizei width, GLsizei height) {
-       typedef void (*methodType)(GLint, GLint, GLsizei, GLsizei);
-       BEFORE(glViewport);
-       glViewportp(x, y, width, height);
-       GL_GET_ERROR();
-       AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dddd",
-                       x, y, width, height);
-}