[vlc-commits] Partial support for Mesa GL ES v1 and v2

Rémi Denis-Courmont git at videolan.org
Sat Feb 19 16:11:13 CET 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Feb 19 17:09:46 2011 +0200| [2023e0bb97c93c67ba1e7be4b2b705d1bd731aa3] | committer: Rémi Denis-Courmont

Partial support for Mesa GL ES v1 and v2

v1 does not work and v2 does not compile but nevermind...

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2023e0bb97c93c67ba1e7be4b2b705d1bd731aa3
---

 configure.ac                    |    5 ++++-
 modules/video_output/Modules.am |   33 +++++++++++++++++++++++++--------
 modules/video_output/opengl.c   |   24 +++++++++++++++++-------
 modules/video_output/opengl.h   |   28 ++++++++++++++++++----------
 4 files changed, 64 insertions(+), 26 deletions(-)

diff --git a/configure.ac b/configure.ac
index c5c82a9..12f297a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3247,8 +3247,11 @@ AC_SUBST([GL_CFLAGS])
 AC_SUBST([GL_LIBS])
 
 dnl
-dnl  EGL
+dnl  OpenGL
 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])
 
 dnl
diff --git a/modules/video_output/Modules.am b/modules/video_output/Modules.am
index 66e2707..ce7c0c8 100644
--- a/modules/video_output/Modules.am
+++ b/modules/video_output/Modules.am
@@ -15,16 +15,33 @@ SOURCES_yuv = yuv.c
 SOURCES_vout_macosx = macosx.m opengl.h opengl.c
 SOURCES_vout_ios = ios.m opengl.h opengl.c
 
+
 ### OpenGL ###
 # TODO: merge all three source files (?)
-libopengl_plugin_la_SOURCES = \
-	opengl.c opengl.h \
-	gl.c
-libopengl_plugin_la_CFLAGS = $(AM_CFLAGS) $(GL_CFLAGS)
-libopengl_plugin_la_LIBADD = $(AM_LIBADD) $(GL_LIBS)
-libopengl_plugin_la_DEPENDENCIES =
-EXTRA_LTLIBRARIES += libopengl_plugin.la
-libvlc_LTLIBRARIES += $(LTLIBopengl)
+libgles2_plugin_la_SOURCES = opengl.c opengl.h gl.c
+libgles2_plugin_la_CFLAGS = $(AM_CFLAGS) $(GLES2_CFLAGS) -DUSE_OPENGL_ES=2
+libgles2_plugin_la_LIBADD = $(AM_LIBADD) $(GLES2_LIBS)
+libgles2_plugin_la_DEPENDENCIES =
+
+libgles1_plugin_la_SOURCES = opengl.c opengl.h gl.c
+libgles1_plugin_la_CFLAGS = $(AM_CFLAGS) $(GLES1_CFLAGS) -DUSE_OPENGL_ES=1
+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 ###
 libxcb_x11_plugin_la_SOURCES = \
diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c
index 5257050..06bbfc2 100644
--- a/modules/video_output/opengl.c
+++ b/modules/video_output/opengl.c
@@ -32,13 +32,23 @@
 #include "opengl.h"
 // Define USE_OPENGL_ES to the GL ES Version you want to select
 
-#if USE_OPENGL_ES == 1
-# include <OpenGLES/ES1/glext.h>
-#elif USE_OPENGL_ES == 2
-# include <OpenGLES/ES2/glext.h>
-#elif defined(__APPLE__)
-# define MACOS_OPENGL
-# include <OpenGL/glext.h>
+#if !defined (__APPLE__)
+# if USE_OPENGL_ES == 2
+#  include <GLES2/gl2ext.h>
+# elif USE_OPENGL_ES == 1
+#  include <GLES/glext.h>
+//# else
+//# 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
 
 #ifndef YCBCR_MESA
diff --git a/modules/video_output/opengl.h b/modules/video_output/opengl.h
index 6423788..c8ab7de 100644
--- a/modules/video_output/opengl.h
+++ b/modules/video_output/opengl.h
@@ -36,17 +36,25 @@
 
 #define VLCGL_TEXTURE_COUNT 1
 
-#if USE_OPENGL_ES == 1
-# include <OpenGLES/ES1/gl.h>
-#elif USE_OPENGL_ES == 2
-# include <OpenGLES/ES2/gl.h>
-#elif defined(__APPLE__)
-# define MACOS_OPENGL
-# include <OpenGL/gl.h>
-# undef VLCGL_TEXTURE_COUNT
-# define VLCGL_TEXTURE_COUNT 2
+#if !defined (__APPLE__)
+# if USE_OPENGL_ES == 2
+#  include <GLES2/gl2.h>
+# elif USE_OPENGL_ES == 1
+#  include <GLES/gl.h>
+# else
+#  include <GL/gl.h>
+# endif
 #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
 
 typedef struct {



More information about the vlc-commits mailing list