On Sat, 8 Mar 2003, torcs wrote:
> A new version...
> - fixed makefile issues about the setup_linux.sh script
The scrips works cool, it's really good (used some symlinks before)
> - fixed some "abandon race bugs"
> - warp the mouse at the center of the window if player present
> and using mouse to drive.
Very good indeed.
> - X11 fullscreen 1st try from freeglut code.
> - mouse configuration screen.
> - keep the mouse pointer in the window in order to
> avoid screen panning in low resolutions.
I got this working by linking against freeglut:
To compile it, run:
In Torcs RC4, replace -lglut with -lfreeglut-1.3 in Make-config and do
a make install
In this build there would be two codes doing video mode switching
but the do it the same way, so you'll only see the first.
> - color depth configuration (24bits now)
I use a Radeon Mobility M6 LY 16MB with XFree 4.3 and the included
DRI driver and I see it switching to such mode:
OK done for 640x480:24@...
But start the X Server with Depth 16, so it cannot switch to 24bpp,
but it looks like it feels confident with 640x480 in 16bpp.
So it looks like some X11 drivers or servers even do the switch
if the asked mode is compatible.
I would be interested if somebody has some issue with the fullscreen
PS: It's not major, but if you want to remove the X11 vidmode stuff
from your torcs compile and rely on freeglut, you have to apply the
fixes below which should work for you also:
(sent the following to freeglut-developer also)
--- freeglut-1.3/freeglut_gamemode.c 2003/03/11 14:54:11 1.1
+++ freeglut-1.3/freeglut_gamemode.c 2003/03/11 15:01:55
@@ -137,6 +137,15 @@ void fghRestoreState( void )
displayModes[ i ]
+ * In case this will be the last X11 call we do before exit,
+ * we've to flush the X11 output queue to be sure the command
+ * is really brought onto it's way to the X server.
+ * The application should not do this because it
+ * would not be platform independent then.
@@ -200,6 +209,8 @@ GLboolean fghChangeDisplayMode( GLboolean haveToTest )
if( fghCheckDisplayMode( displayModes[ i ]->hdisplay, displayModes[ i ]->vdisplay,
fgState.GameModeDepth, fgState.GameModeRefresh ) )
+ if( haveToTest )
+ return( TRUE );
* OKi, this is the display mode we have been looking for...
Diffed against the current http://freeglut.sourceforge.net/dist/current.tgz.
On Tue, 11 Mar 2003, Bernhard Kaindl wrote:
> Hi all!
> I've tried the GameMode of the current freeglut CVS on current
> Linux XFree86-4.3 with TORCS(torcs.sf.net) and noticed two problems:
> - glutGameModeGet(GLUT_GAME_MODE_POSSIBLE) calls
> int fghChangeDisplayMode( int haveToTest ) with
> haveToTest == TRUE, but the XFree86 branch of
> fghChangeDisplayMode() does not check the
> flag and always changes to the mode if it
> was possible. Simple to fix in the loop
> when a matching mode was found.
> This may not be a problem in some(most?) cases but
> if a call to glutEnterGameMode() follows
> then it calls fghRememberState() which uses
> XF86VidModeGetModeLine() to get the current
> modeline from XFree, but as
> already switched the mode, fghRememberState
> gets the already witched video mode from
> the X server and remembers this mode and not
> the initial video mode. glutLeaveGameMode()
> tries to switch to the GameMode videomode
> and not to the initial video modes because
> the videomode saved was the GameMode videomode.
> - glutLeaveGameMode() calls fghRestoreState() which
> uses XF86VidModeSwitchToMode() in the XFree86 branch
> but it looks like that XFree86 does not execute the
> VidModeSwitch immediately(maybe also because the X
> protocol is asyncronous by default) and you have
> to call anoter X11 call afterwards to ensure that
> the X server switches to the mode. So a call to
> XFlush(display) may be done afterwards to flush the
> output buffer in case the application does no calls
> to XPending, XNextEvent or XWindowEvent afterwards
> which would flush the buffer also.
> In my case I put an call to XF86VidModeGetModeLine()
> after the XF86VidModeSwitchToMode() to check the mode
> switch which seemed to execute the mode switch on the
> server, but an eXpert told me that he have heard about
> such things with these functions and a final call to
> XFlush() should be done after calling the switch mode
> functions when the application does not do other X calls
> like create window or so immediately afterwards.
> I could send you simple patches to fix these two issues,
> and I wanted to send you this description beforehand to
> check for any feedback or concerns you may have.
> After fixing these problems TORCS works fine with the
> current freeglut-1.3 CVS.