Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Clarify and change the broken cygwin opengl logic:

- if /usr/include/GL is found then freeglut is tried
- else w32api native GLUT is tried.
- you must uninstall freeglut and its devel packages to use native GLUT



git-svn-id: https://svn.parrot.org/parrot/trunk@37202 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
commit 860bcca3ecb7c2460187471e7d6c8b4743f2b857 1 parent 3ce5d38
@rurban rurban authored
Showing with 32 additions and 22 deletions.
  1. +16 −10 README_cygwin.pod
  2. +16 −12 config/auto/opengl.pm
View
26 README_cygwin.pod
@@ -66,14 +66,20 @@ by not installing it or asking Parrot to ignore it (C<--without-icu>).
=item opengl
-You can use the w32api and opengl packages for native Windows opengl support,
-or the freeglut package for the X Server.
+Building is tricky:
-Configure.pl will detect freeglut if freeglut is installed and DISPLAY
-is set, otherwise it checks for w32api and opengl with GLUT.
-In case that freeglut is installed, DISPLAY must be set I<before> running
-Configure.pl. If not using freeglut, then DISPLAY must B<not> be set.
-C<export DISPLAY=127.0.0.1:0.0> is the typical setting.
+If the freeglut package for the X Server is installed, this
+is used, otherwise the w32api and opengl packages for native
+Windows opengl support are tried.
+
+In order to use the w32api native GLUT there must be no
+F</usr/include/GL> directory.
+
+The problem is that the L<NCI|pdds/draft/pdd16_native_call.pod>
+tries the header files to create the imports and not the
+libraries, and if the /usr/include/GL headers are found
+these are used, despite the w32api GLUT libraries are
+defined.
Determining if your platform supports OpenGL.............yes, freeglut 3.4.
Determining if your platform supports OpenGL...................yes, GLUT 3.
@@ -81,11 +87,11 @@ C<export DISPLAY=127.0.0.1:0.0> is the typical setting.
Required packages:
- w32api opengl
+ libglut-devel libGL-devel libGLU-devel libglut3 ...
-or
+or if C<libglut-devel> and C<libGL-devel> is not installed:
- freeglut libglut-devel xorg-x11-devel xorg-x11-base xorg-x11-bin-dlls
+ w32api opengl
=item SDL
View
28 config/auto/opengl.pm
@@ -110,20 +110,24 @@ GLUT 3.7.6,
see L<http://www.transmissionzero.co.uk/computing/using-glut-with-mingw/>.
-=head3 Cygwin/w32api
+=head3 Cygwin/X
-The Cygwin/w32api for native opengl support
+Requires a X server and F<libglut-devel>, F<libGL-devel>, F<libGLU-devel>,
+F<freeglut> and its dependencies.
-F<opengl>, F<w32api>
+This is tried first.
-=head3 Cygwin/X
+=head3 Cygwin/w32api
-Requires a X server.
+The Cygwin/w32api for native opengl support
+is only tried if F</usr/include/GL> does not exist.
-F<freeglut>, F<libglut-devel>, F<xorg-x11-devel>
+The problem is that the L<NCI|pdds/draft/pdd16_native_call.pod>
+tries the header files to create the imports and not the libraries,
+and if the F</usr/include/GL> headers are found these are used, despite
+the w32api GLUT libraries are defined.
-This is detected if freeglut is installed and DISPLAY is set.
-It requires an X server.
+F<opengl>, F<w32api>
=cut
@@ -164,10 +168,10 @@ sub runstep {
conf => $conf,
osname => $osname,
cc => $conf->data->get('cc'),
- # Prefer Cygwin/w32api over Cygwin/X, but use X when DISPLAY is set
- ($^O eq 'cygwin') ?
- ($ENV{DISPLAY} ? (cygwin => '-lglut -L/usr/X11R6/lib -lGLU -lGL')
- : (cygwin => '/usr/bin/glut32.dll -lglu32 -lopengl32'))
+ ($^O eq 'cygwin') ? # Cygwin/X is used when /usr/include/GL is found
+ (-d '/usr/include/GL'
+ ? (cygwin => '-lglut -L/usr/X11R6/lib -lGLU -lGL')
+ : (cygwin => '-lglut32 -lglu32 -lopengl32'))
: (),
win32_gcc => '-lglut32 -lglu32 -lopengl32',
win32_nongcc => 'opengl32.lib glu32.lib glut32.lib',
Please sign in to comment.
Something went wrong with that request. Please try again.