Bug 140542 - Flightgear 0.9.10 fail to initialize according to freeglut-2.4.0
Bug#: 140542 Product:  Gentoo Linux Version: unspecified Platform: x86
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: x11@gentoo.org Reported By: vladimir@karmishin.com
Component: Games
URL: 
Summary: Flightgear 0.9.10 fail to initialize according to freeglut-2.4.0
Keywords:  Inclusion
Status Whiteboard: 
Opened: 2006-07-15 12:20 0000
Description:   Opened: 2006-07-15 12:20 0000
Flightgear 0.9.10 fails to initialize with:

Model Author:  Unknown
Creation Date: 2002-01-01
Version:       $Id: c172p.xml,v 1.17 2006-03-13 15:27:14 ehofman Exp $
Description:   Cessna C-172
freeglut (/usr/games/bin/fgfs): Failed to create cursor
freeglut  ERROR:  Function <glutSetCursor> called without first calling
'glutInit'.


The following patch to freeglut-2.4.0 from Vilhelm Sjoberg solve the problem:

 --- freeglut-2.4.0/src/freeglut_cursor.c       2005-04-22 17:23:12.000000000
+0200
 +++ freeglut-2.4.0-patched/src/freeglut_cursor.c       2005-09-15
02:32:55.000000000 +0200
 @@ -130,7 +130,9 @@
                      XCreateFontCursor( fgDisplay.Display, entry->cursorShape
);
              }
              cursor = entry->cachedCursor;
 -        } else {
 +          if (cursor == None)
 +              fgError( "Failed to create cursor" );
 +      } else {
              switch( cursorIDToUse )
              {
              case GLUT_CURSOR_NONE:
 @@ -147,9 +149,6 @@
              }
          }

 -        if ( ( cursorIDToUse != GLUT_CURSOR_NONE ) && ( cursor == None ) ) {
 -            fgError( "Failed to create cursor" );
 -        }
          XDefineCursor( fgDisplay.Display,
                         window->Window.Handle, cursor );
      }

------- Comment #1 From Andreas Schultes 2006-08-05 19:15:23 0000 -------
Created an attachment (id=93561) [details]
add patch 140542 to ebuild

------- Comment #2 From Andreas Schultes 2006-08-05 19:16:24 0000 -------
Created an attachment (id=93562) [details]
patch as attachment

------- Comment #3 From FieldySnuts 2006-09-14 12:22:28 0000 -------
Curiously, flightgear installed glut for me not freeglut. All I know is that
his doesn't work with freeglut, but mine does with glut.

I realize this doesn't help a whole lot, but it's all I can say. I do not know
why one user would get glut pulled in and another freeglut. Apparently this is
a common problem with freeglut + flightgear.

Portage 2.1.1 (default-linux/x86/2006.0, gcc-3.4.6/vanilla, glibc-2.3.6-r4,
2.6.17.11-reiser4-3 i686)
=================================================================
System uname: 2.6.17.11-reiser4-3 i686 AMD Athlon(TM) XP 1800+
Gentoo Base System version 1.12.4
Last Sync: Thu, 14 Sep 2006 01:50:01 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632)
[disabled]
ccache version 2.4 [enabled]
app-admin/eselect-compiler: 2.0.0_rc2-r1
dev-lang/python:     2.3.5, 2.4.3-r3
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r5
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-xp -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/NX/etc /usr/NX/home /usr/kde/3.5/env
/usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb
/usr/share/config /var/bind"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/eselect/compiler
/etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -march=athlon-xp -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache collision-protect distlocks metadata-transfer
parallel-fetch sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp.ussg.iu.edu/pub/linux/gentoo
http://gentoo.chem.wisc.edu/gentoo/ ftp://gentoo.chem.wisc.edu/gentoo/
ftp://gentoo.mirrors.tds.net/gentoo http://mirror.datapipe.net/gentoo"
LINGUAS="en"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress
--force --whole-file --delete --delete-after --stats --timeout=180
--exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://156.56.247.193/gentoo-portage"
USE="x86 3dnow X alsa am apache2 apm berkdb bitmap-fonts bzip2 cdr chroot cli
crypt dlloader dri dv dvd dvdr eds elibc_glibc emboss encode foomaticdb fortran
gdbm gif gnome gpm gstreamer gtk gtk2 hal imlib input_devices_keyboard
input_devices_mouse isdnlog jpeg kde kdeenablefinal kernel_linux libg++ libwww
linguas_en mad mikmod mmx motif mp3 mpeg ncurses nls nptl ogg oggvorbis opengl
oss pam pcre pdflib perl png pppd pwdb python qt3 qt4 quicktime readline
reflection sdl session spell spl sse ssl tiff truetype truetype-fonts
type1-fonts udev userland_GNU video_cards_nv vorbis xml xmms xorg xv zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS,
PORTAGE_RSYNC_EXTRA_OPTS

------- Comment #4 From Donnie Berkholz 2006-10-07 21:46:27 0000 -------
Is this patch in upstream CVS already?

------- Comment #5 From Tupone Alfredo 2006-10-08 02:16:57 0000 -------
I tested that freeglut works with that patch and does not work without.
I have not sent the patch upstream, but someone else may have done it, as 
that piece of code is changed in freeglut CVS (not exactly in the way the patch
suggests),
and from the flightgear site 
http://www.flightgear.org/Downloads/source.shtml
---
FreeGlut 2.4.0 has a critical bug that crashes FlightGear. If you plan to use
FreeGlut instead of SDL you will need to downgrade to 2.2.0 or run the CVS
version of FreeGlut.
---
So I don't think we ought too

------- Comment #6 From Donnie Berkholz 2006-10-10 19:23:04 0000 -------
Sorry, I missed your comment. Could you attach the version of the patch that's
in CVS?

------- Comment #7 From Tupone Alfredo 2006-10-11 12:08:08 0000 -------
Created an attachment (id=99381) [details]
freeglut-2.4.0-cursor.patch -- taken from freeglut cvs

Both patches work. 

This one, when I kill the fgfs window, still print the Function <glutSetCursor>
called without first calling 'glutInit'.

But except this annoying message, flightgear is ok

------- Comment #8 From Donnie Berkholz 2006-10-12 10:32:47 0000 -------
Fixed in 2.4.0-r1, thanks!

------- Comment #9 From Tupone Alfredo 2006-11-18 01:29:44 0000 -------
*** Bug 155550 has been marked as a duplicate of this bug. ***

------- Comment #10 From Tristan Heaven 2007-01-13 00:20:39 0000 -------
*** Bug 155276 has been marked as a duplicate of this bug. ***