mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-21 19:51:18 +00:00
misc fixes to get -wgl to cross compile
This commit is contained in:
parent
d74f867b06
commit
305fc0c371
5 changed files with 96 additions and 42 deletions
80
configure.in
80
configure.in
|
@ -454,16 +454,18 @@ AC_SUBST(SVGA_CFLAGS)
|
|||
AC_SUBST(SVGA_LIBS)
|
||||
|
||||
dnl Checks for X11 and XShm
|
||||
AC_PATH_XTRA
|
||||
if test "x$no_x" = x; then
|
||||
HAVE_X=yes
|
||||
AC_CHECK_LIB(Xext, XShmQueryExtension,
|
||||
X_SHM_LIB=-lXext,
|
||||
HAVE_X=no,
|
||||
[ $X_LIBS -lX11 $X_EXTRA_LIBS ]
|
||||
)
|
||||
if test "x$mingw" != xyes; then
|
||||
AC_PATH_XTRA
|
||||
if test "x$no_x" = x; then
|
||||
HAVE_X=yes
|
||||
AC_CHECK_LIB(Xext, XShmQueryExtension,
|
||||
X_SHM_LIB=-lXext,
|
||||
HAVE_X=no,
|
||||
[ $X_LIBS -lX11 $X_EXTRA_LIBS ]
|
||||
)
|
||||
fi
|
||||
AC_SUBST(X_SHM_LIB)
|
||||
fi
|
||||
AC_SUBST(X_SHM_LIB)
|
||||
|
||||
dnl Check for XFree86-VidMode support
|
||||
AC_ARG_ENABLE(vidmode,
|
||||
|
@ -573,19 +575,26 @@ if test "x$HAVE_GLX" != xno; then
|
|||
fi
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
|
||||
dnl Make sure -lGL or -lMesaGL works
|
||||
dnl Make sure -lGL or -lMesaGL or -lopengl32 works
|
||||
if test "x$glx_libraries" != xauto -a "x$glx_libraries" != xno -a "x$glx_libraries" != x; then
|
||||
if test "x$HAVE_GLX" = xyes; then
|
||||
HAVE_GLX=no
|
||||
AC_CHECK_LIB(GL, glColor4f,
|
||||
HAVE_GLX=yes
|
||||
OGL_NAME=GL,,
|
||||
[ -L$glx_libraries ]
|
||||
[ -L$glx_libraries -lX11 $X_EXTRA_LIBS ]
|
||||
)
|
||||
if test "x$HAVE_GLX" != xyes; then
|
||||
AC_CHECK_LIB(MesaGL, glColor4f,
|
||||
HAVE_GLX=yes
|
||||
OGL_NAME=MesaGL,,
|
||||
[ -L$glx_libraries -lX11 $X_EXTRA_LIBS ]
|
||||
)
|
||||
fi
|
||||
if test "x$HAVE_GLX" != xyes; then
|
||||
AC_CHECK_LIB(opengl32, glColor4f,
|
||||
HAVE_GLX=yes
|
||||
OGL_NAME=opengl32,,
|
||||
[ -L$glx_libraries ]
|
||||
)
|
||||
fi
|
||||
|
@ -611,6 +620,20 @@ else
|
|||
[ $X_LIBS ]
|
||||
)
|
||||
fi
|
||||
if test "x$HAVE_GLX" != xyes; then
|
||||
LIBS_save="$LIBS"
|
||||
LIBS="$LIBS -lopengl32"
|
||||
AC_MSG_CHECKING(for glColor4f in -lopengl32)
|
||||
AC_TRY_LINK(
|
||||
[#include <GL/gl.h>],
|
||||
[glColor4f(0,0,0,0);],
|
||||
HAVE_GLX=yes
|
||||
OGL_NAME=opengl32
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
LIBS="$LIBS_save"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -626,14 +649,20 @@ fi
|
|||
AC_SUBST(GLX_CFLAGS)
|
||||
AC_SUBST(GLX_LIBS)
|
||||
|
||||
dnl SDL/SDL-GL checks
|
||||
AM_PATH_SDL(1.0.1, HAVE_SDL=yes, HAVE_SDL=no)
|
||||
AC_ARG_ENABLE(sdl,
|
||||
[ --disable-sdl disable checking for SDL],
|
||||
)
|
||||
|
||||
if test "x$HAVE_SDL" != xno; then
|
||||
AM_CHECK_SGL(1.1.1, HAVE_SGL=yes, HAVE_SGL=no)
|
||||
if test "x$enable_sdl" != xno; then
|
||||
dnl SDL/SDL-GL checks
|
||||
AM_PATH_SDL(1.0.1, HAVE_SDL=yes, HAVE_SDL=no)
|
||||
|
||||
if test "x$HAVE_SDL" != xno; then
|
||||
AM_CHECK_SGL(1.1.1, HAVE_SGL=yes, HAVE_SGL=no)
|
||||
fi
|
||||
AC_SUBST(HAVE_SDL)
|
||||
AC_SUBST(HAVE_SGL)
|
||||
fi
|
||||
AC_SUBST(HAVE_SDL)
|
||||
AC_SUBST(HAVE_SGL)
|
||||
|
||||
# 3Dfx stuff..
|
||||
|
||||
|
@ -828,7 +857,7 @@ fi
|
|||
|
||||
dnl Win32
|
||||
if test -z "$SNDTYPE" -a "x$ac_cv_header_windows_h" = "xyes" -a \
|
||||
"x$ac_cv_header_mmsystem_h" = "xyes"; then
|
||||
"x$ac_cv_header_dsound_h" = "xyes"; then
|
||||
AC_EGREP_CPP([QF_maGiC_VALUE],[
|
||||
#include <windows.h>
|
||||
#include <mmsystem.h>
|
||||
|
@ -932,11 +961,11 @@ QF_maGiC_VALUE
|
|||
CD_LIBS="-lcdaudio -lmediad -lds"
|
||||
)
|
||||
fi
|
||||
|
||||
if test -z "$CDTYPE"; then
|
||||
AC_EGREP_CPP([QF_maGIC_VALUE],
|
||||
AC_EGREP_CPP([QF_maGiC_VALUE],
|
||||
[
|
||||
#include <windows.h>
|
||||
#include <mmsystem.h>
|
||||
#if defined(MCI_SET_DOOR_OPEN)
|
||||
QF_maGiC_VALUE
|
||||
#endif
|
||||
|
@ -1283,6 +1312,7 @@ if test "$clients" = "all"; then
|
|||
ENABLE_SDL=yes
|
||||
ENABLE_SGL=yes
|
||||
ENABLE_SVGA=yes
|
||||
ENABLE_WGL=yes
|
||||
ENABLE_X11=yes
|
||||
else
|
||||
ENABLE_3DFX=no
|
||||
|
@ -1293,6 +1323,7 @@ else
|
|||
ENABLE_SDL=no
|
||||
ENABLE_SGL=no
|
||||
ENABLE_SVGA=no
|
||||
ENABLE_WGL=no
|
||||
ENABLE_X11=no
|
||||
IFS=","
|
||||
for client in $clients; do
|
||||
|
@ -1321,6 +1352,9 @@ else
|
|||
svga)
|
||||
ENABLE_SVGA=yes
|
||||
;;
|
||||
wgl)
|
||||
ENABLE_WGL=yes
|
||||
;;
|
||||
x11)
|
||||
ENABLE_X11=yes
|
||||
;;
|
||||
|
@ -1372,6 +1406,12 @@ if test "x$HAVE_SVGA" = xyes -a "x$ENABLE_SVGA" = xyes; then
|
|||
TARGETS="$TARGETS qf-client-svga\$(EXEEXT)"
|
||||
CL_TARGETS="$CL_TARGETS SVGAlib"
|
||||
fi
|
||||
if test "x$mingw" = xyes; then
|
||||
if test "x$ENABLE_WGL" = xyes; then
|
||||
TARGETS="$TARGETS qf-client-wgl\$(EXEEXT)"
|
||||
CL_TARGETS="$CL_TARGETS WGL"
|
||||
fi
|
||||
fi
|
||||
if test "x$HAVE_X" = xyes -a "x$ENABLE_X11" = xyes; then
|
||||
TARGETS="$TARGETS qf-client-x11\$(EXEEXT)"
|
||||
CL_TARGETS="$CL_TARGETS X11"
|
||||
|
|
|
@ -35,14 +35,27 @@
|
|||
# pragma warning( disable : 4229 ) /* mgraph gets this */
|
||||
#endif
|
||||
|
||||
#define byte __hide_byte
|
||||
|
||||
#define LPCWAVEFORMATEX __hide_LPCWAVEFORMATEX_
|
||||
#include <windows.h>
|
||||
#include <ddraw.h>
|
||||
#undef LPCWAVEFORMATEX
|
||||
#ifdef WINNT
|
||||
#undef WINNT
|
||||
#include <dsound.h>
|
||||
#include <ddraw.h>
|
||||
#define WINNT
|
||||
#else
|
||||
#include <dsound.h>
|
||||
#include <ddraw.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MGRAPH_H
|
||||
# include <mgraph.h>
|
||||
#endif
|
||||
|
||||
#undef byte
|
||||
|
||||
#include "qtypes.h"
|
||||
|
||||
#ifndef WM_MOUSEWHEEL
|
||||
|
|
|
@ -302,10 +302,10 @@ qf_client_sgl_DEPENDENCIES=libqfnet.a libqfsys_cl.a libqfsnd.a libqfcd.a libqfjs
|
|||
#
|
||||
# SGI/Microsoft WGL (Windows OpenGL)
|
||||
#
|
||||
wgl_SOURCES= vid_wgl.c
|
||||
wgl_SOURCES= vid_wgl.c in_win.c
|
||||
|
||||
qf_client_wgl_SOURCES= $(common_SOURCES) $(client_SOURCES) $(ogl_SOURCES) $(wgl_SOURCES)
|
||||
qf_client_wgl_LDADD= $(CLIENT_LIBS)
|
||||
qf_client_wgl_LDADD= $(CLIENT_LIBS) $(GLX_LIBS) -lgdi32 -lwinmm
|
||||
qf_client_wgl_DEPENDENCIES=libqfnet.a libqfsys_cl.a libqfsnd.a libqfcd.a libqfjs.a
|
||||
|
||||
#
|
||||
|
|
|
@ -63,7 +63,7 @@ CDAudio_Eject (void)
|
|||
dwReturn = mciSendCommand (wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN,
|
||||
(DWORD) NULL);
|
||||
if (dwReturn) {
|
||||
Con_DPrintf ("MCI_SET_DOOR_OPEN failed (%i)\n", dwReturn);
|
||||
Con_DPrintf ("MCI_SET_DOOR_OPEN failed (%li)\n", dwReturn);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ CDAudio_CloseDoor (void)
|
|||
dwReturn =
|
||||
mciSendCommand (wDeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, (DWORD) NULL);
|
||||
if (dwReturn) {
|
||||
Con_DPrintf ("MCI_SET_DOOR_CLOSED failed (%i)\n", dwReturn);
|
||||
Con_DPrintf ("MCI_SET_DOOR_CLOSED failed (%li)\n", dwReturn);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,7 @@ CDAudio_Play (byte track, qboolean looping)
|
|||
MCI_STATUS_ITEM | MCI_TRACK | MCI_WAIT,
|
||||
(DWORD) (LPVOID) & mciStatusParms);
|
||||
if (dwReturn) {
|
||||
Con_DPrintf ("MCI_STATUS failed (%i)\n", dwReturn);
|
||||
Con_DPrintf ("MCI_STATUS failed (%li)\n", dwReturn);
|
||||
return;
|
||||
}
|
||||
if (mciStatusParms.dwReturn != MCI_CDA_TRACK_AUDIO) {
|
||||
|
@ -168,7 +168,7 @@ CDAudio_Play (byte track, qboolean looping)
|
|||
MCI_STATUS_ITEM | MCI_TRACK | MCI_WAIT,
|
||||
(DWORD) (LPVOID) & mciStatusParms);
|
||||
if (dwReturn) {
|
||||
Con_DPrintf ("MCI_STATUS failed (%i)\n", dwReturn);
|
||||
Con_DPrintf ("MCI_STATUS failed (%li)\n", dwReturn);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -185,7 +185,7 @@ CDAudio_Play (byte track, qboolean looping)
|
|||
mciSendCommand (wDeviceID, MCI_PLAY, MCI_NOTIFY | MCI_FROM | MCI_TO,
|
||||
(DWORD) (LPVOID) & mciPlayParms);
|
||||
if (dwReturn) {
|
||||
Con_DPrintf ("CDAudio: MCI_PLAY failed (%i)\n", dwReturn);
|
||||
Con_DPrintf ("CDAudio: MCI_PLAY failed (%li)\n", dwReturn);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,7 @@ CDAudio_Stop (void)
|
|||
|
||||
dwReturn = mciSendCommand (wDeviceID, MCI_STOP, 0, (DWORD) NULL);
|
||||
if (dwReturn) {
|
||||
Con_DPrintf ("MCI_STOP failed (%i)", dwReturn);
|
||||
Con_DPrintf ("MCI_STOP failed (%li)", dwReturn);
|
||||
}
|
||||
|
||||
wasPlaying = false;
|
||||
|
@ -236,7 +236,7 @@ CDAudio_Pause (void)
|
|||
mciSendCommand (wDeviceID, MCI_PAUSE, 0,
|
||||
(DWORD) (LPVOID) & mciGenericParms);
|
||||
if (dwReturn) {
|
||||
Con_DPrintf ("MCI_PAUSE failed (%i)", dwReturn);
|
||||
Con_DPrintf ("MCI_PAUSE failed (%li)", dwReturn);
|
||||
}
|
||||
|
||||
wasPlaying = playing;
|
||||
|
@ -266,7 +266,7 @@ CDAudio_Resume (void)
|
|||
mciSendCommand (wDeviceID, MCI_PLAY, MCI_TO | MCI_NOTIFY,
|
||||
(DWORD) (LPVOID) & mciPlayParms);
|
||||
if (dwReturn) {
|
||||
Con_DPrintf ("CDAudio: MCI_PLAY failed (%i)\n", dwReturn);
|
||||
Con_DPrintf ("CDAudio: MCI_PLAY failed (%li)\n", dwReturn);
|
||||
return;
|
||||
}
|
||||
playing = true;
|
||||
|
@ -456,7 +456,7 @@ CDAudio_Init (void)
|
|||
mciSendCommand (0, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_SHAREABLE,
|
||||
(DWORD) (LPVOID) & mciOpenParms);
|
||||
if (dwReturn) {
|
||||
Con_Printf ("CDAudio_Init: MCI_OPEN failed (%i)\n", dwReturn);
|
||||
Con_Printf ("CDAudio_Init: MCI_OPEN failed (%li)\n", dwReturn);
|
||||
return -1;
|
||||
}
|
||||
wDeviceID = mciOpenParms.wDeviceID;
|
||||
|
@ -467,7 +467,7 @@ CDAudio_Init (void)
|
|||
mciSendCommand (wDeviceID, MCI_SET, MCI_SET_TIME_FORMAT,
|
||||
(DWORD) (LPVOID) & mciSetParms);
|
||||
if (dwReturn) {
|
||||
Con_Printf ("MCI_SET_TIME_FORMAT failed (%i)\n", dwReturn);
|
||||
Con_Printf ("MCI_SET_TIME_FORMAT failed (%li)\n", dwReturn);
|
||||
mciSendCommand (wDeviceID, MCI_CLOSE, 0, (DWORD) NULL);
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "winquake.h"
|
||||
|
||||
#include "cdaudio.h"
|
||||
#include "cmd.h"
|
||||
#include "console.h"
|
||||
|
@ -46,7 +48,6 @@
|
|||
#include "sound.h"
|
||||
#include "sys.h"
|
||||
#include "va.h"
|
||||
#include "winquake.h"
|
||||
|
||||
extern void (*vid_menudrawfn) (void);
|
||||
extern void (*vid_menukeyfn) (int);
|
||||
|
@ -253,7 +254,7 @@ VID_SetWindowedMode (int modenum)
|
|||
global_hInstance, NULL);
|
||||
|
||||
if (!mainwindow)
|
||||
Sys_Error ("Couldn't create DIB window (%x)\r\n",GetLastError());
|
||||
Sys_Error ("Couldn't create DIB window (%lx)\r\n",GetLastError());
|
||||
|
||||
// Center and show the window
|
||||
CenterWindow (mainwindow, WindowRect.right - WindowRect.left,
|
||||
|
@ -309,7 +310,7 @@ VID_SetFullDIBMode (int modenum)
|
|||
|
||||
if (ChangeDisplaySettings (&gdevmode, CDS_FULLSCREEN) !=
|
||||
DISP_CHANGE_SUCCESSFUL)
|
||||
Sys_Error ("Couldn't set fullscreen DIB mode (%x)\r\n",GetLastError());
|
||||
Sys_Error ("Couldn't set fullscreen DIB mode (%lx)\r\n",GetLastError());
|
||||
}
|
||||
|
||||
lastmodestate = modestate;
|
||||
|
@ -343,7 +344,7 @@ VID_SetFullDIBMode (int modenum)
|
|||
global_hInstance, NULL);
|
||||
|
||||
if (!mainwindow)
|
||||
Sys_Error ("Couldn't create DIB window (%x)\r\n",GetLastError());
|
||||
Sys_Error ("Couldn't create DIB window (%lx)\r\n",GetLastError());
|
||||
|
||||
ShowWindow (mainwindow, SW_SHOWDEFAULT);
|
||||
UpdateWindow (mainwindow);
|
||||
|
@ -884,7 +885,7 @@ AppActivate (BOOL fActive, BOOL minimize)
|
|||
if (ChangeDisplaySettings (&gdevmode, CDS_FULLSCREEN) !=
|
||||
DISP_CHANGE_SUCCESSFUL) {
|
||||
IN_ShowMouse ();
|
||||
Sys_Error ("Couldn't set fullscreen DIB mode\n(try upgrading your video drivers)\r\n (%x)",GetLastError());
|
||||
Sys_Error ("Couldn't set fullscreen DIB mode\n(try upgrading your video drivers)\r\n (%lx)",GetLastError());
|
||||
}
|
||||
ShowWindow (mainwindow, SW_SHOWNORMAL);
|
||||
|
||||
|
@ -1205,7 +1206,7 @@ VID_InitDIB (HINSTANCE hInstance)
|
|||
wc.lpszClassName = "QuakeForge";
|
||||
|
||||
if (!RegisterClass (&wc))
|
||||
Sys_Error ("Couldn't register window class (%x)\r\n",GetLastError());
|
||||
Sys_Error ("Couldn't register window class (%lx)\r\n",GetLastError());
|
||||
|
||||
modelist[0].type = MS_WINDOWED;
|
||||
|
||||
|
@ -1421,7 +1422,7 @@ void
|
|||
VID_Init (unsigned char *palette)
|
||||
{
|
||||
int i, existingmode;
|
||||
int basenummodes, width, height, bpp, findbpp, done;
|
||||
int basenummodes, width, height=480, bpp, findbpp, done;
|
||||
char gldir[MAX_OSPATH];
|
||||
HDC hdc;
|
||||
DEVMODE devmode;
|
||||
|
@ -1620,7 +1621,7 @@ VID_Init (unsigned char *palette)
|
|||
lasterror=GetLastError();
|
||||
if (maindc && mainwindow)
|
||||
ReleaseDC (mainwindow, maindc);
|
||||
Sys_Error("Could not initialize GL (wglCreateContext failed).\n\nMake sure you in are 65535 color mode, and try running -window. \nError code: (%x)\r\n",lasterror);
|
||||
Sys_Error("Could not initialize GL (wglCreateContext failed).\n\nMake sure you in are 65535 color mode, and try running -window. \nError code: (%lx)\r\n",lasterror);
|
||||
}
|
||||
|
||||
if (!wglMakeCurrent (maindc, baseRC)) {
|
||||
|
@ -1629,7 +1630,7 @@ VID_Init (unsigned char *palette)
|
|||
wglDeleteContext (baseRC);
|
||||
if (maindc && mainwindow)
|
||||
ReleaseDC (mainwindow, maindc);
|
||||
Sys_Error ("wglMakeCurrent failed (%x)\r\n",lasterror);
|
||||
Sys_Error ("wglMakeCurrent failed (%lx)\r\n",lasterror);
|
||||
}
|
||||
|
||||
GL_Init ();
|
||||
|
|
Loading…
Reference in a new issue