Text archives Help
- From: bigler@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r341 - in trunk: . Engine/Control Model/Primitives Readers/BART UserInterface
- Date: Tue, 24 May 2005 14:56:47 -0600 (MDT)
Author: bigler
Date: Tue May 24 14:56:42 2005
New Revision: 341
Modified:
trunk/CMakeLists.txt
trunk/Engine/Control/RTRT.cc
trunk/Model/Primitives/Heightfield.cc
trunk/Readers/BART/animation.c
trunk/UserInterface/XWindowUI.cc
Log:
Fixes for Cygwin/X11 port. You need X11 and OpenGL for Cygwin to get
this to compile.
Readers/BART/animation.c
Use -MAXFLOAT instead of -HUGE until someone figures out what
the appropiate macro is.
UserInterface/XWindowUI.cc
Include <sys/select.h> for the select system call. This may
need to be updated for IRIX systems.
Model/Primitives/Heightfield.cc
Cast m_Nx and m_Ny to int for assignment to stop. This fixes
a crytic warning message about assigning a -1 to an unsigned
int (m_Nx and m_Ny are the unsigned ints and stop is an int).
Engine/Control/RTRT.cc
Better guessing on shared lib file extension and printout.
#if 0'ed out a redundant call to readMOScene. I'm not sure if
it needed at all, so it's in here to remind me.
CMakeLists.txt
Force Cygwin to use the X versions of OpenGL. CMake perfers
the windows version of OpenGL over the X version and this
causes problems when you want to use GLX.
Modified: trunk/CMakeLists.txt
==============================================================================
--- trunk/CMakeLists.txt (original)
+++ trunk/CMakeLists.txt Tue May 24 14:56:42 2005
@@ -9,6 +9,13 @@
SET (OPENGL_glu_LIBRARY /usr/X11R6/lib/libGLU.dylib)
ENDIF (APPLE)
+IF (CYGWIN)
+# MESSAGE("Using Cygwin/X11 OpenGL")
+ SET (OPENGL_INCLUDE_DIR /usr/X11R6/include)
+ SET (OPENGL_gl_LIBRARY /usr/X11R6/lib/libGL.dll)
+ SET (OPENGL_glu_LIBRARY /usr/X11R6/lib/libGLU.dll)
+ENDIF (CYGWIN)
+
INCLUDE (${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/FindThreads.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/FindX11.cmake)
Modified: trunk/Engine/Control/RTRT.cc
==============================================================================
--- trunk/Engine/Control/RTRT.cc (original)
+++ trunk/Engine/Control/RTRT.cc Tue May 24 14:56:42 2005
@@ -931,24 +931,39 @@
}
Scene* newScene = 0;
+ // These are to try and guess what the shared library extension is
+ // on various systems.
+ string system_suffix;
+#if defined (__APPLE__)
+ system_suffix = "dylib";
+#elif defined (_WIN32) || defined (__CYGWIN__)
+ system_suffix = "dll";
+#else
+ system_suffix = "so";
+#endif
+
std::cout << "Scene suffix: " << suffix << std::endl;
- if((suffix == "mo") || (suffix == "so") || (suffix == "dylib")) {
+ if((suffix == "mo") || (suffix == "so") || (suffix == "dylib") ||
+ (suffix == "dll")) {
// Do this twice - once silently and once printing errors
- std::cout << "Reading .mo or .so scene" << std::endl;
+ std::cout << "Reading "<<suffix<<" scene\n";
newScene = readMOScene(name, args, false);
if(!newScene)
readMOScene(name, args, true);
} else {
// Try reading it as an MO
- std::cout << "Appending .mo to scene" << std::endl;
+ std::cout << "Appending "<<system_suffix<<" to scene" << std::endl;
- newScene = readMOScene(name+".mo", args, false);
+ newScene = readMOScene(name+"."+system_suffix, args, false);
+#if 0
+ // This looks redundant, going to nix it.
if(!newScene){
- readMOScene(name+".mo", args, true);
+ readMOScene(name+".so", args, true);
}
+#endif
}
if(!newScene){
return false;
Modified: trunk/Model/Primitives/Heightfield.cc
==============================================================================
--- trunk/Model/Primitives/Heightfield.cc (original)
+++ trunk/Model/Primitives/Heightfield.cc Tue May 24 14:56:42 2005
@@ -124,9 +124,9 @@
else if (hitLattice[1] >= (int)m_Ny) hitLattice[1] = (int)(m_Ny-1);
di[0] = (diagonal.x() * ray.direction().x() > 0.0) ? 1 : -1;
- stop[0] = (di[0] == 1) ? m_Nx : -1;
+ stop[0] = (di[0] == 1) ? (int)m_Nx : -1;
di[1] = (diagonal.y() * ray.direction().y() > 0.0) ? 1 : -1;
- stop[1] = (di[1] == 1) ? m_Ny : -1;
+ stop[1] = (di[1] == 1) ? (int)m_Ny : -1;
dtd[0] = fabs(cellSize[0] / ray.direction().x());
dtd[1] = fabs(cellSize[1] / ray.direction().y());
Modified: trunk/Readers/BART/animation.c
==============================================================================
--- trunk/Readers/BART/animation.c (original)
+++ trunk/Readers/BART/animation.c Tue May 24 14:56:42 2005
@@ -163,7 +163,7 @@
#ifdef WIN32
float prevtime=-FLT_MAX;
#else
- float prevtime=-HUGE; /* minus infinity */
+ float prevtime=-MAXFLOAT; /* minus infinity */
#endif
VisKey *keys=(VisKey*)animation->visibilities;
for(q=0;q<animation->numVisibilities;q++)
Modified: trunk/UserInterface/XWindowUI.cc
==============================================================================
--- trunk/UserInterface/XWindowUI.cc (original)
+++ trunk/UserInterface/XWindowUI.cc Tue May 24 14:56:42 2005
@@ -12,10 +12,12 @@
#include <Core/Math/Trig.h>
#include <Core/Thread/Runnable.h>
#include <Core/Thread/Thread.h>
+
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include <errno.h>
#include <unistd.h>
+#include <sys/select.h>
#include <sgi_stl_warnings_off.h>
#include <iostream>
- [MANTA] r341 - in trunk: . Engine/Control Model/Primitives Readers/BART UserInterface, bigler, 05/24/2005
Archive powered by MHonArc 2.6.16.