| 1 | /* |
| 2 | * GStreamer |
| 3 | * Copyright (C) 2012 Matthew Waters <ystreet00@gmail.com> |
| 4 | * |
| 5 | * This library is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU Library General Public |
| 7 | * License as published by the Free Software Foundation; either |
| 8 | * version 2 of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This library is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * Library General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU Library General Public |
| 16 | * License along with this library; if not, write to the |
| 17 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, |
| 18 | * Boston, MA 02110-1301, USA. |
| 19 | */ |
| 20 | |
| 21 | #ifndef __GST_GL_FUNCS_H__ |
| 22 | #define __GST_GL_FUNCS_H__ |
| 23 | |
| 24 | #include <gst/gl/gstglconfig.h> |
| 25 | |
| 26 | /* This mimic GCC behaviour with system headers files even if GL headers may |
| 27 | * not be in the system header path. */ |
| 28 | #ifdef __GNUC__ |
| 29 | #pragma GCC diagnostic push |
| 30 | #pragma GCC diagnostic ignored "-Wredundant-decls" |
| 31 | #endif |
| 32 | |
| 33 | /* OpenGL 2.0 for Embedded Systems */ |
| 34 | #if GST_GL_HAVE_GLES2 |
| 35 | # if GST_GL_HAVE_PLATFORM_EAGL |
| 36 | # include <OpenGLES/ES2/gl.h> |
| 37 | # include <OpenGLES/ES2/glext.h> |
| 38 | # else |
| 39 | # if GST_GL_HAVE_GLES3 |
| 40 | # include <GLES3/gl3.h> |
| 41 | # if GST_GL_HAVE_GLES3EXT3_H |
| 42 | # include <GLES3/gl3ext.h> |
| 43 | # endif |
| 44 | # include <GLES2/gl2ext.h> |
| 45 | # else |
| 46 | # include <GLES2/gl2.h> |
| 47 | # include <GLES2/gl2ext.h> |
| 48 | # endif |
| 49 | # endif |
| 50 | # if !GST_GL_HAVE_OPENGL |
| 51 | # include <gst/gl/glprototypes/gstgl_gles2compat.h> |
| 52 | # endif |
| 53 | #endif |
| 54 | |
| 55 | /* OpenGL for desktop systems */ |
| 56 | #if GST_GL_HAVE_OPENGL |
| 57 | # ifdef __APPLE__ |
| 58 | # if !defined(MAC_OS_X_VERSION_MAX_ALLOWED) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1014 |
| 59 | # define GL_SILENCE_DEPRECATION |
| 60 | # endif |
| 61 | # include <OpenGL/OpenGL.h> |
| 62 | # include <OpenGL/gl.h> |
| 63 | # if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 |
| 64 | # define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED |
| 65 | # include <OpenGL/gl3.h> |
| 66 | # endif |
| 67 | # else |
| 68 | # if defined(_MSC_VER) |
| 69 | # include <windows.h> |
| 70 | # endif |
| 71 | # include <GL/gl.h> |
| 72 | # if defined(__WIN32__) || defined(_WIN32) |
| 73 | # include <GL/glext.h> |
| 74 | # endif |
| 75 | # endif |
| 76 | #endif |
| 77 | |
| 78 | #ifdef __GNUC__ |
| 79 | #pragma GCC diagnostic pop |
| 80 | #endif |
| 81 | |
| 82 | #if defined(WINAPI) |
| 83 | #define GSTGLAPI WINAPI |
| 84 | #else |
| 85 | #define GSTGLAPI |
| 86 | #endif |
| 87 | #include <gst/gl/glprototypes/gstgl_compat.h> |
| 88 | |
| 89 | #include <gst/gst.h> |
| 90 | |
| 91 | G_BEGIN_DECLS |
| 92 | |
| 93 | #define GST_GL_EXT_BEGIN(name, gl_availability, min_gl, maj_gl, gles_maj, \ |
| 94 | gles_min, ext_suf, ext_name) |
| 95 | #define GST_GL_EXT_FUNCTION(ret, name, args) \ |
| 96 | ret (GSTGLAPI *name) args; |
| 97 | #define GST_GL_EXT_END() |
| 98 | |
| 99 | struct _GstGLFuncs |
| 100 | { |
| 101 | #include <gst/gl/glprototypes/all_functions.h> |
| 102 | gpointer padding[GST_PADDING_LARGE*6-2]; |
| 103 | }; |
| 104 | |
| 105 | #undef GST_GL_EXT_BEGIN |
| 106 | #undef GST_GL_EXT_FUNCTION |
| 107 | #undef GST_GL_EXT_END |
| 108 | |
| 109 | G_END_DECLS |
| 110 | |
| 111 | #endif /* __GST_GL_API_H__ */ |
| 112 | |