1 /*****************************************************************************
2 * opengl.h: OpenGL vout_display helpers
3 *****************************************************************************
4 * Copyright (C) 2004 the VideoLAN team
5 * Copyright (C) 2009 Laurent Aimar
7 * Authors: Cyril Deguet <asmax@videolan.org>
8 * Gildas Bazin <gbazin@videolan.org>
9 * Eric Petit <titer@m0k.org>
10 * Cedric Cocquebert <cedric.cocquebert@supelec.fr>
11 * Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
26 *****************************************************************************/
28 #include <vlc_common.h>
29 #include <vlc_picture_pool.h>
30 #include <vlc_opengl.h>
33 # include <TargetConditionals.h>
34 # if !TARGET_OS_IPHONE
36 # include <OpenGL/gl.h>
38 # define USE_OPENGL_ES 1
39 # include <OpenGLES/ES1/gl.h>
40 # include <OpenGLES/ES2/gl.h>
41 # include <OpenGLES/ES2/glext.h>
45 // Define USE_OPENGL_ES to the GL ES Version you want to select
47 # define USE_OPENGL_ES 0
50 #if !defined (__APPLE__)
51 # if USE_OPENGL_ES == 2
52 # include <GLES2/gl2.h>
53 # elif USE_OPENGL_ES == 1
63 static inline bool HasExtension(const char *apis, const char *api)
65 size_t apilen = strlen(api);
69 if (!strncmp(apis, api, apilen) && memchr(" ", apis[apilen], 2))
71 apis = strchr(apis, ' ');
76 typedef struct vout_display_opengl_t vout_display_opengl_t;
78 vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
79 const vlc_fourcc_t **subpicture_chromas,
81 void vout_display_opengl_Delete(vout_display_opengl_t *vgl);
83 picture_pool_t *vout_display_opengl_GetPool(vout_display_opengl_t *vgl, unsigned);
85 int vout_display_opengl_Prepare(vout_display_opengl_t *vgl,
86 picture_t *picture, subpicture_t *subpicture);
87 int vout_display_opengl_Display(vout_display_opengl_t *vgl,
88 const video_format_t *source);