"Initial commit to Gerrit"
[profile/ivi/cogl.git] / cogl / gl-prototypes / cogl-in-gles-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 (only_in_both_gles,
53                 255, 255,
54                 COGL_EXT_IN_GLES |
55                 COGL_EXT_IN_GLES2,
56                 "\0",
57                 "\0")
58 COGL_EXT_FUNCTION (void, glDepthRangef,
59                    (GLfloat near_val, GLfloat far_val))
60 COGL_EXT_FUNCTION (void, glClearDepthf,
61                    (GLclampf depth))
62 COGL_EXT_END ()
63
64 COGL_EXT_BEGIN (only_in_both_gles_and_gl_1_3,
65                 1, 3,
66                 COGL_EXT_IN_GLES |
67                 COGL_EXT_IN_GLES2,
68                 "\0",
69                 "\0")
70 COGL_EXT_FUNCTION (void, glCompressedTexImage2D,
71                    (GLenum target,
72                     GLint level,
73                     GLenum internalformat,
74                     GLsizei width,
75                     GLsizei height,
76                     GLint border,
77                     GLsizei imageSize,
78                     const GLvoid* data))
79 COGL_EXT_FUNCTION (void, glCompressedTexSubImage2D,
80                    (GLenum target,
81                     GLint level,
82                     GLint xoffset,
83                     GLint yoffset,
84                     GLsizei width,
85                     GLsizei height,
86                     GLenum format,
87                     GLsizei imageSize,
88                     const GLvoid* data))
89 COGL_EXT_FUNCTION (void, glSampleCoverage,
90                    (GLclampf value, GLboolean invert))
91 COGL_EXT_END ()
92
93 COGL_EXT_BEGIN (only_in_both_gles_and_gl_1_5,
94                 1, 5,
95                 COGL_EXT_IN_GLES |
96                 COGL_EXT_IN_GLES2,
97                 "\0",
98                 "\0")
99 COGL_EXT_FUNCTION (void, glGetBufferParameteriv,
100                    (GLenum target, GLenum pname, GLint* params))
101 COGL_EXT_END ()
102
103 COGL_EXT_BEGIN (vbos, 1, 5,
104                 COGL_EXT_IN_GLES |
105                 COGL_EXT_IN_GLES2,
106                 "ARB\0",
107                 "vertex_buffer_object\0")
108 COGL_EXT_FUNCTION (void, glGenBuffers,
109                    (GLuint               n,
110                     GLuint              *buffers))
111 COGL_EXT_FUNCTION (void, glBindBuffer,
112                    (GLenum               target,
113                     GLuint               buffer))
114 COGL_EXT_FUNCTION (void, glBufferData,
115                    (GLenum               target,
116                     GLsizeiptr           size,
117                     const GLvoid                *data,
118                     GLenum               usage))
119 COGL_EXT_FUNCTION (void, glBufferSubData,
120                    (GLenum               target,
121                     GLintptr             offset,
122                     GLsizeiptr           size,
123                     const GLvoid                *data))
124 COGL_EXT_FUNCTION (void, glDeleteBuffers,
125                    (GLsizei              n,
126                     const GLuint                *buffers))
127 COGL_EXT_FUNCTION (GLboolean, glIsBuffer,
128                    (GLuint               buffer))
129 COGL_EXT_END ()
130
131 /* Available in GL 1.3, the multitexture extension or GLES. These are
132    required */
133 COGL_EXT_BEGIN (multitexture_part0, 1, 3,
134                 COGL_EXT_IN_GLES |
135                 COGL_EXT_IN_GLES2,
136                 "ARB\0",
137                 "multitexture\0")
138 COGL_EXT_FUNCTION (void, glActiveTexture,
139                    (GLenum                texture))
140 COGL_EXT_END ()
141