"Initial commit to Gerrit"
[profile/ivi/cogl.git] / cogl / gl-prototypes / cogl-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 /* These are the core GL functions which we assume will always be
53    available */
54 COGL_EXT_BEGIN (core,
55                 0, 0,
56                 COGL_EXT_IN_GLES | COGL_EXT_IN_GLES2,
57                 "\0",
58                 "\0")
59 COGL_EXT_FUNCTION (void, glBindTexture,
60                    (GLenum target, GLuint texture))
61 COGL_EXT_FUNCTION (void, glBlendFunc,
62                    (GLenum sfactor, GLenum dfactor))
63 COGL_EXT_FUNCTION (void, glClear,
64                    (GLbitfield mask))
65 COGL_EXT_FUNCTION (void, glClearColor,
66                    (GLclampf red,
67                     GLclampf green,
68                     GLclampf blue,
69                     GLclampf alpha))
70 COGL_EXT_FUNCTION (void, glClearStencil,
71                    (GLint s))
72 COGL_EXT_FUNCTION (void, glColorMask,
73                    (GLboolean red,
74                     GLboolean green,
75                     GLboolean blue,
76                     GLboolean alpha))
77 COGL_EXT_FUNCTION (void, glCopyTexSubImage2D,
78                    (GLenum target,
79                     GLint level,
80                     GLint xoffset,
81                     GLint yoffset,
82                     GLint x,
83                     GLint y,
84                     GLsizei width,
85                     GLsizei height))
86 COGL_EXT_FUNCTION (void, glDeleteTextures,
87                    (GLsizei n, const GLuint* textures))
88 COGL_EXT_FUNCTION (void, glDepthFunc,
89                    (GLenum func))
90 COGL_EXT_FUNCTION (void, glDepthMask,
91                    (GLboolean flag))
92 COGL_EXT_FUNCTION (void, glDisable,
93                    (GLenum cap))
94 COGL_EXT_FUNCTION (void, glDrawArrays,
95                    (GLenum mode, GLint first, GLsizei count))
96 COGL_EXT_FUNCTION (void, glDrawElements,
97                    (GLenum mode,
98                     GLsizei count,
99                     GLenum type,
100                     const GLvoid* indices))
101 COGL_EXT_FUNCTION (void, glEnable,
102                    (GLenum cap))
103 COGL_EXT_FUNCTION (void, glFinish,
104                    (void))
105 COGL_EXT_FUNCTION (void, glFlush,
106                    (void))
107 COGL_EXT_FUNCTION (void, glFrontFace,
108                    (GLenum mode))
109 COGL_EXT_FUNCTION (void, glCullFace,
110                    (GLenum mode))
111 COGL_EXT_FUNCTION (void, glGenTextures,
112                    (GLsizei n, GLuint* textures))
113 COGL_EXT_FUNCTION (GLenum, glGetError,
114                    (void))
115 COGL_EXT_FUNCTION (void, glGetIntegerv,
116                    (GLenum pname, GLint* params))
117 COGL_EXT_FUNCTION (void, glGetBooleanv,
118                    (GLenum pname, GLboolean* params))
119 COGL_EXT_FUNCTION (void, glGetFloatv,
120                    (GLenum pname, GLfloat* params))
121 COGL_EXT_FUNCTION (const GLubyte*, glGetString,
122                    (GLenum name))
123 COGL_EXT_FUNCTION (void, glHint,
124                    (GLenum target, GLenum mode))
125 COGL_EXT_FUNCTION (GLboolean, glIsTexture,
126                    (GLuint texture))
127 COGL_EXT_FUNCTION (void, glPixelStorei,
128                    (GLenum pname, GLint param))
129 COGL_EXT_FUNCTION (void, glReadPixels,
130                    (GLint x,
131                     GLint y,
132                     GLsizei width,
133                     GLsizei height,
134                     GLenum format,
135                     GLenum type,
136                     GLvoid* pixels))
137 COGL_EXT_FUNCTION (void, glScissor,
138                    (GLint x, GLint y, GLsizei width, GLsizei height))
139 COGL_EXT_FUNCTION (void, glStencilFunc,
140                    (GLenum func, GLint ref, GLuint mask))
141 COGL_EXT_FUNCTION (void, glStencilMask,
142                    (GLuint mask))
143 COGL_EXT_FUNCTION (void, glStencilOp,
144                    (GLenum fail, GLenum zfail, GLenum zpass))
145 COGL_EXT_FUNCTION (void, glTexImage2D,
146                    (GLenum target,
147                     GLint level,
148                     GLint internalformat,
149                     GLsizei width,
150                     GLsizei height,
151                     GLint border,
152                     GLenum format,
153                     GLenum type,
154                     const GLvoid* pixels))
155 COGL_EXT_FUNCTION (void, glTexParameterfv,
156                    (GLenum target, GLenum pname, const GLfloat* params))
157 COGL_EXT_FUNCTION (void, glTexParameteri,
158                    (GLenum target, GLenum pname, GLint param))
159 COGL_EXT_FUNCTION (void, glTexParameteriv,
160                    (GLenum target, GLenum pname, const GLint* params))
161 COGL_EXT_FUNCTION (void, glGetTexParameterfv,
162                    (GLenum target, GLenum pname, GLfloat* params))
163 COGL_EXT_FUNCTION (void, glGetTexParameteriv,
164                    (GLenum target, GLenum pname, GLint* params))
165 COGL_EXT_FUNCTION (void, glTexSubImage2D,
166                    (GLenum target,
167                     GLint level,
168                     GLint xoffset,
169                     GLint yoffset,
170                     GLsizei width,
171                     GLsizei height,
172                     GLenum format,
173                     GLenum type,
174                     const GLvoid* pixels))
175 COGL_EXT_FUNCTION (void, glCopyTexImage2D,
176                    (GLenum target,
177                     GLint level,
178                     GLenum internalformat,
179                     GLint x,
180                     GLint y,
181                     GLsizei width,
182                     GLsizei height,
183                     GLint border))
184 COGL_EXT_FUNCTION (void, glViewport,
185                    (GLint x, GLint y, GLsizei width, GLsizei height))
186 COGL_EXT_FUNCTION (GLboolean, glIsEnabled, (GLenum cap))
187 COGL_EXT_FUNCTION (void, glLineWidth, (GLfloat width))
188 COGL_EXT_FUNCTION (void, glPolygonOffset, (GLfloat factor, GLfloat units))
189 COGL_EXT_END ()