"Initial commit to Gerrit"
[profile/ivi/cogl.git] / cogl / gl-prototypes / cogl-all-functions.h
1 /*
2  * Cogl
3  *
4  * An object oriented GL/GLES Abstraction/Utility Layer
5  *
6  * Copyright (C) 2009, 2011 Intel Corporation.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
20  *
21  *
22  */
23
24 /* This is included multiple times with different definitions for
25  * these macros. The macros are given the following arguments:
26  *
27  * COGL_EXT_BEGIN:
28  *
29  * @name: a unique symbol name for this feature
30  *
31  * @min_gl_major: the major part of the minimum GL version where these
32  * functions are available in core, or 255 if it isn't available in
33  * any version.
34  * @min_gl_minor: the minor part of the minimum GL version where these
35  * functions are available in core, or 255 if it isn't available in
36  * any version.
37  *
38  * @gles_availability: flags to specify which versions of GLES the
39  * functions are available in. Should be a combination of
40  * COGL_EXT_IN_GLES and COGL_EXT_IN_GLES2.
41  *
42  * @extension_suffixes: A zero-separated list of suffixes in a
43  * string. These are appended to the extension name to get a complete
44  * extension name to try. The suffix is also appended to all of the
45  * function names. The suffix can optionally include a ':' to specify
46  * an alternate suffix for the function names.
47  *
48  * @extension_names: A list of extension names to try. If any of these
49  * extensions match then it will be used.
50  */
51
52 /* The functions in this file are part of the core GL,GLES1 and GLES2 apis */
53 #include "cogl-core-functions.h"
54
55 /* The functions in this file are core to GLES1 only but may also be
56  * extensions available for GLES2 and GL */
57 #include "cogl-in-gles1-core-functions.h"
58
59 /* The functions in this file are core to GLES2 only but
60  * may be extensions for GLES1 and GL */
61 #include "cogl-in-gles2-core-functions.h"
62
63 /* The functions in this file are core to GLES1 and GLES2 but not core
64  * to GL but they may be extensions available for GL */
65 #include "cogl-in-gles-core-functions.h"
66
67 /* These are fixed-function APIs core to GL and GLES1 */
68 #include "cogl-fixed-functions.h"
69
70 /* These are GLSL shader APIs core to GL 2.0 and GLES2 */
71 #include "cogl-glsl-functions.h"
72
73 /* These are the core GL functions which are only available in big
74    GL */
75 COGL_EXT_BEGIN (only_in_big_gl,
76                 0, 0,
77                 0, /* not in GLES */
78                 "\0",
79                 "\0")
80 COGL_EXT_FUNCTION (void, glGetTexLevelParameteriv,
81                    (GLenum target, GLint level,
82                     GLenum pname, GLint *params))
83 COGL_EXT_FUNCTION (void, glGetTexImage,
84                    (GLenum target, GLint level,
85                     GLenum format, GLenum type,
86                     GLvoid *pixels))
87 COGL_EXT_FUNCTION (void, glClipPlane,
88                    (GLenum plane, const double *equation))
89 COGL_EXT_FUNCTION (void, glDepthRange,
90                    (double near_val, double far_val))
91 COGL_EXT_FUNCTION (void, glDrawBuffer,
92                    (GLenum mode))
93 COGL_EXT_END ()
94
95
96 /* GLES doesn't support mapping buffers in core so this has to be a
97    separate check */
98 COGL_EXT_BEGIN (map_vbos, 1, 5,
99                 0, /* not in GLES core */
100                 "ARB\0OES\0",
101                 "vertex_buffer_object\0mapbuffer\0")
102 COGL_EXT_FUNCTION (void *, glMapBuffer,
103                    (GLenum               target,
104                     GLenum               access))
105 COGL_EXT_FUNCTION (GLboolean, glUnmapBuffer,
106                    (GLenum               target))
107 COGL_EXT_END ()
108
109 COGL_EXT_BEGIN (texture_3d, 1, 2,
110                 0, /* not in either GLES */
111                 "OES\0",
112                 "texture_3D\0")
113 COGL_EXT_FUNCTION (void, glTexImage3D,
114                    (GLenum target, GLint level,
115                     GLint internalFormat,
116                     GLsizei width, GLsizei height,
117                     GLsizei depth, GLint border,
118                     GLenum format, GLenum type,
119                     const GLvoid *pixels))
120 COGL_EXT_FUNCTION (void, glTexSubImage3D,
121                    (GLenum target, GLint level,
122                     GLint xoffset, GLint yoffset,
123                     GLint zoffset, GLsizei width,
124                     GLsizei height, GLsizei depth,
125                     GLenum format,
126                     GLenum type, const GLvoid *pixels))
127 COGL_EXT_END ()
128
129
130
131 COGL_EXT_BEGIN (offscreen_blit, 255, 255,
132                 0, /* not in either GLES */
133                 "EXT\0ANGLE\0",
134                 "framebuffer_blit\0")
135 COGL_EXT_FUNCTION (void, glBlitFramebuffer,
136                    (GLint                 srcX0,
137                     GLint                 srcY0,
138                     GLint                 srcX1,
139                     GLint                 srcY1,
140                     GLint                 dstX0,
141                     GLint                 dstY0,
142                     GLint                 dstX1,
143                     GLint                 dstY1,
144                     GLbitfield            mask,
145                     GLenum                filter))
146 COGL_EXT_END ()
147
148 /* ARB_fragment_program */
149 COGL_EXT_BEGIN (arbfp, 255, 255,
150                 0, /* not in either GLES */
151                 "ARB\0",
152                 "fragment_program\0")
153 COGL_EXT_FUNCTION (void, glGenPrograms,
154                    (GLsizei               n,
155                     GLuint               *programs))
156 COGL_EXT_FUNCTION (void, glDeletePrograms,
157                    (GLsizei               n,
158                     GLuint               *programs))
159 COGL_EXT_FUNCTION (void, glBindProgram,
160                    (GLenum                target,
161                     GLuint                program))
162 COGL_EXT_FUNCTION (void, glProgramString,
163                    (GLenum                target,
164                     GLenum                format,
165                     GLsizei               len,
166                     const void           *program))
167 COGL_EXT_FUNCTION (void, glProgramLocalParameter4fv,
168                    (GLenum                target,
169                     GLuint                index,
170                     GLfloat              *params))
171 COGL_EXT_END ()
172
173 COGL_EXT_BEGIN (EGL_image, 255, 255,
174                 0, /* not in either GLES */
175                 "OES\0",
176                 "EGL_image\0")
177 COGL_EXT_FUNCTION (void, glEGLImageTargetTexture2D,
178                    (GLenum           target,
179                     GLeglImageOES    image))
180 COGL_EXT_FUNCTION (void, glEGLImageTargetRenderbufferStorage,
181                    (GLenum           target,
182                     GLeglImageOES    image))
183 COGL_EXT_END ()
184
185 COGL_EXT_BEGIN (framebuffer_discard, 255, 255,
186                 0, /* not in either GLES */
187                 "EXT\0",
188                 "framebuffer_discard\0")
189 COGL_EXT_FUNCTION (void, glDiscardFramebuffer,
190                    (GLenum           target,
191                     GLsizei          numAttachments,
192                     const GLenum    *attachments))
193 COGL_EXT_END ()
194
195 COGL_EXT_BEGIN (IMG_multisampled_render_to_texture, 255, 255,
196                 0, /* not in either GLES */
197                 "\0",
198                 "IMG_multisampled_render_to_texture\0")
199 COGL_EXT_FUNCTION (void, glRenderbufferStorageMultisampleIMG,
200                    (GLenum           target,
201                     GLsizei          samples,
202                     GLenum           internal_format,
203                     GLsizei          width,
204                     GLsizei          height))
205 COGL_EXT_FUNCTION (void, glFramebufferTexture2DMultisampleIMG,
206                    (GLenum           target,
207                     GLenum           attachment,
208                     GLenum           textarget,
209                     GLuint           texture,
210                     GLint            level,
211                     GLsizei          samples))
212 COGL_EXT_END ()