[Scummvm-cvs-logs] SF.net SVN: scummvm:[50908] scummvm/branches/gsoc2010-opengl

vgvgf at users.sourceforge.net vgvgf at users.sourceforge.net
Thu Jul 15 07:04:45 CEST 2010


Revision: 50908
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50908&view=rev
Author:   vgvgf
Date:     2010-07-15 05:04:44 +0000 (Thu, 15 Jul 2010)

Log Message:
-----------
Fixed header for OS X, and added OpenGL feature to configure script. (Patch by clone2727)

Modified Paths:
--------------
    scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/glerrorcheck.cpp
    scummvm/branches/gsoc2010-opengl/configure

Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/glerrorcheck.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/glerrorcheck.cpp	2010-07-15 04:20:21 UTC (rev 50907)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/opengl/glerrorcheck.cpp	2010-07-15 05:04:44 UTC (rev 50908)
@@ -37,7 +37,9 @@
 #undef ARRAYSIZE
 #endif
 
-#ifdef USE_GLES
+#ifdef MACOSX
+#include <gl.h>
+#elif defined(USE_GLES)
 #include <GLES/gl.h>
 #else
 #include <GL/gl.h>

Modified: scummvm/branches/gsoc2010-opengl/configure
===================================================================
--- scummvm/branches/gsoc2010-opengl/configure	2010-07-15 04:20:21 UTC (rev 50907)
+++ scummvm/branches/gsoc2010-opengl/configure	2010-07-15 05:04:44 UTC (rev 50908)
@@ -123,6 +123,7 @@
 _mpeg2=no
 _fluidsynth=auto
 _16bit=auto
+_opengl=auto
 _readline=auto
 # Default option behaviour yes/no
 _debug_build=auto
@@ -676,6 +677,7 @@
   --default-dynamic        make plugins dynamic by default
   --disable-mt32emu        don't enable the integrated MT-32 emulator
   --disable-16bit          don't enable 16bit color support
+  --disable-opengl         don't enable OpenGL (ES)
   --disable-scalers        exclude scalers
   --disable-hq-scalers     exclude HQ2x and HQ3x scalers
   --disable-translation    don't build support for translated messages
@@ -705,6 +707,9 @@
   --with-mpeg2-prefix=DIR  Prefix where libmpeg2 is installed (optional)
   --enable-mpeg2           enable mpeg2 codec for cutscenes [no]
 
+  --with-opengl-prefix=DIR Prefix where OpenGL (ES) is installed (optional)
+  --disable-opengl         disable OpenGL (ES) support [autodetect]
+
   --disable-indeo3         disable Indeo3 decoder [autodetect]
 
   --with-fluidsynth-prefix=DIR  Prefix where libfluidsynth is installed (optional)
@@ -758,6 +763,8 @@
 	--disable-fluidsynth)     _fluidsynth=no  ;;
 	--enable-readline)        _readline=yes   ;;
 	--disable-readline)       _readline=no    ;;
+	--enable-opengl)          _opengl=yes     ;;
+	--disable-opengl)         _opengl=no      ;;
 	--enable-verbose-build)   _verbose_build=yes ;;
 	--enable-plugins)         _dynamic_modules=yes ;;
 	--default-dynamic)        _plugins_default=dynamic ;;
@@ -821,6 +828,11 @@
 		READLINE_CFLAGS="-I$arg/include"
 		READLINE_LIBS="-L$arg/lib"
 		;;
+	--with-opengl-prefix=*)
+		arg=`echo $ac_option | cut -d '=' -f 2`
+		OPENGL_CFLAGS="-I$arg/include"
+		OPENGL_LIBS="-L$arg/lib"
+		;;
 	--backend=*)
 		_backend=`echo $ac_option | cut -d '=' -f 2`
 		;;
@@ -1345,8 +1357,10 @@
 		;;
 	darwin*)
 		DEFINES="$DEFINES -DUNIX -DMACOSX"
-		CXXFLAGS="$CXXFLAGS -I/System/Library/Frameworks/OpenGL.framework/Headers"
-		LIBS="$LIBS -framework AudioUnit -framework AudioToolbox -framework Carbon -framework CoreMIDI -framework OpenGL"
+		CXXFLAGS="$CXXFLAGS"
+		LIBS="$LIBS -framework AudioUnit -framework AudioToolbox -framework Carbon -framework CoreMIDI"
+		OPENGL_CFLAGS="-I/System/Library/Frameworks/OpenGL.framework/Headers"
+		OPENGL_LIBS="-framework OpenGL"
 		add_line_to_config_mk 'MACOSX = 1'
 		;;
 	dreamcast)
@@ -1440,6 +1454,14 @@
 		;;
 esac
 
+# HACK: On non-OSX systems, add the GL library
+case $_host_os in
+	*darwin*)
+		;;
+	*)
+		OPENGL_LIBS="$OPENGL_LIBS -lGL"
+esac
+
 if test -n "$_host"; then
 	# Cross-compiling mode - add your target here if needed
 	echo "Cross-compiling to $_host"
@@ -2262,6 +2284,28 @@
 fi
 
 #
+# Check for OpenGL (ES)
+#
+echocheck "OpenGL (ES)"
+if test "$_opengl" = auto ; then
+# TODO: This is just a quick hack until actual detection is added, which
+# will be a pain because of the various directories that OpenGL can have
+# its headers in. Maybe we should force the platforms to automatically
+# include the directory that includes gl.h?
+	_opengl=yes
+fi
+if test "$_opengl" = yes ; then
+	_def_opengl='#define USE_OPENGL'
+	LIBS="$LIBS $OPENGL_LIBS"
+	INCLUDES="$INCLUDES $OPENGL_CFLAGS"
+	DEFINES="$DEFINES -DUSE_OPENGL"
+else
+	_def_opengl='#undef USE_OPENGL'
+fi
+
+echo "$_opengl"
+
+#
 # Check for nasm
 #
 if test "$_have_x86" = yes ; then


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list