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 #  include <OpenGL/OpenGL.h>
59 #  include <OpenGL/gl.h>
60 #  if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
61 #   define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
62 #   include <OpenGL/gl3.h>
63 #  endif
64 # else
65 #  if defined(_MSC_VER)
66 #   include <windows.h>
67 #  endif
68 #  include <GL/gl.h>
69 #  if defined(__WIN32__) || defined(_WIN32)
70 #   include <GL/glext.h>
71 #  endif
72 # endif
73 #endif
74 
75 #ifdef __GNUC__
76 #pragma GCC diagnostic pop
77 #endif
78 
79 #if defined(WINAPI)
80 #define GSTGLAPI WINAPI
81 #else
82 #define GSTGLAPI
83 #endif
84 #include <gst/gl/glprototypes/gstgl_compat.h>
85 
86 #include <gst/gst.h>
87 
88 G_BEGIN_DECLS
89 
90 #define GST_GL_EXT_BEGIN(name, gl_availability, min_gl, maj_gl, gles_maj, \
91     gles_min, ext_suf, ext_name)
92 #define GST_GL_EXT_FUNCTION(ret, name, args) \
93   ret (GSTGLAPI *name) args;
94 #define GST_GL_EXT_END()
95 
96 struct _GstGLFuncs
97 {
98 #include <gst/gl/glprototypes/all_functions.h>
99   gpointer padding[GST_PADDING_LARGE*6];
100 };
101 
102 #undef GST_GL_EXT_BEGIN
103 #undef GST_GL_EXT_FUNCTION
104 #undef GST_GL_EXT_END
105 
106 G_END_DECLS
107 
108 #endif /* __GST_GL_API_H__ */
109