Commit 35eef16b authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Support OpenGL in bitmaps through libOSMesa.

parent cbf9589b
......@@ -822,6 +822,7 @@ with_openal
with_opencl
with_opengl
with_openssl
with_osmesa
with_oss
with_png
with_pthread
......@@ -1510,6 +1511,7 @@ Optional Packages:
--without-opencl do not use OpenCL
--without-opengl do not use OpenGL
--without-openssl do not use OpenSSL
--without-osmesa do not use the OSMesa library
--without-oss do not use the OSS sound support
--without-png do not use PNG
--without-pthread do not use the pthread library
......@@ -2679,6 +2681,12 @@ if test "${with_openssl+set}" = set; then :
fi
# Check whether --with-osmesa was given.
if test "${with_osmesa+set}" = set; then :
withval=$with_osmesa; if test "x$withval" = "xno"; then ac_cv_header_GL_osmesa_h=no; fi
fi
# Check whether --with-oss was given.
if test "${with_oss+set}" = set; then :
withval=$with_oss;
......@@ -8806,7 +8814,7 @@ fi
opengl_msg=""
if test "x$with_opengl" != "xno"
then
for ac_header in GL/gl.h GL/glx.h GL/glu.h
for ac_header in GL/gl.h GL/glx.h GL/glu.h GL/osmesa.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_GL_GLX_H
......@@ -9024,6 +9032,68 @@ fi
This is an error since --with-glu was requested." "$LINENO" 5 ;;
esac
fi
if test "$ac_cv_header_GL_osmesa_h" = "yes"
then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -lOSMesa" >&5
$as_echo_n "checking for -lOSMesa... " >&6; }
if ${ac_cv_lib_soname_OSMesa+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_soname_save_LIBS=$LIBS
LIBS="-lOSMesa $X_LIBS $X_PRE_LIBS $XLIB -lm $X_EXTRA_LIBS $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char glAccum ();
int
main ()
{
return glAccum ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
case "$LIBEXT" in
dll) ac_cv_lib_soname_OSMesa=`$ac_cv_path_LDD conftest.exe | grep "OSMesa" | sed -e "s/dll.*/dll/"';2,$d'` ;;
dylib) ac_cv_lib_soname_OSMesa=`otool -L conftest$ac_exeext | grep "libOSMesa\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libOSMesa\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
*) ac_cv_lib_soname_OSMesa=`$ac_cv_path_LDD conftest$ac_exeext | grep "libOSMesa\\.$LIBEXT" | sed -e "s/^.*\(libOSMesa\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` ;;
esac
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_soname_save_LIBS
fi
if test "x$ac_cv_lib_soname_OSMesa" = "x"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
$as_echo "not found" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_OSMesa" >&5
$as_echo "$ac_cv_lib_soname_OSMesa" >&6; }
cat >>confdefs.h <<_ACEOF
#define SONAME_LIBOSMESA "$ac_cv_lib_soname_OSMesa"
_ACEOF
fi
fi
if test "x$ac_cv_lib_soname_OSMesa" = "x"; then :
case "x$with_osmesa" in
x) as_fn_append wine_notices "|libOSMesa ${notice_platform}development files not found (or too old), OpenGL rendering in bitmaps won't be supported." ;;
xno) ;;
*) as_fn_error $? "libOSMesa ${notice_platform}development files not found (or too old), OpenGL rendering in bitmaps won't be supported.
This is an error since --with-osmesa was requested." "$LINENO" 5 ;;
esac
fi
else
opengl_msg="Old Mesa headers detected. Consider upgrading your Mesa libraries."
fi
......
......@@ -69,6 +69,8 @@ AC_ARG_WITH(opencl, AS_HELP_STRING([--without-opencl],[do not use OpenCL]),
AC_ARG_WITH(opengl, AS_HELP_STRING([--without-opengl],[do not use OpenGL]))
AC_ARG_WITH(openssl, AS_HELP_STRING([--without-openssl],[do not use OpenSSL]),
[if test "x$withval" = "xno"; then ac_cv_header_openssl_err_h=no; ac_cv_header_openssl_ssl_h=no; fi])
AC_ARG_WITH(osmesa, AS_HELP_STRING([--without-osmesa],[do not use the OSMesa library]),
[if test "x$withval" = "xno"; then ac_cv_header_GL_osmesa_h=no; fi])
AC_ARG_WITH(oss, AS_HELP_STRING([--without-oss],[do not use the OSS sound support]))
AC_ARG_WITH(png, AS_HELP_STRING([--without-png],[do not use PNG]),
[if test "x$withval" = "xno"; then ac_cv_header_png_h=no; fi])
......@@ -1091,7 +1093,7 @@ then
opengl_msg=""
if test "x$with_opengl" != "xno"
then
AC_CHECK_HEADERS(GL/gl.h GL/glx.h GL/glu.h,,,
AC_CHECK_HEADERS(GL/gl.h GL/glx.h GL/glu.h GL/osmesa.h,,,
[#ifdef HAVE_GL_GLX_H
# include <GL/glx.h>
#endif])
......@@ -1127,6 +1129,13 @@ This probably prevents linking to OpenGL. Try deleting the file and restarting c
fi
WINE_NOTICE_WITH(glu,[test "x$ac_cv_lib_soname_GLU" = "x"],
[libGLU ${notice_platform}development files not found, GLU won't be supported.])
if test "$ac_cv_header_GL_osmesa_h" = "yes"
then
WINE_CHECK_SONAME(OSMesa,glAccum,,,[$X_LIBS $X_PRE_LIBS $XLIB -lm $X_EXTRA_LIBS])
fi
WINE_NOTICE_WITH(osmesa,[test "x$ac_cv_lib_soname_OSMesa" = "x"],
[libOSMesa ${notice_platform}development files not found (or too old), OpenGL rendering in bitmaps won't be supported.])
else
opengl_msg="Old Mesa headers detected. Consider upgrading your Mesa libraries."
fi
......
......@@ -2,7 +2,7 @@ EXTRADEFS = -D_GDI32_
MODULE = gdi32.dll
IMPORTLIB = gdi32
IMPORTS = advapi32
EXTRAINCL = @FREETYPEINCL@ @FONTCONFIGINCL@
EXTRAINCL = @FREETYPEINCL@ @FONTCONFIGINCL@ @X_CFLAGS@
EXTRALIBS = @CARBONLIB@
DELAYIMPORTS = usp10
......@@ -18,6 +18,7 @@ C_SRCS = \
dibdrv/dc.c \
dibdrv/graphics.c \
dibdrv/objects.c \
dibdrv/opengl.c \
dibdrv/primitives.c \
driver.c \
enhmetafile.c \
......
......@@ -409,7 +409,7 @@ const struct gdi_dc_funcs dib_driver =
dibdrv_CreateDC, /* pCreateDC */
dibdrv_DeleteDC, /* pDeleteDC */
NULL, /* pDeleteObject */
NULL, /* pDescribePixelFormat */
dibdrv_DescribePixelFormat, /* pDescribePixelFormat */
NULL, /* pDeviceCapabilities */
dibdrv_Ellipse, /* pEllipse */
NULL, /* pEndDoc */
......@@ -501,7 +501,7 @@ const struct gdi_dc_funcs dib_driver =
NULL, /* pSetMapMode */
NULL, /* pSetMapperFlags */
dibdrv_SetPixel, /* pSetPixel */
NULL, /* pSetPixelFormat */
dibdrv_SetPixelFormat, /* pSetPixelFormat */
NULL, /* pSetPolyFillMode */
NULL, /* pSetROP2 */
NULL, /* pSetRelAbs */
......@@ -524,6 +524,6 @@ const struct gdi_dc_funcs dib_driver =
NULL, /* pSwapBuffers */
NULL, /* pUnrealizePalette */
NULL, /* pWidenPath */
NULL, /* wine_get_wgl_driver */
dibdrv_wine_get_wgl_driver, /* wine_get_wgl_driver */
GDI_PRIORITY_DIB_DRV /* priority */
};
......@@ -114,6 +114,7 @@ extern DWORD dibdrv_BlendImage( PHYSDEV dev, BITMAPINFO *info, const struct g
struct bitblt_coords *src, struct bitblt_coords *dst, BLENDFUNCTION func ) DECLSPEC_HIDDEN;
extern BOOL dibdrv_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT start_x, INT start_y, INT end_x, INT end_y ) DECLSPEC_HIDDEN;
extern int dibdrv_DescribePixelFormat( PHYSDEV dev, int fmt, UINT size, PIXELFORMATDESCRIPTOR *descr ) DECLSPEC_HIDDEN;
extern BOOL dibdrv_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN;
extern BOOL dibdrv_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT type ) DECLSPEC_HIDDEN;
extern BOOL dibdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
......@@ -145,8 +146,10 @@ extern HPEN dibdrv_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pat
extern COLORREF dibdrv_SetDCBrushColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern COLORREF dibdrv_SetDCPenColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern COLORREF dibdrv_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN;
extern BOOL dibdrv_SetPixelFormat( PHYSDEV dev, int fmt, const PIXELFORMATDESCRIPTOR *descr ) DECLSPEC_HIDDEN;
extern BOOL dibdrv_StretchBlt( PHYSDEV dst_dev, struct bitblt_coords *dst,
PHYSDEV src_dev, struct bitblt_coords *src, DWORD rop ) DECLSPEC_HIDDEN;
extern struct opengl_funcs *dibdrv_wine_get_wgl_driver( PHYSDEV dev, UINT version ) DECLSPEC_HIDDEN;
static inline dibdrv_physdev *get_dibdrv_pdev( PHYSDEV dev )
{
......
......@@ -104,6 +104,7 @@ typedef struct tagDC
SIZE virtual_size; /* Initially HORZSIZE,VERTSIZE. Changed by SetVirtualResolution */
RECT vis_rect; /* visible rectangle in screen coords */
RECT device_rect; /* rectangle for the whole device */
int pixel_format; /* pixel format (for memory DCs) */
FLOAT miterLimit;
int flags;
......
......@@ -239,6 +239,9 @@
/* Define to 1 if you have the <GL/gl.h> header file. */
#undef HAVE_GL_GL_H
/* Define to 1 if you have the <GL/osmesa.h> header file. */
#undef HAVE_GL_OSMESA_H
/* Define if we have libgphoto2 development environment */
#undef HAVE_GPHOTO2
......@@ -1256,6 +1259,9 @@
/* Define to the soname of the libopenal library. */
#undef SONAME_LIBOPENAL
/* Define to the soname of the libOSMesa library. */
#undef SONAME_LIBOSMESA
/* Define to the soname of the libpng library. */
#undef SONAME_LIBPNG
......
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