"Initial commit to Gerrit"
[profile/ivi/cogl.git] / cogl / gl-prototypes / cogl-in-gles2-core-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 COGL_EXT_BEGIN (offscreen,
53                 255, 255,
54                 COGL_EXT_IN_GLES2,
55                 /* for some reason the ARB version of this
56                    extension doesn't have an ARB suffix for the
57                    functions */
58                 "ARB:\0EXT\0OES\0",
59                 "framebuffer_object\0")
60 COGL_EXT_FUNCTION (void, glGenRenderbuffers,
61                    (GLsizei               n,
62                     GLuint               *renderbuffers))
63 COGL_EXT_FUNCTION (void, glDeleteRenderbuffers,
64                    (GLsizei               n,
65                     const GLuint         *renderbuffers))
66 COGL_EXT_FUNCTION (void, glBindRenderbuffer,
67                    (GLenum                target,
68                     GLuint                renderbuffer))
69 COGL_EXT_FUNCTION (void, glRenderbufferStorage,
70                    (GLenum                target,
71                     GLenum                internalformat,
72                     GLsizei               width,
73                     GLsizei               height))
74 COGL_EXT_FUNCTION (void, glGenFramebuffers,
75                    (GLsizei               n,
76                     GLuint               *framebuffers))
77 COGL_EXT_FUNCTION (void, glBindFramebuffer,
78                    (GLenum                target,
79                     GLuint                framebuffer))
80 COGL_EXT_FUNCTION (void, glFramebufferTexture2D,
81                    (GLenum                target,
82                     GLenum                attachment,
83                     GLenum                textarget,
84                     GLuint                texture,
85                     GLint                 level))
86 COGL_EXT_FUNCTION (void, glFramebufferRenderbuffer,
87                    (GLenum                target,
88                     GLenum                attachment,
89                     GLenum                renderbuffertarget,
90                     GLuint                renderbuffer))
91 COGL_EXT_FUNCTION (GLboolean, glIsRenderbuffer,
92                    (GLuint                renderbuffer))
93 COGL_EXT_FUNCTION (GLenum, glCheckFramebufferStatus,
94                    (GLenum                target))
95 COGL_EXT_FUNCTION (void, glDeleteFramebuffers,
96                    (GLsizei               n,
97                     const                 GLuint *framebuffers))
98 COGL_EXT_FUNCTION (void, glGenerateMipmap,
99                    (GLenum                target))
100 COGL_EXT_FUNCTION (void, glGetFramebufferAttachmentParameteriv,
101                    (GLenum                target,
102                     GLenum                attachment,
103                     GLenum                pname,
104                     GLint                *params))
105 COGL_EXT_FUNCTION (void, glGetRenderbufferParameteriv,
106                    (GLenum                target,
107                     GLenum                pname,
108                     GLint                *params))
109 COGL_EXT_FUNCTION (GLboolean, glIsFramebuffer,
110                    (GLuint                framebuffer))
111 COGL_EXT_END ()
112
113 COGL_EXT_BEGIN (blending, 1, 2,
114                 COGL_EXT_IN_GLES2,
115                 "\0",
116                 "\0")
117 COGL_EXT_FUNCTION (void, glBlendEquation,
118                    (GLenum                mode))
119 COGL_EXT_FUNCTION (void, glBlendColor,
120                    (GLclampf              red,
121                     GLclampf              green,
122                     GLclampf              blue,
123                     GLclampf              alpha))
124 COGL_EXT_END ()
125
126 /* Optional, declared in 1.4 or GLES 1.2 */
127 COGL_EXT_BEGIN (blend_func_separate, 1, 4,
128                 COGL_EXT_IN_GLES2,
129                 "EXT\0",
130                 "blend_func_separate\0")
131 COGL_EXT_FUNCTION (void, glBlendFuncSeparate,
132                    (GLenum                srcRGB,
133                     GLenum                dstRGB,
134                     GLenum                srcAlpha,
135                     GLenum                dstAlpha))
136 COGL_EXT_END ()
137
138 /* Optional, declared in 2.0 */
139 COGL_EXT_BEGIN (blend_equation_separate, 2, 0,
140                 COGL_EXT_IN_GLES2,
141                 "EXT\0",
142                 "blend_equation_separate\0")
143 COGL_EXT_FUNCTION (void, glBlendEquationSeparate,
144                    (GLenum                modeRGB,
145                     GLenum                modeAlpha))
146 COGL_EXT_END ()
147
148 COGL_EXT_BEGIN (gles2_only_api,
149                 255, 255,
150                 COGL_EXT_IN_GLES2,
151                 "\0",
152                 "\0")
153 COGL_EXT_FUNCTION (void, glReleaseShaderCompiler, (void))
154 COGL_EXT_FUNCTION (void, glGetShaderPrecisionFormat,
155                    (GLenum shadertype,
156                     GLenum precisiontype,
157                     GLint* range,
158                     GLint* precision))
159 COGL_EXT_FUNCTION (void, glShaderBinary,
160                    (GLsizei n,
161                     const GLuint* shaders,
162                     GLenum binaryformat,
163                     const GLvoid* binary,
164                     GLsizei length))
165 COGL_EXT_END ()
166
167 /* GL and GLES 2.0 apis */
168 COGL_EXT_BEGIN (two_point_zero_api,
169                 2, 0,
170                 COGL_EXT_IN_GLES2,
171                 "\0",
172                 "\0")
173 COGL_EXT_FUNCTION (void, glStencilFuncSeparate,
174                    (GLenum face, GLenum func, GLint ref, GLuint mask))
175 COGL_EXT_FUNCTION (void, glStencilMaskSeparate,
176                    (GLenum face, GLuint mask))
177 COGL_EXT_FUNCTION (void, glStencilOpSeparate,
178                    (GLenum face, GLenum fail, GLenum zfail, GLenum zpass))
179 COGL_EXT_END ()