tizen 2.3 release
[framework/system/swap-probe.git] / include / common_probe_init.h
1 /*
2  *  DA probe
3  *
4  * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact:
7  *
8  * Vitaliy Cherepanov <v.cherepanov@samsung.com>
9  *
10  * This library is free software; you can redistribute it and/or modify it under
11  * the terms of the GNU Lesser General Public License as published by the
12  * Free Software Foundation; either version 2.1 of the License, or (at your option)
13  * any later version.
14  *
15  * This library is distributed in the hope that it will be useful, but WITHOUT ANY
16  * WARRANTY; without even the implied warranty of MERCHANTABILITY or
17  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18  * License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with this library; if not, write to the Free Software Foundation, Inc., 51
22  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  * Contributors:
25  * - S-Core Co., Ltd
26  *
27  */
28 #ifndef __COMMON_PROBE_INIT_H__
29 #define __COMMON_PROBE_INIT_H__
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 #include "dahelper.h"
36 #include "da_gles20.h"
37 ////////////////////////////////////////////////////////////////////////////
38 //egl init probe function
39 //  params:
40 //    func_name    - original function name for dlsym search
41 //    func_pointer - original function pointer (return)
42 //
43 //  info
44 //    search original function by name
45 //    function have no return becouse on error it terminates main application
46 extern void init_probe_egl(const char *func_name, void **func_pointer,
47                            ORIGINAL_LIBRARY id);
48
49 extern void init_probe_gl(const char *func_name, void **func_pointer,
50                           ORIGINAL_LIBRARY id, int blockresult, int32_t vAPI_ID);
51
52 extern void probe_terminate_with_err(const char *msg, const char *func_name,
53                                      ORIGINAL_LIBRARY id);
54
55 void __init_gl_api__(void);
56 int __init_gl_functions__(void);
57
58 /* links to real functions to call in probes */
59 extern void (*real_glGetVertexAttribfv)(GLuint index, GLenum pname,
60                                         GLfloat *params);
61 extern void (*real_glGetIntegerv)(GLenum pname, GLint * params);
62 extern void (*real_glGetProgramiv)(GLuint program, GLenum pname, GLint *params);
63 extern void (*real_glGetShaderiv)(GLuint shader, GLenum pname, GLint *params);
64 extern void (*real_glGetActiveAttrib)(GLuint program, GLuint index,
65                                       GLsizei bufSize, GLsizei *length,
66                                       GLint *size, GLenum *type, char *name);
67 extern void (*real_glGetActiveUniform)(GLuint program, GLuint index,
68                                        GLsizei bufSize, GLsizei *length,
69                                        GLint *size, GLenum *type, char *name);
70 extern void (*real_glGetShaderSource)(GLuint shader, GLsizei bufSize,
71                                       GLsizei *length, char *source);
72 extern void (*real_glGetBufferParameteriv)(GLenum target, GLenum value,
73                                            GLint *data);
74
75 #ifdef __cplusplus
76 } /* extern "C" */
77 #endif
78
79 #endif /* __COMMON_PROBE_INIT_H__ */