Commit 2023e0bb authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Partial support for Mesa GL ES v1 and v2

v1 does not work and v2 does not compile but nevermind...
parent 3c762ac1
...@@ -3247,8 +3247,11 @@ AC_SUBST([GL_CFLAGS]) ...@@ -3247,8 +3247,11 @@ AC_SUBST([GL_CFLAGS])
AC_SUBST([GL_LIBS]) AC_SUBST([GL_LIBS])
dnl dnl
dnl EGL dnl OpenGL
dnl dnl
PKG_ENABLE_MODULES_VLC([GL], [], [gl], [OpenGL support], [auto])
PKG_ENABLE_MODULES_VLC([GLES1], [], [glesv1_cm], [OpenGL ES v1 support], [auto])
PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [auto])
PKG_ENABLE_MODULES_VLC([EGL], [], [egl], [EGL support], [auto]) PKG_ENABLE_MODULES_VLC([EGL], [], [egl], [EGL support], [auto])
dnl dnl
......
...@@ -15,16 +15,33 @@ SOURCES_yuv = yuv.c ...@@ -15,16 +15,33 @@ SOURCES_yuv = yuv.c
SOURCES_vout_macosx = macosx.m opengl.h opengl.c SOURCES_vout_macosx = macosx.m opengl.h opengl.c
SOURCES_vout_ios = ios.m opengl.h opengl.c SOURCES_vout_ios = ios.m opengl.h opengl.c
### OpenGL ### ### OpenGL ###
# TODO: merge all three source files (?) # TODO: merge all three source files (?)
libopengl_plugin_la_SOURCES = \ libgles2_plugin_la_SOURCES = opengl.c opengl.h gl.c
opengl.c opengl.h \ libgles2_plugin_la_CFLAGS = $(AM_CFLAGS) $(GLES2_CFLAGS) -DUSE_OPENGL_ES=2
gl.c libgles2_plugin_la_LIBADD = $(AM_LIBADD) $(GLES2_LIBS)
libopengl_plugin_la_CFLAGS = $(AM_CFLAGS) $(GL_CFLAGS) libgles2_plugin_la_DEPENDENCIES =
libopengl_plugin_la_LIBADD = $(AM_LIBADD) $(GL_LIBS)
libopengl_plugin_la_DEPENDENCIES = libgles1_plugin_la_SOURCES = opengl.c opengl.h gl.c
EXTRA_LTLIBRARIES += libopengl_plugin.la libgles1_plugin_la_CFLAGS = $(AM_CFLAGS) $(GLES1_CFLAGS) -DUSE_OPENGL_ES=1
libvlc_LTLIBRARIES += $(LTLIBopengl) libgles1_plugin_la_LIBADD = $(AM_LIBADD) $(GLES1_LIBS)
libgles1_plugin_la_DEPENDENCIES =
libgl_plugin_la_SOURCES = opengl.c opengl.h gl.c
libgl_plugin_la_CFLAGS = $(AM_CFLAGS) $(GL_CFLAGS)
libgl_plugin_la_LIBADD = $(AM_LIBADD) $(GL_LIBS)
libgl_plugin_la_DEPENDENCIES =
EXTRA_LTLIBRARIES += \
libgles2_plugin.la \
libgles1_plugin.la \
libgl_plugin.la
libvlc_LTLIBRARIES += \
$(LTLIBgles2) \
$(LTLIBgles1) \
$(LTLIBgl)
### XCB ### ### XCB ###
libxcb_x11_plugin_la_SOURCES = \ libxcb_x11_plugin_la_SOURCES = \
......
...@@ -32,13 +32,23 @@ ...@@ -32,13 +32,23 @@
#include "opengl.h" #include "opengl.h"
// Define USE_OPENGL_ES to the GL ES Version you want to select // Define USE_OPENGL_ES to the GL ES Version you want to select
#if USE_OPENGL_ES == 1 #if !defined (__APPLE__)
# include <OpenGLES/ES1/glext.h> # if USE_OPENGL_ES == 2
#elif USE_OPENGL_ES == 2 # include <GLES2/gl2ext.h>
# include <OpenGLES/ES2/glext.h> # elif USE_OPENGL_ES == 1
#elif defined(__APPLE__) # include <GLES/glext.h>
# define MACOS_OPENGL //# else
# include <OpenGL/glext.h> //# include <GL/glext.h>
# endif
#else
# if USE_OPENGL_ES == 2
# include <OpenGLES/ES2/gl.h>
# elif USE_OPENGL_ES == 1
# include <OpenGLES/ES1/gl.h>
# else
# define MACOS_OPENGL
# include <OpenGL/glext.h>
# endif
#endif #endif
#ifndef YCBCR_MESA #ifndef YCBCR_MESA
......
...@@ -36,17 +36,25 @@ ...@@ -36,17 +36,25 @@
#define VLCGL_TEXTURE_COUNT 1 #define VLCGL_TEXTURE_COUNT 1
#if USE_OPENGL_ES == 1 #if !defined (__APPLE__)
# include <OpenGLES/ES1/gl.h> # if USE_OPENGL_ES == 2
#elif USE_OPENGL_ES == 2 # include <GLES2/gl2.h>
# include <OpenGLES/ES2/gl.h> # elif USE_OPENGL_ES == 1
#elif defined(__APPLE__) # include <GLES/gl.h>
# define MACOS_OPENGL # else
# include <OpenGL/gl.h> # include <GL/gl.h>
# undef VLCGL_TEXTURE_COUNT # endif
# define VLCGL_TEXTURE_COUNT 2
#else #else
# include <GL/gl.h> # if USE_OPENGL_ES == 2
# include <OpenGLES/ES2/gl.h>
# elif USE_OPENGL_ES == 1
# include <OpenGLES/ES1/gl.h>
# else
# define MACOS_OPENGL
# include <OpenGL/gl.h>
# undef VLCGL_TEXTURE_COUNT
# define VLCGL_TEXTURE_COUNT 2
# endif
#endif #endif
typedef struct { typedef struct {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment