diff --git a/gst-libs/gst/gl/glprototypes/all_functions.h b/gst-libs/gst/gl/glprototypes/all_functions.h index ae55a11e30..25b89eaf7f 100644 --- a/gst-libs/gst/gl/glprototypes/all_functions.h +++ b/gst-libs/gst/gl/glprototypes/all_functions.h @@ -18,11 +18,11 @@ * Boston, MA 02110-1301, USA. */ +#include "glprototypes/base.h" +#include "glprototypes/blending.h" +#include "glprototypes/eglimage.h" +#include "glprototypes/fbo.h" +#include "glprototypes/fixedfunction.h" +#include "glprototypes/gles.h" #include "glprototypes/opengl.h" -#include "glprototypes/gles1.h" -#include "glprototypes/gles1gles2.h" -#include "glprototypes/gles1opengl.h" -#include "glprototypes/gles1gles2opengl.h" -#include "glprototypes/gles2.h" -#include "glprototypes/gles2opengl.h" -#include "glprototypes/gles3opengl.h" +#include "glprototypes/shaders.h" diff --git a/gst-libs/gst/gl/glprototypes/gles1gles2opengl.h b/gst-libs/gst/gl/glprototypes/base.h similarity index 90% rename from gst-libs/gst/gl/glprototypes/gles1gles2opengl.h rename to gst-libs/gst/gl/glprototypes/base.h index 63da140b91..b5f4f31e46 100644 --- a/gst-libs/gst/gl/glprototypes/gles1gles2opengl.h +++ b/gst-libs/gst/gl/glprototypes/base.h @@ -178,6 +178,25 @@ GST_GL_EXT_FUNCTION (void, LineWidth, (GLfloat width)) GST_GL_EXT_FUNCTION (void, PolygonOffset, (GLfloat factor, GLfloat units)) GST_GL_EXT_END () +GST_GL_EXT_BEGIN (texture_3d, 1, 2, + 0, /* 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, 1, 3, @@ -270,3 +289,12 @@ GST_GL_EXT_FUNCTION (void *, MapBuffer, GST_GL_EXT_FUNCTION (GLboolean, UnmapBuffer, (GLenum target)) GST_GL_EXT_END () + +GST_GL_EXT_BEGIN (gl3, + 3, 1, + GST_GL_API_GLES3, + "\0", + "\0") +GST_GL_EXT_FUNCTION (const GLubyte*, GetStringi, + (GLenum name, GLint index)) +GST_GL_EXT_END () diff --git a/gst-libs/gst/gl/glprototypes/blending.h b/gst-libs/gst/gl/glprototypes/blending.h new file mode 100644 index 0000000000..1a356c7a26 --- /dev/null +++ b/gst-libs/gst/gl/glprototypes/blending.h @@ -0,0 +1,88 @@ +/* + * GStreamer + * Copyright (C) 2012 Matthew Waters + * + * 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 . + */ + +GST_GL_EXT_BEGIN (blending, 1, 2, + GST_GL_API_GLES2, + "\0", + "\0") +GST_GL_EXT_FUNCTION (void, BlendEquation, + (GLenum mode)) +GST_GL_EXT_FUNCTION (void, BlendColor, + (GLclampf red, + GLclampf green, + GLclampf blue, + GLclampf alpha)) +GST_GL_EXT_END () + +/* Optional, declared in 1.4 or GLES 1.2 */ +GST_GL_EXT_BEGIN (blend_func_separate, 1, 4, + GST_GL_API_GLES2, + "EXT\0", + "blend_func_separate\0") +GST_GL_EXT_FUNCTION (void, BlendFuncSeparate, + (GLenum srcRGB, + GLenum dstRGB, + GLenum srcAlpha, + GLenum dstAlpha)) +GST_GL_EXT_END () + +/* Optional, declared in 2.0 */ +GST_GL_EXT_BEGIN (blend_equation_separate, 2, 0, + GST_GL_API_GLES2, + "EXT\0", + "blend_equation_separate\0") +GST_GL_EXT_FUNCTION (void, BlendEquationSeparate, + (GLenum modeRGB, + GLenum modeAlpha)) +GST_GL_EXT_END () + +/* GL and GLES 2.0 apis */ +GST_GL_EXT_BEGIN (two_point_zero_api, + 2, 0, + GST_GL_API_GLES2, + "\0", + "\0") +GST_GL_EXT_FUNCTION (void, StencilFuncSeparate, + (GLenum face, GLenum func, GLint ref, GLuint mask)) +GST_GL_EXT_FUNCTION (void, StencilMaskSeparate, + (GLenum face, GLuint mask)) +GST_GL_EXT_FUNCTION (void, StencilOpSeparate, + (GLenum face, GLenum fail, GLenum zfail, GLenum zpass)) +GST_GL_EXT_END () diff --git a/gst-libs/gst/gl/glprototypes/gles1gles2.h b/gst-libs/gst/gl/glprototypes/eglimage.h similarity index 84% rename from gst-libs/gst/gl/glprototypes/gles1gles2.h rename to gst-libs/gst/gl/glprototypes/eglimage.h index 9c301a72d4..ae930635d0 100644 --- a/gst-libs/gst/gl/glprototypes/gles1gles2.h +++ b/gst-libs/gst/gl/glprototypes/eglimage.h @@ -38,18 +38,6 @@ * License along with this library. If not, see . */ -GST_GL_EXT_BEGIN (only_in_both_gles, - 255, 255, - GST_GL_API_GLES1 | - GST_GL_API_GLES2, - "\0", - "\0") -GST_GL_EXT_FUNCTION (void, DepthRangef, - (GLfloat near_val, GLfloat far_val)) -GST_GL_EXT_FUNCTION (void, ClearDepthf, - (GLclampf depth)) -GST_GL_EXT_END () - GST_GL_EXT_BEGIN (EGL_image, 255, 255, 0, /* not in either GLES */ "OES\0", diff --git a/gst-libs/gst/gl/glprototypes/fbo.h b/gst-libs/gst/gl/glprototypes/fbo.h new file mode 100644 index 0000000000..b05b91b7cb --- /dev/null +++ b/gst-libs/gst/gl/glprototypes/fbo.h @@ -0,0 +1,144 @@ +/* + * GStreamer + * Copyright (C) 2012 Matthew Waters + * + * 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 . + */ + +GST_GL_EXT_BEGIN (offscreen, + 3, 0, + GST_GL_API_GLES2, + /* for some reason the ARB version of this + extension doesn't have an ARB suffix for the + functions */ + "ARB:\0EXT\0OES\0", + "framebuffer_object\0") +GST_GL_EXT_FUNCTION (void, GenRenderbuffers, + (GLsizei n, + GLuint *renderbuffers)) +GST_GL_EXT_FUNCTION (void, DeleteRenderbuffers, + (GLsizei n, + const GLuint *renderbuffers)) +GST_GL_EXT_FUNCTION (void, BindRenderbuffer, + (GLenum target, + GLuint renderbuffer)) +GST_GL_EXT_FUNCTION (void, RenderbufferStorage, + (GLenum target, + GLenum internalformat, + GLsizei width, + GLsizei height)) +GST_GL_EXT_FUNCTION (void, GenFramebuffers, + (GLsizei n, + GLuint *framebuffers)) +GST_GL_EXT_FUNCTION (void, BindFramebuffer, + (GLenum target, + GLuint framebuffer)) +GST_GL_EXT_FUNCTION (void, FramebufferTexture2D, + (GLenum target, + GLenum attachment, + GLenum textarget, + GLuint texture, + GLint level)) +GST_GL_EXT_FUNCTION (void, FramebufferRenderbuffer, + (GLenum target, + GLenum attachment, + GLenum renderbuffertarget, + GLuint renderbuffer)) +GST_GL_EXT_FUNCTION (GLboolean, IsRenderbuffer, + (GLuint renderbuffer)) +GST_GL_EXT_FUNCTION (GLenum, CheckFramebufferStatus, + (GLenum target)) +GST_GL_EXT_FUNCTION (void, DeleteFramebuffers, + (GLsizei n, + const GLuint *framebuffers)) +GST_GL_EXT_FUNCTION (void, GenerateMipmap, + (GLenum target)) +GST_GL_EXT_FUNCTION (void, GetFramebufferAttachmentParameteriv, + (GLenum target, + GLenum attachment, + GLenum pname, + GLint *params)) +GST_GL_EXT_FUNCTION (void, GetRenderbufferParameteriv, + (GLenum target, + GLenum pname, + GLint *params)) +GST_GL_EXT_FUNCTION (GLboolean, IsFramebuffer, + (GLuint framebuffer)) +GST_GL_EXT_END () + +GST_GL_EXT_BEGIN (offscreen_blit, 255, 255, + 0, /* not in either GLES */ + "EXT\0ANGLE\0", + "framebuffer_blit\0") +GST_GL_EXT_FUNCTION (void, BlitFramebuffer, + (GLint srcX0, + GLint srcY0, + GLint srcX1, + GLint srcY1, + GLint dstX0, + GLint dstY0, + GLint dstX1, + GLint dstY1, + GLbitfield mask, + GLenum filter)) +GST_GL_EXT_END () + +GST_GL_EXT_BEGIN (framebuffer_discard, 255, 255, + 0, /* not in either GLES */ + "EXT\0", + "framebuffer_discard\0") +GST_GL_EXT_FUNCTION (void, DiscardFramebuffer, + (GLenum target, + GLsizei numAttachments, + const GLenum *attachments)) +GST_GL_EXT_END () + + +GST_GL_EXT_BEGIN (read_buffer, 1, 0, + GST_GL_API_GLES3, + "NV\0", + "read_buffer\0") +GST_GL_EXT_FUNCTION (void, ReadBuffer, + (GLenum mode)) +GST_GL_EXT_END () + +GST_GL_EXT_BEGIN (draw_buffers, 2, 1, + GST_GL_API_GLES3, + "ARB\0ATI\0NV\0", + "draw_buffers\0") +GST_GL_EXT_FUNCTION (void, DrawBuffers, + (GLsizei n, const GLenum *bufs)) +GST_GL_EXT_END () diff --git a/gst-libs/gst/gl/glprototypes/gles1opengl.h b/gst-libs/gst/gl/glprototypes/fixedfunction.h similarity index 75% rename from gst-libs/gst/gl/glprototypes/gles1opengl.h rename to gst-libs/gst/gl/glprototypes/fixedfunction.h index ad6230d5bc..759fc166be 100644 --- a/gst-libs/gst/gl/glprototypes/gles1opengl.h +++ b/gst-libs/gst/gl/glprototypes/fixedfunction.h @@ -103,3 +103,36 @@ GST_GL_EXT_FUNCTION (void, PushMatrix, GST_GL_EXT_FUNCTION (void, PopMatrix, (void)) GST_GL_EXT_END () + +/* Eventually we want to remove this category */ +GST_GL_EXT_BEGIN (fixed_function_gl_only, + 0, 0, + 0, + "\0", + "\0") +GST_GL_EXT_FUNCTION (void, PushAttrib, + (GLbitfield mask)) +GST_GL_EXT_FUNCTION (void, PopAttrib, + (void)) +GST_GL_EXT_FUNCTION (void, TexImage1D, + (GLenum target, + GLint level, + GLint internalFormat, + GLsizei width, + GLint border, + GLenum format, + GLenum type, + const GLvoid *data)) +GST_GL_EXT_FUNCTION (void, Rotatef, + (GLfloat angle, GLfloat x, GLfloat y, GLfloat z)) +GST_GL_EXT_FUNCTION (void, Translatef, + (GLfloat x, GLfloat y, GLfloat z)) +GST_GL_EXT_FUNCTION (void, Scalef, + (GLfloat x, GLfloat y, GLfloat z)) +GST_GL_EXT_FUNCTION (void, Lightfv, + (GLenum light, GLenum pname, const GLfloat *params)) +GST_GL_EXT_FUNCTION (void, ColorMaterial, + (GLenum face, GLenum pname)) +GST_GL_EXT_FUNCTION (void, ShadeModel, + (GLenum value)) +GST_GL_EXT_END () diff --git a/gst-libs/gst/gl/glprototypes/gles2.h b/gst-libs/gst/gl/glprototypes/gles.h similarity index 83% rename from gst-libs/gst/gl/glprototypes/gles2.h rename to gst-libs/gst/gl/glprototypes/gles.h index 290d8ebb07..c5074dab9e 100644 --- a/gst-libs/gst/gl/glprototypes/gles2.h +++ b/gst-libs/gst/gl/glprototypes/gles.h @@ -38,6 +38,26 @@ * License along with this library. If not, see . */ +GST_GL_EXT_BEGIN (only_in_both_gles, + 255, 255, + GST_GL_API_GLES1 | + GST_GL_API_GLES2, + "\0", + "\0") +GST_GL_EXT_FUNCTION (void, DepthRangef, + (GLfloat near_val, GLfloat far_val)) +GST_GL_EXT_FUNCTION (void, ClearDepthf, + (GLclampf depth)) +GST_GL_EXT_END () + +GST_GL_EXT_BEGIN (only_in_gles1, + 255, 255, + GST_GL_API_GLES1, + "\0", + "\0") +GST_GL_EXT_FUNCTION (void, ClipPlanef, (GLenum plane, const GLfloat *equation)) +GST_GL_EXT_END () + GST_GL_EXT_BEGIN (gles2_only_api, 255, 255, GST_GL_API_GLES2, diff --git a/gst-libs/gst/gl/glprototypes/gles1.h b/gst-libs/gst/gl/glprototypes/gles1.h deleted file mode 100644 index 6a0d06ec32..0000000000 --- a/gst-libs/gst/gl/glprototypes/gles1.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * GStreamer - * Copyright (C) 2012 Matthew Waters - * - * 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 . - */ - -GST_GL_EXT_BEGIN (only_in_gles1, - 255, 255, - GST_GL_API_GLES1, - "\0", - "\0") -GST_GL_EXT_FUNCTION (void, ClipPlanef, (GLenum plane, const GLfloat *equation)) -GST_GL_EXT_END () diff --git a/gst-libs/gst/gl/glprototypes/gles1_functions.h b/gst-libs/gst/gl/glprototypes/gles1_functions.h deleted file mode 100644 index b9a2377f0b..0000000000 --- a/gst-libs/gst/gl/glprototypes/gles1_functions.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * GStreamer - * Copyright (C) 2012 Matthew Waters - * - * 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. - */ - -#include "glprototypes/gles1.h" -#include "glprototypes/gles1gles2.h" -#include "glprototypes/gles1opengl.h" -#include "glprototypes/gles1gles2opengl.h" diff --git a/gst-libs/gst/gl/glprototypes/gles2_functions.h b/gst-libs/gst/gl/glprototypes/gles2_functions.h deleted file mode 100644 index c13e5071f6..0000000000 --- a/gst-libs/gst/gl/glprototypes/gles2_functions.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * GStreamer - * Copyright (C) 2012 Matthew Waters - * - * 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. - */ - -#include "glprototypes/gles1gles2.h" -#include "glprototypes/gles1gles2opengl.h" -#include "glprototypes/gles2.h" -#include "glprototypes/gles2opengl.h" diff --git a/gst-libs/gst/gl/glprototypes/gles3opengl.h b/gst-libs/gst/gl/glprototypes/gles3opengl.h deleted file mode 100644 index aeee714f57..0000000000 --- a/gst-libs/gst/gl/glprototypes/gles3opengl.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * GStreamer - * Copyright (C) 2012 Matthew Waters - * - * 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. - */ - -/* This lists functions that are unique to GL 2.1 or GLES 3.0 and are - * not in the old GLSL extensions */ -GST_GL_EXT_BEGIN (shaders_2_1, 2, 1, - GST_GL_API_GLES3, - "\0", - "\0") -GST_GL_EXT_FUNCTION (void, UniformMatrix2x3fv, - (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) -GST_GL_EXT_FUNCTION (void, UniformMatrix3x2fv, - (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) -GST_GL_EXT_FUNCTION (void, UniformMatrix2x4fv, - (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) -GST_GL_EXT_FUNCTION (void, UniformMatrix4x2fv, - (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) -GST_GL_EXT_FUNCTION (void, UniformMatrix3x4fv, - (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) -GST_GL_EXT_FUNCTION (void, UniformMatrix4x3fv, - (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) -GST_GL_EXT_END () - -GST_GL_EXT_BEGIN (read_buffer, 1, 0, - GST_GL_API_GLES3, - "NV\0", - "read_buffer\0") -GST_GL_EXT_FUNCTION (void, ReadBuffer, - (GLenum mode)) -GST_GL_EXT_END () - -GST_GL_EXT_BEGIN (draw_buffers, 2, 1, - GST_GL_API_GLES3, - "ARB\0ATI\0NV\0", - "draw_buffers\0") -GST_GL_EXT_FUNCTION (void, DrawBuffers, - (GLsizei n, const GLenum *bufs)) -GST_GL_EXT_END () - diff --git a/gst-libs/gst/gl/glprototypes/opengl.h b/gst-libs/gst/gl/glprototypes/opengl.h index f080ec12a6..a076180567 100644 --- a/gst-libs/gst/gl/glprototypes/opengl.h +++ b/gst-libs/gst/gl/glprototypes/opengl.h @@ -59,116 +59,3 @@ GST_GL_EXT_FUNCTION (void, DepthRange, GST_GL_EXT_FUNCTION (void, DrawBuffer, (GLenum mode)) GST_GL_EXT_END () - -GST_GL_EXT_BEGIN (framebuffer_discard, 255, 255, - 0, /* not in either GLES */ - "EXT\0", - "framebuffer_discard\0") -GST_GL_EXT_FUNCTION (void, DiscardFramebuffer, - (GLenum target, - GLsizei numAttachments, - const GLenum *attachments)) -GST_GL_EXT_END () - -/* These only list functions that come from the old GLSL extensions. - * Functions that are common to the extensions and GLSL 2.0 should - * instead be listed in cogl-glsl-functions.h */ -GST_GL_EXT_BEGIN (shader_objects, 255, 255, - 0, /* not in either GLES */ - "ARB\0", - "shader_objects\0") -GST_GL_EXT_FUNCTION (GLuint, CreateProgramObject, - (void)) -GST_GL_EXT_FUNCTION (GLuint, CreateShaderObject, - (GLenum shaderType)) -GST_GL_EXT_FUNCTION (void, DeleteObject, - (GLuint obj)) -GST_GL_EXT_FUNCTION (void, AttachObject, - (GLuint container, GLuint obj)) -GST_GL_EXT_FUNCTION (void, UseProgramObject, - (GLuint programObj)) -GST_GL_EXT_FUNCTION (void, GetInfoLog, - (GLuint obj, - GLsizei maxLength, - GLsizei *length, - char *infoLog)) -GST_GL_EXT_FUNCTION (void, GetObjectParameteriv, - (GLuint obj, - GLenum pname, - GLint *params)) -GST_GL_EXT_FUNCTION (void, DetachObject, - (GLuint container, GLuint obj)) -GST_GL_EXT_FUNCTION (void, GetAttachedObjects, - (GLuint program, - GLsizei maxcount, - GLsizei* count, - GLuint* shaders)) -GST_GL_EXT_END () - - -/* ARB_fragment_program */ -GST_GL_EXT_BEGIN (arbfp, 255, 255, - 0, /* not in either GLES */ - "ARB\0", - "fragment_program\0") -GST_GL_EXT_FUNCTION (void, GenPrograms, - (GLsizei n, - GLuint *programs)) -GST_GL_EXT_FUNCTION (void, DeletePrograms, - (GLsizei n, - GLuint *programs)) -GST_GL_EXT_FUNCTION (void, BindProgram, - (GLenum target, - GLuint program)) -GST_GL_EXT_FUNCTION (void, ProgramString, - (GLenum target, - GLenum format, - GLsizei len, - const void *program)) -GST_GL_EXT_FUNCTION (void, ProgramLocalParameter4fv, - (GLenum target, - GLuint index, - GLfloat *params)) -GST_GL_EXT_END () - -/* Eventually we want to remove this category */ -GST_GL_EXT_BEGIN (fixed_function_gl_only, - 0, 0, - 0, - "\0", - "\0") -GST_GL_EXT_FUNCTION (void, PushAttrib, - (GLbitfield mask)) -GST_GL_EXT_FUNCTION (void, PopAttrib, - (void)) -GST_GL_EXT_FUNCTION (void, TexImage1D, - (GLenum target, - GLint level, - GLint internalFormat, - GLsizei width, - GLint border, - GLenum format, - GLenum type, - const GLvoid *data)) -GST_GL_EXT_FUNCTION (void, Rotatef, - (GLfloat angle, GLfloat x, GLfloat y, GLfloat z)) -GST_GL_EXT_FUNCTION (void, Translatef, - (GLfloat x, GLfloat y, GLfloat z)) -GST_GL_EXT_FUNCTION (void, Scalef, - (GLfloat x, GLfloat y, GLfloat z)) -GST_GL_EXT_FUNCTION (void, Lightfv, - (GLenum light, GLenum pname, const GLfloat *params)) -GST_GL_EXT_FUNCTION (void, ColorMaterial, - (GLenum face, GLenum pname)) -GST_GL_EXT_FUNCTION (void, ShadeModel, - (GLenum value)) -GST_GL_EXT_END () - -GST_GL_EXT_BEGIN (gl3, - 3, 1, - GST_GL_API_GLES3, /* not in GLES */ - "\0", - "\0") -GST_GL_EXT_FUNCTION (const GLubyte*, GetStringi, - (GLenum name, GLint index)) -GST_GL_EXT_END () diff --git a/gst-libs/gst/gl/glprototypes/opengl_functions.h b/gst-libs/gst/gl/glprototypes/opengl_functions.h deleted file mode 100644 index 296db594f6..0000000000 --- a/gst-libs/gst/gl/glprototypes/opengl_functions.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * GStreamer - * Copyright (C) 2012 Matthew Waters - * - * 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. - */ - -#include "glprototypes/opengl.h" -#include "glprototypes/gles1opengl.h" -#include "glprototypes/gles1gles2opengl.h" -#include "glprototypes/gles2opengl.h" -#include "glprototypes/gles3opengl.h" diff --git a/gst-libs/gst/gl/glprototypes/gles2opengl.h b/gst-libs/gst/gl/glprototypes/shaders.h similarity index 68% rename from gst-libs/gst/gl/glprototypes/gles2opengl.h rename to gst-libs/gst/gl/glprototypes/shaders.h index 7f091884e1..0bc24299aa 100644 --- a/gst-libs/gst/gl/glprototypes/gles2opengl.h +++ b/gst-libs/gst/gl/glprototypes/shaders.h @@ -38,116 +38,6 @@ * License along with this library. If not, see . */ -GST_GL_EXT_BEGIN (offscreen, - 3, 0, - GST_GL_API_GLES2, - /* for some reason the ARB version of this - extension doesn't have an ARB suffix for the - functions */ - "ARB:\0EXT\0OES\0", - "framebuffer_object\0") -GST_GL_EXT_FUNCTION (void, GenRenderbuffers, - (GLsizei n, - GLuint *renderbuffers)) -GST_GL_EXT_FUNCTION (void, DeleteRenderbuffers, - (GLsizei n, - const GLuint *renderbuffers)) -GST_GL_EXT_FUNCTION (void, BindRenderbuffer, - (GLenum target, - GLuint renderbuffer)) -GST_GL_EXT_FUNCTION (void, RenderbufferStorage, - (GLenum target, - GLenum internalformat, - GLsizei width, - GLsizei height)) -GST_GL_EXT_FUNCTION (void, GenFramebuffers, - (GLsizei n, - GLuint *framebuffers)) -GST_GL_EXT_FUNCTION (void, BindFramebuffer, - (GLenum target, - GLuint framebuffer)) -GST_GL_EXT_FUNCTION (void, FramebufferTexture2D, - (GLenum target, - GLenum attachment, - GLenum textarget, - GLuint texture, - GLint level)) -GST_GL_EXT_FUNCTION (void, FramebufferRenderbuffer, - (GLenum target, - GLenum attachment, - GLenum renderbuffertarget, - GLuint renderbuffer)) -GST_GL_EXT_FUNCTION (GLboolean, IsRenderbuffer, - (GLuint renderbuffer)) -GST_GL_EXT_FUNCTION (GLenum, CheckFramebufferStatus, - (GLenum target)) -GST_GL_EXT_FUNCTION (void, DeleteFramebuffers, - (GLsizei n, - const GLuint *framebuffers)) -GST_GL_EXT_FUNCTION (void, GenerateMipmap, - (GLenum target)) -GST_GL_EXT_FUNCTION (void, GetFramebufferAttachmentParameteriv, - (GLenum target, - GLenum attachment, - GLenum pname, - GLint *params)) -GST_GL_EXT_FUNCTION (void, GetRenderbufferParameteriv, - (GLenum target, - GLenum pname, - GLint *params)) -GST_GL_EXT_FUNCTION (GLboolean, IsFramebuffer, - (GLuint framebuffer)) -GST_GL_EXT_END () - -GST_GL_EXT_BEGIN (blending, 1, 2, - GST_GL_API_GLES2, - "\0", - "\0") -GST_GL_EXT_FUNCTION (void, BlendEquation, - (GLenum mode)) -GST_GL_EXT_FUNCTION (void, BlendColor, - (GLclampf red, - GLclampf green, - GLclampf blue, - GLclampf alpha)) -GST_GL_EXT_END () - -/* Optional, declared in 1.4 or GLES 1.2 */ -GST_GL_EXT_BEGIN (blend_func_separate, 1, 4, - GST_GL_API_GLES2, - "EXT\0", - "blend_func_separate\0") -GST_GL_EXT_FUNCTION (void, BlendFuncSeparate, - (GLenum srcRGB, - GLenum dstRGB, - GLenum srcAlpha, - GLenum dstAlpha)) -GST_GL_EXT_END () - -/* Optional, declared in 2.0 */ -GST_GL_EXT_BEGIN (blend_equation_separate, 2, 0, - GST_GL_API_GLES2, - "EXT\0", - "blend_equation_separate\0") -GST_GL_EXT_FUNCTION (void, BlendEquationSeparate, - (GLenum modeRGB, - GLenum modeAlpha)) -GST_GL_EXT_END () - -/* GL and GLES 2.0 apis */ -GST_GL_EXT_BEGIN (two_point_zero_api, - 2, 0, - GST_GL_API_GLES2, - "\0", - "\0") -GST_GL_EXT_FUNCTION (void, StencilFuncSeparate, - (GLenum face, GLenum func, GLint ref, GLuint mask)) -GST_GL_EXT_FUNCTION (void, StencilMaskSeparate, - (GLenum face, GLuint mask)) -GST_GL_EXT_FUNCTION (void, StencilOpSeparate, - (GLenum face, GLenum fail, GLenum zfail, GLenum zpass)) -GST_GL_EXT_END () - /* This lists functions that are unique to GL 2.0 or GLES 2.0 and are * not in the old GLSL extensions */ GST_GL_EXT_BEGIN (shaders_glsl_2_only, 2, 0, @@ -377,40 +267,82 @@ GST_GL_EXT_FUNCTION (void, GetActiveAttrib, GLchar* name)) GST_GL_EXT_END () - -GST_GL_EXT_BEGIN (texture_3d, 1, 2, +/* These only list functions that come from the old GLSL extensions. + * Functions that are common to the extensions and GLSL 2.0 should + * instead be listed in cogl-glsl-functions.h */ +GST_GL_EXT_BEGIN (shader_objects, 255, 255, 0, /* 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)) + "ARB\0", + "shader_objects\0") +GST_GL_EXT_FUNCTION (GLuint, CreateProgramObject, + (void)) +GST_GL_EXT_FUNCTION (GLuint, CreateShaderObject, + (GLenum shaderType)) +GST_GL_EXT_FUNCTION (void, DeleteObject, + (GLuint obj)) +GST_GL_EXT_FUNCTION (void, AttachObject, + (GLuint container, GLuint obj)) +GST_GL_EXT_FUNCTION (void, UseProgramObject, + (GLuint programObj)) +GST_GL_EXT_FUNCTION (void, GetInfoLog, + (GLuint obj, + GLsizei maxLength, + GLsizei *length, + char *infoLog)) +GST_GL_EXT_FUNCTION (void, GetObjectParameteriv, + (GLuint obj, + GLenum pname, + GLint *params)) +GST_GL_EXT_FUNCTION (void, DetachObject, + (GLuint container, GLuint obj)) +GST_GL_EXT_FUNCTION (void, GetAttachedObjects, + (GLuint program, + GLsizei maxcount, + GLsizei* count, + GLuint* shaders)) GST_GL_EXT_END () -GST_GL_EXT_BEGIN (offscreen_blit, 255, 255, +/* ARB_fragment_program */ +GST_GL_EXT_BEGIN (arbfp, 255, 255, 0, /* not in either GLES */ - "EXT\0ANGLE\0", - "framebuffer_blit\0") -GST_GL_EXT_FUNCTION (void, BlitFramebuffer, - (GLint srcX0, - GLint srcY0, - GLint srcX1, - GLint srcY1, - GLint dstX0, - GLint dstY0, - GLint dstX1, - GLint dstY1, - GLbitfield mask, - GLenum filter)) + "ARB\0", + "fragment_program\0") +GST_GL_EXT_FUNCTION (void, GenPrograms, + (GLsizei n, + GLuint *programs)) +GST_GL_EXT_FUNCTION (void, DeletePrograms, + (GLsizei n, + GLuint *programs)) +GST_GL_EXT_FUNCTION (void, BindProgram, + (GLenum target, + GLuint program)) +GST_GL_EXT_FUNCTION (void, ProgramString, + (GLenum target, + GLenum format, + GLsizei len, + const void *program)) +GST_GL_EXT_FUNCTION (void, ProgramLocalParameter4fv, + (GLenum target, + GLuint index, + GLfloat *params)) +GST_GL_EXT_END () + +/* This lists functions that are unique to GL 2.1 or GLES 3.0 and are + * not in the old GLSL extensions */ +GST_GL_EXT_BEGIN (shaders_2_1, 2, 1, + GST_GL_API_GLES3, + "\0", + "\0") +GST_GL_EXT_FUNCTION (void, UniformMatrix2x3fv, + (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) +GST_GL_EXT_FUNCTION (void, UniformMatrix3x2fv, + (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) +GST_GL_EXT_FUNCTION (void, UniformMatrix2x4fv, + (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) +GST_GL_EXT_FUNCTION (void, UniformMatrix4x2fv, + (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) +GST_GL_EXT_FUNCTION (void, UniformMatrix3x4fv, + (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) +GST_GL_EXT_FUNCTION (void, UniformMatrix4x3fv, + (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) GST_GL_EXT_END () diff --git a/gst-libs/gst/gl/gstglapi.h b/gst-libs/gst/gl/gstglapi.h index 0d8ae3c327..28c504cf71 100644 --- a/gst-libs/gst/gl/gstglapi.h +++ b/gst-libs/gst/gl/gstglapi.h @@ -114,22 +114,8 @@ typedef enum typedef struct _GstGLFuncs { -#include - gpointer padding1[GST_PADDING_LARGE]; -#include - gpointer padding2[GST_PADDING_LARGE]; -#include - gpointer padding3[GST_PADDING_LARGE]; -#include - gpointer padding4[GST_PADDING_LARGE*2]; -#include - gpointer padding5[GST_PADDING_LARGE*2]; -#include - gpointer padding6[GST_PADDING_LARGE*2]; -#include - gpointer padding7[GST_PADDING_LARGE*2]; -#include - gpointer padding8[GST_PADDING_LARGE*4]; +#include + gpointer padding[GST_PADDING_LARGE*6]; } GstGLFuncs; #undef GST_GL_EXT_BEGIN