Commit 4c9a32b25191b21e568f90831933143b49ab2917

henry 2004-10-10T10:45:37

Added cast to double operator

diff --git a/include/FTPoint.h b/include/FTPoint.h
index bb1772c..d2d677c 100755
--- a/include/FTPoint.h
+++ b/include/FTPoint.h
@@ -73,10 +73,16 @@ class FTGL_EXPORT FTPoint
          */
         friend bool operator != ( const FTPoint &a, const FTPoint &b);
         
+        operator FTGL_DOUBLE*()
+        {
+            return &x;
+        }
+        
         /**
          * The point data
          */
         FTGL_DOUBLE x, y, z; // FIXME make private
+//        FTGL_FLOAT x, y, z; // FIXME make private
         
     private:
 };
diff --git a/src/FTPoint.cpp b/src/FTPoint.cpp
index e4678bc..365f4df 100755
--- a/src/FTPoint.cpp
+++ b/src/FTPoint.cpp
@@ -10,5 +10,3 @@ bool operator != ( const FTPoint &a, const FTPoint &b)
 {
     return((a.x != b.x) || (a.y != b.y) || (a.z != b.z));
 }
-
-
diff --git a/test/FTPoint-Test.cpp b/test/FTPoint-Test.cpp
index 65be71a..aac49bd 100755
--- a/test/FTPoint-Test.cpp
+++ b/test/FTPoint-Test.cpp
@@ -84,11 +84,14 @@ class FTPointTest : public CppUnit::TestCase
         }
         
         
-        void testOperatorStar()
+        void testOperatorDouble()
         {
             FTPoint point1(  1.0f, 2.0f, 3.0f);
         
-//            double* pointer = point1;
+            double* pointer = static_cast<double*>(point1);
+            CPPUNIT_ASSERT(pointer[0] == 1.0f);
+            CPPUNIT_ASSERT(pointer[1] == 2.0f);
+            CPPUNIT_ASSERT(pointer[2] == 3.0f);
         }