4 * An object oriented GL/GLES Abstraction/Utility Layer
6 * Copyright (C) 2009, 2011 Intel Corporation.
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.
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.
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/>.
24 /* This is included multiple times with different definitions for
25 * these macros. The macros are given the following arguments:
29 * @name: a unique symbol name for this feature
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
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
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.
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.
48 * @extension_names: A list of extension names to try. If any of these
49 * extensions match then it will be used.
52 /* The functions in this file are part of the core GL,GLES1 and GLES2 apis */
53 #include "cogl-core-functions.h"
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"
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"
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"
67 /* These are fixed-function APIs core to GL and GLES1 */
68 #include "cogl-fixed-functions.h"
70 /* These are GLSL shader APIs core to GL 2.0 and GLES2 */
71 #include "cogl-glsl-functions.h"
73 /* These are the core GL functions which are only available in big
75 COGL_EXT_BEGIN (only_in_big_gl,
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,
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,
96 /* GLES doesn't support mapping buffers in core so this has to be a
98 COGL_EXT_BEGIN (map_vbos, 1, 5,
99 0, /* not in GLES core */
101 "vertex_buffer_object\0mapbuffer\0")
102 COGL_EXT_FUNCTION (void *, glMapBuffer,
105 COGL_EXT_FUNCTION (GLboolean, glUnmapBuffer,
109 COGL_EXT_BEGIN (texture_3d, 1, 2,
110 0, /* not in either GLES */
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,
126 GLenum type, const GLvoid *pixels))
131 COGL_EXT_BEGIN (offscreen_blit, 255, 255,
132 0, /* not in either GLES */
134 "framebuffer_blit\0")
135 COGL_EXT_FUNCTION (void, glBlitFramebuffer,
148 /* ARB_fragment_program */
149 COGL_EXT_BEGIN (arbfp, 255, 255,
150 0, /* not in either GLES */
152 "fragment_program\0")
153 COGL_EXT_FUNCTION (void, glGenPrograms,
156 COGL_EXT_FUNCTION (void, glDeletePrograms,
159 COGL_EXT_FUNCTION (void, glBindProgram,
162 COGL_EXT_FUNCTION (void, glProgramString,
166 const void *program))
167 COGL_EXT_FUNCTION (void, glProgramLocalParameter4fv,
173 COGL_EXT_BEGIN (EGL_image, 255, 255,
174 0, /* not in either GLES */
177 COGL_EXT_FUNCTION (void, glEGLImageTargetTexture2D,
179 GLeglImageOES image))
180 COGL_EXT_FUNCTION (void, glEGLImageTargetRenderbufferStorage,
182 GLeglImageOES image))
185 COGL_EXT_BEGIN (framebuffer_discard, 255, 255,
186 0, /* not in either GLES */
188 "framebuffer_discard\0")
189 COGL_EXT_FUNCTION (void, glDiscardFramebuffer,
191 GLsizei numAttachments,
192 const GLenum *attachments))
195 COGL_EXT_BEGIN (IMG_multisampled_render_to_texture, 255, 255,
196 0, /* not in either GLES */
198 "IMG_multisampled_render_to_texture\0")
199 COGL_EXT_FUNCTION (void, glRenderbufferStorageMultisampleIMG,
202 GLenum internal_format,
205 COGL_EXT_FUNCTION (void, glFramebufferTexture2DMultisampleIMG,