summaryrefslogtreecommitdiff
path: root/gst-libs/gst/gl/glprototypes/base.h
blob: 8394a387280e1d657dc2af10926902930940bbac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
/*
 * GStreamer
 * Copyright (C) 2012 Matthew Waters <ystreet00@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */
/*
 * Cogl
 *
 * An object oriented GL/GLES Abstraction/Utility Layer
 *
 * Copyright (C) 2009, 2011 Intel Corporation.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
 */


/* These are the core GL functions which we assume will always be
   available */
GST_GL_EXT_BEGIN (core,
                  GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
                  GST_GL_API_GLES1 | GST_GL_API_GLES2,
                  1, 0,
                  1, 0,
                  "\0",
                  "\0")
GST_GL_EXT_FUNCTION (void, BindTexture,
                     (GLenum target, GLuint texture))
GST_GL_EXT_FUNCTION (void, BlendFunc,
                     (GLenum sfactor, GLenum dfactor))
GST_GL_EXT_FUNCTION (void, Clear,
                     (GLbitfield mask))
GST_GL_EXT_FUNCTION (void, ClearColor,
                     (GLclampf red,
                      GLclampf green,
                      GLclampf blue,
                      GLclampf alpha))
GST_GL_EXT_FUNCTION (void, ClearStencil,
                     (GLint s))
GST_GL_EXT_FUNCTION (void, ColorMask,
                     (GLboolean red,
                      GLboolean green,
                      GLboolean blue,
                      GLboolean alpha))
GST_GL_EXT_FUNCTION (void, CopyTexSubImage2D,
                     (GLenum target,
                      GLint level,
                      GLint xoffset,
                      GLint yoffset,
                      GLint x,
                      GLint y,
                      GLsizei width,
                      GLsizei height))
GST_GL_EXT_FUNCTION (void, DeleteTextures,
                     (GLsizei n, const GLuint* textures))
GST_GL_EXT_FUNCTION (void, DepthFunc,
                     (GLenum func))
GST_GL_EXT_FUNCTION (void, DepthMask,
                     (GLboolean flag))
GST_GL_EXT_FUNCTION (void, Disable,
                     (GLenum cap))
GST_GL_EXT_FUNCTION (void, DrawArrays,
                     (GLenum mode, GLint first, GLsizei count))
GST_GL_EXT_FUNCTION (void, DrawElements,
                     (GLenum mode,
                      GLsizei count,
                      GLenum type,
                      const GLvoid* indices))
GST_GL_EXT_FUNCTION (void, Enable,
                     (GLenum cap))
GST_GL_EXT_FUNCTION (void, Finish,
                     (void))
GST_GL_EXT_FUNCTION (void, Flush,
                     (void))
GST_GL_EXT_FUNCTION (void, FrontFace,
                     (GLenum mode))
GST_GL_EXT_FUNCTION (void, CullFace,
                     (GLenum mode))
GST_GL_EXT_FUNCTION (void, GenTextures,
                     (GLsizei n, GLuint* textures))
GST_GL_EXT_FUNCTION (GLenum, GetError,
                     (void))
GST_GL_EXT_FUNCTION (void, GetIntegerv,
                     (GLenum pname, GLint* params))
GST_GL_EXT_FUNCTION (void, GetBooleanv,
                     (GLenum pname, GLboolean* params))
GST_GL_EXT_FUNCTION (void, GetFloatv,
                     (GLenum pname, GLfloat* params))
GST_GL_EXT_FUNCTION (const GLubyte*, GetString,
                     (GLenum name))
GST_GL_EXT_FUNCTION (void, Hint,
                     (GLenum target, GLenum mode))
GST_GL_EXT_FUNCTION (GLboolean, IsTexture,
                     (GLuint texture))
GST_GL_EXT_FUNCTION (void, PixelStorei,
                     (GLenum pname, GLint param))
GST_GL_EXT_FUNCTION (void, ReadPixels,
                     (GLint x,
                      GLint y,
                      GLsizei width,
                      GLsizei height,
                      GLenum format,
                      GLenum type,
                      GLvoid* pixels))
GST_GL_EXT_FUNCTION (void, Scissor,
                     (GLint x, GLint y, GLsizei width, GLsizei height))
GST_GL_EXT_FUNCTION (void, StencilFunc,
                     (GLenum func, GLint ref, GLuint mask))
GST_GL_EXT_FUNCTION (void, StencilMask,
                     (GLuint mask))
GST_GL_EXT_FUNCTION (void, StencilOp,
                     (GLenum fail, GLenum zfail, GLenum zpass))
GST_GL_EXT_FUNCTION (void, TexImage2D,
                     (GLenum target,
                      GLint level,
                      GLint internalformat,
                      GLsizei width,
                      GLsizei height,
                      GLint border,
                      GLenum format,
                      GLenum type,
                      const GLvoid* pixels))
GST_GL_EXT_FUNCTION (void, TexParameterfv,
                     (GLenum target, GLenum pname, const GLfloat* params))
GST_GL_EXT_FUNCTION (void, TexParameteri,
                     (GLenum target, GLenum pname, GLint param))
GST_GL_EXT_FUNCTION (void, TexParameteriv,
                     (GLenum target, GLenum pname, const GLint* params))
GST_GL_EXT_FUNCTION (void, GetTexParameterfv,
                     (GLenum target, GLenum pname, GLfloat* params))
GST_GL_EXT_FUNCTION (void, GetTexParameteriv,
                     (GLenum target, GLenum pname, GLint* params))
GST_GL_EXT_FUNCTION (void, TexSubImage2D,
                     (GLenum target,
                      GLint level,
                      GLint xoffset,
                      GLint yoffset,
                      GLsizei width,
                      GLsizei height,
                      GLenum format,
                      GLenum type,
                      const GLvoid* pixels))
GST_GL_EXT_FUNCTION (void, CopyTexImage2D,
                     (GLenum target,
                      GLint level,
                      GLenum internalformat,
                      GLint x,
                      GLint y,
                      GLsizei width,
                      GLsizei height,
                      GLint border))
GST_GL_EXT_FUNCTION (void, Viewport,
                     (GLint x, GLint y, GLsizei width, GLsizei height))
GST_GL_EXT_FUNCTION (GLboolean, IsEnabled, (GLenum cap))
GST_GL_EXT_FUNCTION (void, LineWidth, (GLfloat width))
GST_GL_EXT_FUNCTION (void, PolygonOffset, (GLfloat factor, GLfloat units))
GST_GL_EXT_FUNCTION (void, TexParameterf,
                     (GLenum target,
                      GLenum pname,
                      GLfloat param))
GST_GL_EXT_END ()

GST_GL_EXT_BEGIN (texture_3d,
                  GST_GL_API_OPENGL | GST_GL_API_OPENGL3,
                  1, 2,
                  255, 255, /* not in either GLES */
                  "OES\0",
                  "texture_3D\0")
GST_GL_EXT_FUNCTION (void, TexImage3D,
                     (GLenum target, GLint level,
                      GLint internalFormat,
                      GLsizei width, GLsizei height,
                      GLsizei depth, GLint border,
                      GLenum format, GLenum type,
                      const GLvoid *pixels))
GST_GL_EXT_FUNCTION (void, TexSubImage3D,
                     (GLenum target, GLint level,
                      GLint xoffset, GLint yoffset,
                      GLint zoffset, GLsizei width,
                      GLsizei height, GLsizei depth,
                      GLenum format,
                      GLenum type, const GLvoid *pixels))
GST_GL_EXT_END ()

GST_GL_EXT_BEGIN (only_in_both_gles_and_gl_1_3,
                  GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
                  GST_GL_API_GLES1 | GST_GL_API_GLES2,
                  1, 3,
                  1, 0,
                  "\0",
                  "\0")
GST_GL_EXT_FUNCTION (void, CompressedTexImage2D,
                     (GLenum target,
                      GLint level,
                      GLenum internalformat,
                      GLsizei width,
                      GLsizei height,
                      GLint border,
                      GLsizei imageSize,
                      const GLvoid* data))
GST_GL_EXT_FUNCTION (void, CompressedTexSubImage2D,
                     (GLenum target,
                      GLint level,
                      GLint xoffset,
                      GLint yoffset,
                      GLsizei width,
                      GLsizei height,
                      GLenum format,
                      GLsizei imageSize,
                      const GLvoid* data))
GST_GL_EXT_FUNCTION (void, SampleCoverage,
                     (GLclampf value, GLboolean invert))
GST_GL_EXT_END ()

GST_GL_EXT_BEGIN (only_in_both_gles_and_gl_1_5,
                  GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
                  GST_GL_API_GLES1 | GST_GL_API_GLES2,
                  1, 5,
                  1, 0,
                  "\0",
                  "\0")
GST_GL_EXT_FUNCTION (void, GetBufferParameteriv,
                     (GLenum target, GLenum pname, GLint* params))
GST_GL_EXT_END ()

GST_GL_EXT_BEGIN (vbos,
                  GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
                  GST_GL_API_GLES1 | GST_GL_API_GLES2,
                  1, 5,
                  1, 0,
                  "ARB\0",
                  "vertex_buffer_object\0")
GST_GL_EXT_FUNCTION (void, GenBuffers,
                     (GLsizei		 n,
                      GLuint		*buffers))
GST_GL_EXT_FUNCTION (void, BindBuffer,
                     (GLenum		 target,
                      GLuint		 buffer))
GST_GL_EXT_FUNCTION (void, BufferData,
                     (GLenum		 target,
                      GLsizeiptr		 size,
                      const GLvoid		*data,
                      GLenum		 usage))
GST_GL_EXT_FUNCTION (void, BufferSubData,
                     (GLenum		 target,
                      GLintptr		 offset,
                      GLsizeiptr		 size,
                      const GLvoid		*data))
GST_GL_EXT_FUNCTION (void, DeleteBuffers,
                     (GLsizei		 n,
                      const GLuint		*buffers))
GST_GL_EXT_FUNCTION (GLboolean, IsBuffer,
                     (GLuint               buffer))
GST_GL_EXT_END ()

/* Available in GL 1.3, the multitexture extension or GLES. These are
   required */
GST_GL_EXT_BEGIN (multitexture_part0,
                  GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
                  GST_GL_API_GLES1 | GST_GL_API_GLES2,
                  1, 3,
                  1, 0,
                  "ARB\0",
                  "multitexture\0")
GST_GL_EXT_FUNCTION (void, ActiveTexture,
                   (GLenum                texture))
GST_GL_EXT_END ()


 /* GLES doesn't support mapping buffers in core so this has to be a
   separate check */
GST_GL_EXT_BEGIN (map_vbos, 
                  GST_GL_API_OPENGL | GST_GL_API_OPENGL3,
                  1, 5,
                  255, 255, /* not in GLES core */
                  "ARB\0OES\0",
                  "vertex_buffer_object\0mapbuffer\0")
GST_GL_EXT_FUNCTION (void *, MapBuffer,
                   (GLenum		 target,
                    GLenum		 access))
GST_GL_EXT_END ()

GST_GL_EXT_BEGIN (unmap_buffer,
                  GST_GL_API_OPENGL | GST_GL_API_OPENGL3 | GST_GL_API_GLES2,
                  1, 5,
                  3, 0,
                  "ARB\0OES\0",
                  "vertex_buffer_object\0mapbuffer\0")
GST_GL_EXT_FUNCTION (GLboolean, UnmapBuffer,
                   (GLenum		 target))
GST_GL_EXT_END ()

GST_GL_EXT_BEGIN (gl3,
                  GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
                  GST_GL_API_GLES2,
                  3, 0,
                  3, 0,
                  "\0",
                  "\0")
GST_GL_EXT_FUNCTION (const GLubyte*, GetStringi,
                     (GLenum name, GLint index))
GST_GL_EXT_FUNCTION (void *, MapBufferRange,
                     (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access))
GST_GL_EXT_END ()