Commit 48c08164 authored by Lionel Ulmer's avatar Lionel Ulmer Committed by Alexandre Julliard

- detect if the OpenGL implementation defines the paletted texture and

color table extensions - small warning fixes - fix the double '-lXxf86dga' when having DGA 2.0
parent f1a3f175
......@@ -154,8 +154,11 @@ then
if test "$ac_cv_header_X11_Xlib_h" = "yes" -a "$ac_cv_header_X11_extensions_xf86dga_h" = "yes"
then
AC_CHECK_LIB(Xxf86dga,XDGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA2) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
if test "$ac_cv_lib_Xxf86dga_XDGAQueryExtension" = "no"
then
AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
fi
fi
dnl Check for XFree86 VMODE extension
AC_CHECK_HEADERS(X11/Xlib.h X11/extensions/xf86vmode.h)
......@@ -186,6 +189,21 @@ then
then
AC_CHECK_LIB(MesaGL,glXCreateContext,AC_DEFINE(HAVE_LIBMESAGL) X_PRE_LIBS="$X_PRE_LIBS -lMesaGL",,$X_LIBS -lXext -lX11 -lm)
fi
dnl Check for the Color Table and Paletted Texture extensions
AC_CACHE_CHECK("for the OpenGL Color Index extension",dummy,
AC_TRY_COMPILE(
[#include <GL/gl.h>],
[GLenum test = GL_COLOR_INDEX8_EXT;],
[AC_DEFINE(HAVE_GL_COLOR_TABLE)],
)
)
if test "$ac_cv_lib_GL_glXCreateContext" = "no"
then
AC_CHECK_LIB(MesaGL,glColorTableEXT,AC_DEFINE(HAVE_GL_PALETTED_TEXTURE),,$X_LIBS -lXext -lX11 -lm)
else
AC_CHECK_LIB(GL,glColorTableEXT,AC_DEFINE(HAVE_GL_PALETTED_TEXTURE),,$X_LIBS -lXext -lX11 -lm)
fi
fi
fi
......
......@@ -498,6 +498,7 @@ static HRESULT enum_texture_format_OpenGL(LPD3DENUMTEXTUREFORMATSCALLBACK cb,
return DD_OK;
#endif
#if defined(HAVE_GL_COLOR_TABLE) && defined(HAVE_GL_PALETTED_TEXTURE)
TRACE("Enumerating Paletted (8)\n");
pformat->dwFlags = DDPF_PALETTEINDEXED8;
pformat->u.dwRGBBitCount = 8;
......@@ -507,6 +508,7 @@ static HRESULT enum_texture_format_OpenGL(LPD3DENUMTEXTUREFORMATSCALLBACK cb,
pformat->u4.dwRGBAlphaBitMask = 0x00000000;
if (cb(&sdesc, context) == 0)
return DD_OK;
#endif
TRACE("End of enumeration\n");
......
......@@ -32,7 +32,7 @@ DEFAULT_DEBUG_CHANNEL(ddraw)
char buf[32]; \
int x, y; \
\
sprintf(buf, "%d.pnm", This->tex_name); \
sprintf(buf, "%ld.pnm", This->tex_name); \
f = fopen(buf, "wb"); \
fprintf(f, "P6\n%ld %ld\n255\n", src_d->dwWidth, src_d->dwHeight); \
for (y = 0; y < src_d->dwHeight; y++) { \
......@@ -52,7 +52,7 @@ DEFAULT_DEBUG_CHANNEL(ddraw)
char buf[32]; \
int x, y; \
\
sprintf(buf, "%d.pnm", This->tex_name); \
sprintf(buf, "%ld.pnm", This->tex_name); \
f = fopen(buf, "wb"); \
fprintf(f, "P6\n%ld %ld\n255\n", src_d->dwWidth, src_d->dwHeight); \
for (y = 0; y < src_d->dwHeight; y++) { \
......@@ -72,7 +72,7 @@ DEFAULT_DEBUG_CHANNEL(ddraw)
char buf[32]; \
int x, y; \
\
sprintf(buf, "%d.pnm", This->tex_name); \
sprintf(buf, "%ld.pnm", This->tex_name); \
f = fopen(buf, "wb"); \
fprintf(f, "P6\n%ld %ld\n255\n", src_d->dwWidth, src_d->dwHeight); \
for (y = 0; y < src_d->dwHeight; y++) { \
......@@ -282,7 +282,7 @@ static HRESULT WINAPI IDirect3DTextureImpl_GetHandle(LPDIRECT3DTEXTURE iface,
glGenTextures(1, &(This->tex_name));
LEAVE_GL();
TRACE("OpenGL texture handle is : %d\n", This->tex_name);
TRACE("OpenGL texture handle is : %ld\n", This->tex_name);
return D3D_OK;
}
......@@ -325,7 +325,7 @@ static HRESULT WINAPI IDirect3DTexture2Impl_GetHandle(LPDIRECT3DTEXTURE2 iface,
glGenTextures(1, &(This->tex_name));
LEAVE_GL();
TRACE("OpenGL texture handle is : %d\n", This->tex_name);
TRACE("OpenGL texture handle is : %ld\n", This->tex_name);
return D3D_OK;
}
......@@ -421,7 +421,8 @@ static HRESULT WINAPI IDirect3DTexture2Impl_Load(LPDIRECT3DTEXTURE2 iface,
/* Texture snooping */
SNOOP_PALETTED();
/* Use Paletted Texture Extension */
#if defined(HAVE_GL_COLOR_TABLE) && defined(HAVE_GL_PALETTED_TEXTURE)
/* use Paletted Texture Extension */
glColorTableEXT(GL_TEXTURE_2D, /* target */
GL_RGBA, /* internal format */
256, /* table size */
......@@ -437,6 +438,7 @@ static HRESULT WINAPI IDirect3DTexture2Impl_Load(LPDIRECT3DTEXTURE2 iface,
GL_COLOR_INDEX, /* texture format */
GL_UNSIGNED_BYTE, /* texture type */
src_d->u1.lpSurface); /* the texture */
#endif
} else if (src_d->ddpfPixelFormat.dwFlags & DDPF_RGB) {
/* ************
RGB Textures
......
......@@ -104,3 +104,9 @@
/* Define if <linux/joystick.h> defines the Linux 2.2 joystick API */
#undef HAVE_LINUX_22_JOYSTICK_API
/* Define if the OpenGL implementation supports the GL_EXT_color_table extension */
#undef HAVE_GL_COLOR_TABLE
/* Define if the OpenGL implementation supports the GL_EXT_paletted_texture extension */
#undef HAVE_GL_PALETTED_TEXTURE
......@@ -137,6 +137,12 @@
/* Define if <linux/joystick.h> defines the Linux 2.2 joystick API */
#undef HAVE_LINUX_22_JOYSTICK_API
/* Define if the OpenGL implementation supports the GL_EXT_color_table extension */
#undef HAVE_GL_COLOR_TABLE
/* Define if the OpenGL implementation supports the GL_EXT_paletted_texture extension */
#undef HAVE_GL_PALETTED_TEXTURE
/* The number of bytes in a long long. */
#undef SIZEOF_LONG_LONG
......
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