mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2024-11-10 06:31:56 +00:00
added loring's multi-platform, non-mesa OpenGL patch.
This commit is contained in:
parent
4b8ca8dd26
commit
5f20ff0bd7
5 changed files with 25 additions and 21 deletions
|
@ -4,13 +4,8 @@
|
|||
/* Define if you have the XFree86 DGA extension */
|
||||
#undef HAS_DGA
|
||||
|
||||
/* Define if you have an old Mesa that defines APIENTRY instead
|
||||
of GLAPIENTRY */
|
||||
#undef GLAPIENTRY_IS_APIENTRY
|
||||
|
||||
#ifdef GLAPIENTRY_IS_APIENTRY
|
||||
# define GLAPIENTRY APIENTRY
|
||||
#endif
|
||||
/* If your version of OpenGL uses APIENTRY, define GLAPIENTRY to be APIENTRY*/
|
||||
#undef GLAPIENTRY
|
||||
|
||||
/* Define this to something sane if you don't have stricmp */
|
||||
#undef stricmp
|
||||
|
|
|
@ -1264,8 +1264,12 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole
|
|||
{
|
||||
if (!mipmap)
|
||||
{
|
||||
// FIXME - what if this extension isn't available?
|
||||
/* FIXME - what if this extension isn't available? */
|
||||
#ifdef HAVE_GL_COLOR_INDEX8_EXT
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX , GL_UNSIGNED_BYTE, data);
|
||||
#else
|
||||
/* FIXME - should warn that this isn't available */
|
||||
#endif
|
||||
goto done;
|
||||
}
|
||||
memcpy (scaled, data, width*height);
|
||||
|
@ -1274,7 +1278,11 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole
|
|||
GL_Resample8BitTexture (data, width, height, scaled, scaled_width, scaled_height);
|
||||
|
||||
// FIXME - what if this extension isn't available?
|
||||
#ifdef HAVE_GL_COLOR_INDEX8_EXT
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, scaled);
|
||||
#else
|
||||
/* FIXME - should warn that this isn't available */
|
||||
#endif
|
||||
if (mipmap)
|
||||
{
|
||||
int miplevel;
|
||||
|
@ -1290,8 +1298,12 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole
|
|||
if (scaled_height < 1)
|
||||
scaled_height = 1;
|
||||
miplevel++;
|
||||
// FIXME - what if this extension isn't available?
|
||||
/* FIXME - what if this extension isn't available? */
|
||||
#ifdef HAVE_GL_COLOR_INDEX8_EXT
|
||||
glTexImage2D (GL_TEXTURE_2D, miplevel, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, scaled);
|
||||
#else
|
||||
/* FIXME - should warn that this isn't available */
|
||||
#endif
|
||||
}
|
||||
}
|
||||
done: ;
|
||||
|
@ -1420,9 +1432,7 @@ void GL_SelectTexture (GLenum target)
|
|||
{
|
||||
if (!gl_mtexable)
|
||||
return;
|
||||
#ifndef __linux__ // no multitexture under Linux yet
|
||||
qglSelectTextureSGIS(target);
|
||||
#endif
|
||||
if (target == oldtarget)
|
||||
return;
|
||||
cnttextures[oldtarget-TEXTURE0_SGIS] = currenttexture;
|
||||
|
|
|
@ -338,7 +338,7 @@ int main (int c, char **v) {
|
|||
if (COM_CheckParm("-nostdout")) {
|
||||
nostdout = 1;
|
||||
} else {
|
||||
fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | FNDELAY);
|
||||
fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | O_NDELAY);
|
||||
#ifdef QUAKEWORLD
|
||||
printf ("QuakeForge (QW Client) v%s\n", VERSION);
|
||||
#else
|
||||
|
|
16
configure.in
16
configure.in
|
@ -167,7 +167,7 @@ if test "x$HAS_OGL" != xno; then
|
|||
AC_MSG_CHECKING(for GL_COLOR_INDEX8_EXT in GL/gl.h)
|
||||
AC_TRY_COMPILE([#include "GL/gl.h"],
|
||||
[ int x = (int) GL_COLOR_INDEX8_EXT;],
|
||||
AC_DEFINE(HAVE_GL_COLOR_INDEX8_EXT,1) AC_MSG_RESULT(yes),
|
||||
AC_DEFINE(HAVE_GL_COLOR_INDEX8_EXT) AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no))
|
||||
|
||||
AC_MSG_CHECKING(for GLAPIENTRY in GL/gl.h)
|
||||
|
@ -178,14 +178,12 @@ if test "x$HAS_OGL" != xno; then
|
|||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING(for APIENTRY in GL/gl.h)
|
||||
AC_TRY_COMPILE([#include "GL/gl.h"],
|
||||
[ int x = APIENTRY printf("");],
|
||||
HAS_APIENTRY=1 AC_MSG_RESULT(yes),
|
||||
HAS_APIENTRY=0 AC_MSG_RESULT(no))
|
||||
if test "x$HAS_APIENTRY" != xno; then
|
||||
AC_DEFINE(GLAPIENTRY_IS_APIENTRY, 1)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for APIENTRY in GL/gl.h)
|
||||
AC_TRY_COMPILE([#include "GL/gl.h"],
|
||||
[ int x = APIENTRY printf("");],
|
||||
AC_DEFINE(GLAPIENTRY, APIENTRY) AC_MSG_RESULT(yes),
|
||||
AC_DEFINE(GLAPIENTRY, ) AC_MSG_RESULT(no))
|
||||
fi
|
||||
if test "x$HAS_GLIDE" != xno; then
|
||||
CPPFLAGS="$GLIDE_CFLAGS $CPPFLAGS"
|
||||
|
|
|
@ -32,6 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
|
||||
qboolean isDedicated;
|
||||
|
||||
|
|
Loading…
Reference in a new issue