diff --git a/configure b/configure index 907b1d8b7e..d5da875b55 100755 --- a/configure +++ b/configure @@ -12455,7 +12455,7 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - OPENGL_LINK="-lGL" + OPENGL_LINK="-lGL -lGLU" else echo "$ac_t""no" 1>&6 @@ -12496,7 +12496,7 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - OPENGL_LINK="-lMesaGL" + OPENGL_LINK="-lMesaGL -lMesaGLU" else echo "$ac_t""no" 1>&6 @@ -14331,7 +14331,8 @@ EOF -GUILIBS="$GUI_TK_LIBRARY $OPENGL_LINK $TOOLKIT_LINK" +GUILIBS="$GUI_TK_LIBRARY $TOOLKIT_LINK" +OPENGL_LIBS="$OPENGL_LINK" EXTRA_LIBS="$LIBS $POSIX4_LINK $INET_LINK $WCHAR_LINK $THREADS_LINK $DMALLOC_LINK $DL_LINK $ZLIB_LINK -lm" if test "$wxUSE_GUI" = "yes"; then @@ -14454,10 +14455,11 @@ SAMPLES_SUBDIRS="`echo $SAMPLES_SUBDIRS | tr -s ' ' | tr ' ' '\n' | sort | uniq + echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:14461: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:14463: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -14745,6 +14747,7 @@ s%@DOCS_SUBDIRS@%$DOCS_SUBDIRS%g s%@SAMPLES_SUBDIRS@%$SAMPLES_SUBDIRS%g s%@USER_SUBDIRS@%$USER_SUBDIRS%g s%@EXTRA_LIBS@%$EXTRA_LIBS%g +s%@OPENGL_LIBS@%$OPENGL_LIBS%g s%@EXTRADEFS@%$EXTRADEFS%g s%@LD_LIBS@%$LD_LIBS%g s%@RCINPUTSWITCH@%$RCINPUTSWITCH%g diff --git a/configure.in b/configure.in index aac22ef011..6042a1a358 100644 --- a/configure.in +++ b/configure.in @@ -2841,10 +2841,10 @@ if test "$wxUSE_OPENGL" = "yes"; then AC_DEFINE(wxUSE_OPENGL) AC_DEFINE(wxUSE_GLCANVAS) AC_CHECK_LIB(GL, glFlush, [ - OPENGL_LINK="-lGL" + OPENGL_LINK="-lGL -lGLU" ],[ AC_CHECK_LIB(MesaGL, glFlush, [ - OPENGL_LINK="-lMesaGL" + OPENGL_LINK="-lMesaGL -lMesaGLU" ],) ],) ],wxUSE_OPENGL=0) @@ -3704,7 +3704,8 @@ dnl --------------------------------------------------------------------------- dnl Output the makefiles and such from the results found above dnl --------------------------------------------------------------------------- -GUILIBS="$GUI_TK_LIBRARY $OPENGL_LINK $TOOLKIT_LINK" +GUILIBS="$GUI_TK_LIBRARY $TOOLKIT_LINK" +OPENGL_LIBS="$OPENGL_LINK" dnl all additional libraries (except wxWindows itself) we link with dnl @@ -3846,6 +3847,7 @@ AC_SUBST(USER_SUBDIRS) dnl additional libraries and linker settings AC_SUBST(LDFLAGS) AC_SUBST(EXTRA_LIBS) +AC_SUBST(OPENGL_LIBS) AC_SUBST(EXTRADEFS) AC_SUBST(LIBS) AC_SUBST(LD_LIBS) diff --git a/samples/opengl/cube/Makefile.in b/samples/opengl/cube/Makefile.in index 04a390497b..311847e12e 100644 --- a/samples/opengl/cube/Makefile.in +++ b/samples/opengl/cube/Makefile.in @@ -15,7 +15,7 @@ program_dir = samples/opengl/cube PROGRAM=cube -LIBRARIES=-lMesaGL -lMesaGLU ../../../lib/libwx_gtk_gl.so +LIBRARIES=$(OPENGLLIBS) ../../../lib/libwx_gtk_gl.so OBJECTS=$(PROGRAM).o diff --git a/samples/opengl/isosurf/Makefile.in b/samples/opengl/isosurf/Makefile.in index 0dc1538282..4c4867009d 100644 --- a/samples/opengl/isosurf/Makefile.in +++ b/samples/opengl/isosurf/Makefile.in @@ -17,7 +17,7 @@ DATAFILES = isosurf.dat.gz PROGRAM=isosurf -LIBRARIES=-lMesaGL -lMesaGLU ../../../lib/libwx_gtk_gl.so +LIBRARIES=$(OPENGLLIBS) ../../../lib/libwx_gtk_gl.so OBJECTS=$(PROGRAM).o diff --git a/samples/opengl/penguin/Makefile.in b/samples/opengl/penguin/Makefile.in index ad3f1f37da..f65cb0ebb2 100644 --- a/samples/opengl/penguin/Makefile.in +++ b/samples/opengl/penguin/Makefile.in @@ -17,7 +17,7 @@ DATAFILES = penguin.lwo PROGRAM=penguin -LIBRARIES=-lMesaGL -lMesaGLU ../../../lib/libwx_gtk_gl.so +LIBRARIES=$(OPENGLLIBS) ../../../lib/libwx_gtk_gl.so OBJECTS=$(PROGRAM).o lw.o trackball.o diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp index 1e49da571c..4c5e867150 100644 --- a/src/gtk/bitmap.cpp +++ b/src/gtk/bitmap.cpp @@ -20,6 +20,16 @@ #include #include +extern void gdk_wx_draw_bitmap (GdkDrawable *drawable, + GdkGC *gc, + GdkDrawable *src, + gint xsrc, + gint ysrc, + gint xdest, + gint ydest, + gint width, + gint height); + //----------------------------------------------------------------------------- // data //----------------------------------------------------------------------------- @@ -180,7 +190,7 @@ bool wxMask::Create( const wxBitmap& bitmap ) GdkGC *gc = gdk_gc_new( m_bitmap ); - gdk_draw_bitmap( m_bitmap, gc, bitmap.GetBitmap(), 0, 0, 0, 0, bitmap.GetWidth(), bitmap.GetHeight() ); + gdk_wx_draw_bitmap( m_bitmap, gc, bitmap.GetBitmap(), 0, 0, 0, 0, bitmap.GetWidth(), bitmap.GetHeight() ); gdk_gc_unref( gc ); @@ -422,7 +432,7 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const else { GdkGC *gc = gdk_gc_new( ret.GetBitmap() ); - gdk_draw_bitmap( ret.GetBitmap(), gc, GetBitmap(), rect.x, rect.y, 0, 0, rect.width, rect.height ); + gdk_wx_draw_bitmap( ret.GetBitmap(), gc, GetBitmap(), rect.x, rect.y, 0, 0, rect.width, rect.height ); gdk_gc_destroy( gc ); } @@ -432,7 +442,7 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const mask->m_bitmap = gdk_pixmap_new( wxRootWindow->window, rect.width, rect.height, 1 ); GdkGC *gc = gdk_gc_new( mask->m_bitmap ); - gdk_draw_bitmap( mask->m_bitmap, gc, M_BMPDATA->m_mask->m_bitmap, 0, 0, rect.x, rect.y, rect.width, rect.height ); + gdk_wx_draw_bitmap( mask->m_bitmap, gc, M_BMPDATA->m_mask->m_bitmap, 0, 0, rect.x, rect.y, rect.width, rect.height ); gdk_gc_destroy( gc ); ret.SetMask( mask ); diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 705d060cb4..dfaee313a2 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -68,7 +68,7 @@ static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; } #include "gdk/gdkprivate.h" -void gdk_draw_bitmap (GdkDrawable *drawable, +void gdk_wx_draw_bitmap (GdkDrawable *drawable, GdkGC *gc, GdkDrawable *src, gint xsrc, @@ -912,7 +912,7 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap, /* Draw XPixmap or XBitmap, depending on what the wxBitmap contains. For drawing a mono-bitmap (XBitmap) we use the current text GC */ if (is_mono) - gdk_draw_bitmap( m_window, m_textGC, use_bitmap.GetBitmap(), 0, 0, xx, yy, -1, -1 ); + gdk_wx_draw_bitmap( m_window, m_textGC, use_bitmap.GetBitmap(), 0, 0, xx, yy, -1, -1 ); else gdk_draw_pixmap( m_window, m_penGC, use_bitmap.GetPixmap(), 0, 0, xx, yy, -1, -1 ); @@ -1098,7 +1098,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he drawing a mono-bitmap (XBitmap) we use the current text GC */ if (is_mono) - gdk_draw_bitmap( m_window, m_textGC, use_bitmap.GetBitmap(), xsrc, ysrc, xx, yy, ww, hh ); + gdk_wx_draw_bitmap( m_window, m_textGC, use_bitmap.GetBitmap(), xsrc, ysrc, xx, yy, ww, hh ); else gdk_draw_pixmap( m_window, m_penGC, use_bitmap.GetPixmap(), xsrc, ysrc, xx, yy, ww, hh ); diff --git a/src/gtk1/bitmap.cpp b/src/gtk1/bitmap.cpp index 1e49da571c..4c5e867150 100644 --- a/src/gtk1/bitmap.cpp +++ b/src/gtk1/bitmap.cpp @@ -20,6 +20,16 @@ #include #include +extern void gdk_wx_draw_bitmap (GdkDrawable *drawable, + GdkGC *gc, + GdkDrawable *src, + gint xsrc, + gint ysrc, + gint xdest, + gint ydest, + gint width, + gint height); + //----------------------------------------------------------------------------- // data //----------------------------------------------------------------------------- @@ -180,7 +190,7 @@ bool wxMask::Create( const wxBitmap& bitmap ) GdkGC *gc = gdk_gc_new( m_bitmap ); - gdk_draw_bitmap( m_bitmap, gc, bitmap.GetBitmap(), 0, 0, 0, 0, bitmap.GetWidth(), bitmap.GetHeight() ); + gdk_wx_draw_bitmap( m_bitmap, gc, bitmap.GetBitmap(), 0, 0, 0, 0, bitmap.GetWidth(), bitmap.GetHeight() ); gdk_gc_unref( gc ); @@ -422,7 +432,7 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const else { GdkGC *gc = gdk_gc_new( ret.GetBitmap() ); - gdk_draw_bitmap( ret.GetBitmap(), gc, GetBitmap(), rect.x, rect.y, 0, 0, rect.width, rect.height ); + gdk_wx_draw_bitmap( ret.GetBitmap(), gc, GetBitmap(), rect.x, rect.y, 0, 0, rect.width, rect.height ); gdk_gc_destroy( gc ); } @@ -432,7 +442,7 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const mask->m_bitmap = gdk_pixmap_new( wxRootWindow->window, rect.width, rect.height, 1 ); GdkGC *gc = gdk_gc_new( mask->m_bitmap ); - gdk_draw_bitmap( mask->m_bitmap, gc, M_BMPDATA->m_mask->m_bitmap, 0, 0, rect.x, rect.y, rect.width, rect.height ); + gdk_wx_draw_bitmap( mask->m_bitmap, gc, M_BMPDATA->m_mask->m_bitmap, 0, 0, rect.x, rect.y, rect.width, rect.height ); gdk_gc_destroy( gc ); ret.SetMask( mask ); diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index 705d060cb4..dfaee313a2 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -68,7 +68,7 @@ static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; } #include "gdk/gdkprivate.h" -void gdk_draw_bitmap (GdkDrawable *drawable, +void gdk_wx_draw_bitmap (GdkDrawable *drawable, GdkGC *gc, GdkDrawable *src, gint xsrc, @@ -912,7 +912,7 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap, /* Draw XPixmap or XBitmap, depending on what the wxBitmap contains. For drawing a mono-bitmap (XBitmap) we use the current text GC */ if (is_mono) - gdk_draw_bitmap( m_window, m_textGC, use_bitmap.GetBitmap(), 0, 0, xx, yy, -1, -1 ); + gdk_wx_draw_bitmap( m_window, m_textGC, use_bitmap.GetBitmap(), 0, 0, xx, yy, -1, -1 ); else gdk_draw_pixmap( m_window, m_penGC, use_bitmap.GetPixmap(), 0, 0, xx, yy, -1, -1 ); @@ -1098,7 +1098,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he drawing a mono-bitmap (XBitmap) we use the current text GC */ if (is_mono) - gdk_draw_bitmap( m_window, m_textGC, use_bitmap.GetBitmap(), xsrc, ysrc, xx, yy, ww, hh ); + gdk_wx_draw_bitmap( m_window, m_textGC, use_bitmap.GetBitmap(), xsrc, ysrc, xx, yy, ww, hh ); else gdk_draw_pixmap( m_window, m_penGC, use_bitmap.GetPixmap(), xsrc, ysrc, xx, yy, ww, hh ); diff --git a/src/make.env.in b/src/make.env.in index 299c57a85b..bff33e5385 100644 --- a/src/make.env.in +++ b/src/make.env.in @@ -12,6 +12,7 @@ # see comment near LDFLAGS at the end of file EXTRALIBS = @LDFLAGS@ @EXTRA_LIBS@ +OPENGLLIBS = @OPENGL_LIBS@ LDLIBS = $(APPEXTRALIBS) ${top_builddir}/lib/@WX_TARGET_LIBRARY@ $(EXTRALIBS) TOOLKIT = @TOOLKIT@