Commit 4c6baa27dd9d102eb4d760a7376dac2735abb4ea

henry 2004-10-10T22:50:01

Refactoring FTPoint

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
diff --git a/include/FTBBox.h b/include/FTBBox.h
index 7ff5301..672356d 100755
--- a/include/FTBBox.h
+++ b/include/FTBBox.h
@@ -80,12 +80,12 @@ class FTGL_EXPORT FTBBox
          */
         FTBBox& Move( FTPoint distance)
         {
-            lowerX += distance.x;
-            lowerY += distance.y;
-            lowerZ += distance.z;
-            upperX += distance.x;
-            upperY += distance.y;
-            upperZ += distance.z;
+            lowerX += distance.X();
+            lowerY += distance.Y();
+            lowerZ += distance.Z();
+            upperX += distance.X();
+            upperY += distance.Y();
+            upperZ += distance.Z();
             return *this;
         }
 
diff --git a/include/FTPoint.h b/include/FTPoint.h
index 6b93ad9..6bd6009 100755
--- a/include/FTPoint.h
+++ b/include/FTPoint.h
@@ -17,7 +17,6 @@ class FTGL_EXPORT FTPoint
          * Default constructor. Point is set to zero.
          */
         FTPoint()
-        : x(0), y(0), z(0)
         {
             elements[0] = 0;
             elements[1] = 0;
@@ -31,12 +30,11 @@ class FTGL_EXPORT FTPoint
          * @param Y
          * @param Z
          */
-        FTPoint( const FTGL_DOUBLE X, const FTGL_DOUBLE Y, const FTGL_DOUBLE Z)
-        : x(X), y(Y), z(Z)
+        FTPoint( const FTGL_DOUBLE x, const FTGL_DOUBLE y, const FTGL_DOUBLE z)
         {
-            elements[0] = X;
-            elements[1] = Y;
-            elements[2] = Z;
+            elements[0] = x;
+            elements[1] = y;
+            elements[2] = z;
         }
         
         /**
@@ -45,7 +43,6 @@ class FTGL_EXPORT FTPoint
          * @param ft_vector A freetype vector
          */
         FTPoint( const FT_Vector& ft_vector)
-        : x(ft_vector.x), y(ft_vector.y), z(0)
         {
             elements[0] = ft_vector.x;
             elements[1] = ft_vector.y;
@@ -60,13 +57,9 @@ class FTGL_EXPORT FTPoint
          */
         FTPoint& operator += ( const FTPoint& point)
         {
-            x += point.x;
-            y += point.y;
-            z += point.z;
-        
-            elements[0] = point.elements[0];
-            elements[1] = point.elements[1];
-            elements[2] = point.elements[2];
+            elements[0] += point.elements[0];
+            elements[1] += point.elements[1];
+            elements[2] += point.elements[2];
 
             return *this;
         }
@@ -89,25 +82,35 @@ class FTGL_EXPORT FTPoint
          */
         friend bool operator != ( const FTPoint &a, const FTPoint &b);
         
+        
+        /**
+         * Cast to FTGL_DOUBLE*
+         */
         operator FTGL_DOUBLE*()
         {
-            return &x;
+            return elements;
         }
         
+
+        /**
+         * Setters
+         */
         void X( FTGL_DOUBLE x) { elements[0] = x;};
         void Y( FTGL_DOUBLE y) { elements[1] = y;};
-        void Z( FTGL_DOUBLE x) { elements[2] = z;};
+        void Z( FTGL_DOUBLE z) { elements[2] = z;};
+
+
+        /**
+         * Getters
+         */
         FTGL_DOUBLE X() const { return elements[0];};
         FTGL_DOUBLE Y() const { return elements[1];};
         FTGL_DOUBLE Z() const { return elements[2];};
         
+    private:
         /**
          * The point data
          */
-        FTGL_DOUBLE x, y, z; // FIXME make private
-//        FTGL_FLOAT x, y, z; // FIXME make private
-        
-    private:
         FTGL_DOUBLE elements[3];
 };
 
diff --git a/src/FTBitmapGlyph.cpp b/src/FTBitmapGlyph.cpp
index 616a567..2c8f208 100755
--- a/src/FTBitmapGlyph.cpp
+++ b/src/FTBitmapGlyph.cpp
@@ -39,8 +39,8 @@ FTBitmapGlyph::FTBitmapGlyph( FT_GlyphSlot glyph)
         }
     }
     
-    pos.x = glyph->bitmap_left;
-    pos.y = static_cast<int>(srcHeight) - glyph->bitmap_top;
+    pos.X( glyph->bitmap_left);
+    pos.Y( static_cast<int>(srcHeight) - glyph->bitmap_top);
 }
 
 
@@ -52,7 +52,7 @@ FTBitmapGlyph::~FTBitmapGlyph()
 
 float FTBitmapGlyph::Render( const FTPoint& pen)
 {
-    glBitmap( 0, 0, 0.0f, 0.0f, pen.x + pos.x, pen.y - pos.y, (const GLubyte*)0 );
+    glBitmap( 0, 0, 0.0f, 0.0f, pen.X() + pos.X(), pen.Y() - pos.Y(), (const GLubyte*)0 );
     
     if( data)
     {
@@ -60,7 +60,7 @@ float FTBitmapGlyph::Render( const FTPoint& pen)
         glBitmap( destWidth, destHeight, 0.0f, 0.0, 0.0, 0.0, (const GLubyte*)data);
     }
     
-    glBitmap( 0, 0, 0.0f, 0.0f, -pos.x, pos.y, (const GLubyte*)0 );
+    glBitmap( 0, 0, 0.0f, 0.0f, -pos.X(), pos.Y(), (const GLubyte*)0 );
     
     return advance;
 }
diff --git a/src/FTContour.cpp b/src/FTContour.cpp
index 6b0cf8a..9a575ff 100644
--- a/src/FTContour.cpp
+++ b/src/FTContour.cpp
@@ -99,13 +99,13 @@ FTContour::FTContour( FT_Vector* contour, char* pointTags, unsigned int numberOf
             
             while( nextPointTag == FT_Curve_Tag_Conic)
             {
-                nextPoint = FTPoint( static_cast<float>( controlPoint.x + nextPoint.x) * 0.5f,
-                                     static_cast<float>( controlPoint.y + nextPoint.y) * 0.5f,
+                nextPoint = FTPoint( static_cast<float>( controlPoint.X() + nextPoint.X()) * 0.5f,
+                                     static_cast<float>( controlPoint.Y() + nextPoint.Y()) * 0.5f,
                                      0);
 
-                controlPoints[0][0] = previousPoint.x; controlPoints[0][1] = previousPoint.y;
-                controlPoints[1][0] = controlPoint.x;  controlPoints[1][1] = controlPoint.y;
-                controlPoints[2][0] = nextPoint.x;     controlPoints[2][1] = nextPoint.y;
+                controlPoints[0][0] = previousPoint.X(); controlPoints[0][1] = previousPoint.Y();
+                controlPoints[1][0] = controlPoint.X();  controlPoints[1][1] = controlPoint.Y();
+                controlPoints[2][0] = nextPoint.X();     controlPoints[2][1] = nextPoint.Y();
                 
                 evaluateQuadraticCurve();
                 ++pointIndex;
@@ -120,9 +120,9 @@ FTContour::FTContour( FT_Vector* contour, char* pointTags, unsigned int numberOf
                                : pointTags[pointIndex + 1];
             }
             
-            controlPoints[0][0] = previousPoint.x; controlPoints[0][1] = previousPoint.y;
-            controlPoints[1][0] = controlPoint.x;  controlPoints[1][1] = controlPoint.y;
-            controlPoints[2][0] = nextPoint.x;     controlPoints[2][1] = nextPoint.y;
+            controlPoints[0][0] = previousPoint.X(); controlPoints[0][1] = previousPoint.Y();
+            controlPoints[1][0] = controlPoint.X();  controlPoints[1][1] = controlPoint.Y();
+            controlPoints[2][0] = nextPoint.X();     controlPoints[2][1] = nextPoint.Y();
             
             evaluateQuadraticCurve();
             continue;
@@ -136,10 +136,10 @@ FTContour::FTContour( FT_Vector* contour, char* pointTags, unsigned int numberOf
                                 ? pointList[0]
                                 : FTPoint( contour[pointIndex + 2]);
             
-            controlPoints[0][0] = previousPoint.x; controlPoints[0][1] = previousPoint.y;
-            controlPoints[1][0] = controlPoint.x;  controlPoints[1][1] = controlPoint.y;
-            controlPoints[2][0] = controlPoint2.x; controlPoints[2][1] = controlPoint2.y;
-            controlPoints[3][0] = nextPoint.x;     controlPoints[3][1] = nextPoint.y;
+            controlPoints[0][0] = previousPoint.X(); controlPoints[0][1] = previousPoint.Y();
+            controlPoints[1][0] = controlPoint.X();  controlPoints[1][1] = controlPoint.Y();
+            controlPoints[2][0] = controlPoint2.X(); controlPoints[2][1] = controlPoint2.Y();
+            controlPoints[3][0] = nextPoint.X();     controlPoints[3][1] = nextPoint.Y();
         
             evaluateCubicCurve();
             ++pointIndex;
diff --git a/src/FTExtrdGlyph.cpp b/src/FTExtrdGlyph.cpp
index f00a9e4..859834d 100644
--- a/src/FTExtrdGlyph.cpp
+++ b/src/FTExtrdGlyph.cpp
@@ -50,11 +50,11 @@ FTExtrdGlyph::FTExtrdGlyph( FT_GlyphSlot glyph, float d, bool useDisplayList)
             {
                 FTPoint point = subMesh->Point(pointIndex);
 
-                glTexCoord2f( point.x / horizontalTextureScale,
-                              point.y / verticalTextureScale);
+                glTexCoord2f( point.X() / horizontalTextureScale,
+                              point.Y() / verticalTextureScale);
                 
-                glVertex3f( point.x / 64.0f,
-                            point.y / 64.0f,
+                glVertex3f( point.X() / 64.0f,
+                            point.Y() / 64.0f,
                             0.0f);
             }
         glEnd();
@@ -74,11 +74,11 @@ FTExtrdGlyph::FTExtrdGlyph( FT_GlyphSlot glyph, float d, bool useDisplayList)
             {
                 FTPoint point = subMesh->Point(pointIndex);
 
-                glTexCoord2f( subMesh->Point(pointIndex).x / horizontalTextureScale,
-                              subMesh->Point(pointIndex).y / verticalTextureScale);
+                glTexCoord2f( subMesh->Point(pointIndex).X() / horizontalTextureScale,
+                              subMesh->Point(pointIndex).Y() / verticalTextureScale);
                 
-                glVertex3f( subMesh->Point( pointIndex).x / 64.0f,
-                            subMesh->Point( pointIndex).y / 64.0f,
+                glVertex3f( subMesh->Point( pointIndex).X() / 64.0f,
+                            subMesh->Point( pointIndex).Y() / 64.0f,
                             -depth);
             }
         glEnd();
@@ -100,23 +100,23 @@ FTExtrdGlyph::FTExtrdGlyph( FT_GlyphSlot glyph, float d, bool useDisplayList)
                 FTPoint point = contour->Point(pointIndex);
 
                 FTPoint normal = GetNormal( point, contour->Point(nextPointIndex));
-                glNormal3f( normal.x, normal.y, 0.0f);
+                glNormal3f( normal.X(), normal.Y(), 0.0f);
                 
                 if( contourFlag & ft_outline_reverse_fill)
                 {
-                    glTexCoord2f( point.x / horizontalTextureScale,
-                                  point.y / verticalTextureScale);
+                    glTexCoord2f( point.X() / horizontalTextureScale,
+                                  point.X() / verticalTextureScale);
                 
-                    glVertex3f( point.x / 64.0f, point.y / 64.0f, 0.0f);
-                    glVertex3f( point.x / 64.0f, point.y / 64.0f, -depth);
+                    glVertex3f( point.X() / 64.0f, point.Y() / 64.0f, 0.0f);
+                    glVertex3f( point.X() / 64.0f, point.Y() / 64.0f, -depth);
                 }
                 else
                 {
-                    glTexCoord2f( point.x / horizontalTextureScale,
-                                  point.y / verticalTextureScale);
+                    glTexCoord2f( point.X() / horizontalTextureScale,
+                                  point.Y() / verticalTextureScale);
                 
-                    glVertex3f( point.x / 64.0f, point.y / 64.0f, -depth);
-                    glVertex3f( point.x / 64.0f, point.y / 64.0f, 0.0f);
+                    glVertex3f( point.X() / 64.0f, point.Y() / 64.0f, -depth);
+                    glVertex3f( point.X() / 64.0f, point.Y() / 64.0f, 0.0f);
                 }
             }
         glEnd();
@@ -137,7 +137,7 @@ FTExtrdGlyph::~FTExtrdGlyph()
 
 float FTExtrdGlyph::Render( const FTPoint& pen)
 {
-    glTranslatef( pen.x, pen.y, 0);
+    glTranslatef( pen.X(), pen.Y(), 0);
     
     if( glList)
     {
@@ -150,8 +150,8 @@ float FTExtrdGlyph::Render( const FTPoint& pen)
 
 FTPoint FTExtrdGlyph::GetNormal( const FTPoint &a, const FTPoint &b)
 {
-    float vectorX = a.x - b.x;
-    float vectorY = a.y - b.y;
+    float vectorX = a.X() - b.X();
+    float vectorY = a.Y() - b.Y();
                               
     float length = sqrt( vectorX * vectorX + vectorY * vectorY );
     
diff --git a/src/FTFont.cpp b/src/FTFont.cpp
index d65d75d..0897556 100755
--- a/src/FTFont.cpp
+++ b/src/FTFont.cpp
@@ -245,7 +245,7 @@ float FTFont::Advance( const char* string)
 void FTFont::Render( const char* string )
 {
     const unsigned char* c = (unsigned char*)string;
-    pen.x = 0; pen.y = 0;
+    pen.X(0); pen.Y(0);
 
     while( *c)
     {
@@ -258,7 +258,7 @@ void FTFont::Render( const char* string )
 void FTFont::Render( const wchar_t* string )
 {
     const wchar_t* c = string;
-    pen.x = 0; pen.y = 0;
+    pen.X(0); pen.Y(0);
 
     while( *c)
     {
@@ -272,10 +272,10 @@ void FTFont::DoRender( const unsigned int chr, const unsigned int nextChr)
 {
     if(CheckGlyph( chr))
     {
-        FTPoint kernAdvance = glyphList->Render( chr, nextChr, pen);
+        pen = glyphList->Render( chr, nextChr, pen);
         
-        pen.x = kernAdvance.x;
-        pen.y = kernAdvance.y;
+//        pen.X( kernAdvance.X()); // FIXME replace kernAdvance with pen
+//        pen.y = kernAdvance.Y();
     }
 }
 
diff --git a/src/FTGlyphContainer.cpp b/src/FTGlyphContainer.cpp
index 2c1881b..6c498f6 100755
--- a/src/FTGlyphContainer.cpp
+++ b/src/FTGlyphContainer.cpp
@@ -65,7 +65,7 @@ float FTGlyphContainer::Advance( const unsigned int characterCode, const unsigne
     unsigned int left = charMap->FontIndex( characterCode);
     unsigned int right = charMap->FontIndex( nextCharacterCode);
 
-    float width = face->KernAdvance( left, right).x;
+    float width = face->KernAdvance( left, right).X();
     width += glyphs[charMap->GlyphListIndex( characterCode)]->Advance();
     
     return width;
@@ -87,7 +87,7 @@ FTPoint FTGlyphContainer::Render( const unsigned int characterCode, const unsign
         advance = glyphs[charMap->GlyphListIndex( characterCode)]->Render( penPosition);
     }
     
-    kernAdvance.x = advance + kernAdvance.x;
-//  kernAdvance.y = advance.y + kernAdvance.y;
+    kernAdvance.X( advance + kernAdvance.X());
+//  kernAdvance.Y( advance.y + kernAdvance.X());
     return kernAdvance;
 }
diff --git a/src/FTOutlineGlyph.cpp b/src/FTOutlineGlyph.cpp
index 80b5a86..1a0fe44 100644
--- a/src/FTOutlineGlyph.cpp
+++ b/src/FTOutlineGlyph.cpp
@@ -34,7 +34,7 @@ FTOutlineGlyph::FTOutlineGlyph( FT_GlyphSlot glyph, bool useDisplayList)
             for( unsigned int pointIndex = 0; pointIndex < contour->PointCount(); ++pointIndex)
             {
                 FTPoint point = contour->Point(pointIndex);
-                glVertex2f( point.x / 64.0f, point.y / 64.0f);
+                glVertex2f( point.X() / 64.0f, point.Y() / 64.0f);
             }
         glEnd();
     }
@@ -54,7 +54,7 @@ FTOutlineGlyph::~FTOutlineGlyph()
 
 float FTOutlineGlyph::Render( const FTPoint& pen)
 {
-    glTranslatef( pen.x, pen.y, 0.0f);
+    glTranslatef( pen.X(), pen.Y(), 0.0f);
 
     if( glList)
     {
diff --git a/src/FTPixmapGlyph.cpp b/src/FTPixmapGlyph.cpp
index 6105ffa..a8ecd6c 100755
--- a/src/FTPixmapGlyph.cpp
+++ b/src/FTPixmapGlyph.cpp
@@ -72,8 +72,8 @@ FTPixmapGlyph::FTPixmapGlyph( FT_GlyphSlot glyph)
         destHeight = srcHeight;
     }
 
-    pos.x = glyph->bitmap_left;
-    pos.y = srcHeight - glyph->bitmap_top;
+    pos.X( glyph->bitmap_left);
+    pos.Y( srcHeight - glyph->bitmap_top);
 }
 
 
@@ -85,7 +85,7 @@ FTPixmapGlyph::~FTPixmapGlyph()
 
 float FTPixmapGlyph::Render( const FTPoint& pen)
 {
-    glBitmap( 0, 0, 0.0f, 0.0f, pen.x + pos.x, pen.y - pos.y, (const GLubyte*)0);
+    glBitmap( 0, 0, 0.0f, 0.0f, pen.X() + pos.X(), pen.Y() - pos.Y(), (const GLubyte*)0);
     
     if( data)
     {
@@ -93,7 +93,7 @@ float FTPixmapGlyph::Render( const FTPoint& pen)
         glDrawPixels( destWidth, destHeight, GL_RGBA, GL_UNSIGNED_BYTE, (const GLvoid*)data);
     }
         
-    glBitmap( 0, 0, 0.0f, 0.0f, -pos.x, pos.y, (const GLubyte*)0);
+    glBitmap( 0, 0, 0.0f, 0.0f, -pos.X(), pos.Y(), (const GLubyte*)0);
 
     return advance;
 }
diff --git a/src/FTPoint.cpp b/src/FTPoint.cpp
index 633c780..284a810 100755
--- a/src/FTPoint.cpp
+++ b/src/FTPoint.cpp
@@ -4,11 +4,9 @@
 bool operator == ( const FTPoint &a, const FTPoint &b) 
 {
     return((a.elements[0] == b.elements[0]) && (a.elements[1] == b.elements[1]) && (a.elements[2] == b.elements[2]));
-//    return((a.x == b.x) && (a.y == b.y) && (a.z == b.z));
 }
 
 bool operator != ( const FTPoint &a, const FTPoint &b) 
 {
     return((a.elements[0] != b.elements[0]) || (a.elements[1] != b.elements[1]) || (a.elements[2] != b.elements[2]));
-//    return((a.x != b.x) || (a.y != b.y) || (a.z != b.z));
 }
diff --git a/src/FTPolyGlyph.cpp b/src/FTPolyGlyph.cpp
index b56b6e4..845b1c9 100644
--- a/src/FTPolyGlyph.cpp
+++ b/src/FTPolyGlyph.cpp
@@ -41,11 +41,11 @@ FTPolyGlyph::FTPolyGlyph( FT_GlyphSlot glyph, bool useDisplayList)
             {
                 FTPoint point = subMesh->Point(pointIndex);
                 
-                glTexCoord2f( point.x / horizontalTextureScale,
-                              point.y / verticalTextureScale);
+                glTexCoord2f( point.X() / horizontalTextureScale,
+                              point.Y() / verticalTextureScale);
                 
-                glVertex3f( point.x / 64.0f,
-                            point.y / 64.0f,
+                glVertex3f( point.X() / 64.0f,
+                            point.Y() / 64.0f,
                             0.0f);
             }
         glEnd();
@@ -66,7 +66,7 @@ FTPolyGlyph::~FTPolyGlyph()
 
 float FTPolyGlyph::Render( const FTPoint& pen)
 {
-    glTranslatef(  pen.x,  pen.y, 0.0f);
+    glTranslatef(  pen.X(),  pen.Y(), 0.0f);
 
     if( glList)
     {
diff --git a/src/FTTextureGlyph.cpp b/src/FTTextureGlyph.cpp
index 1ceb3ce..3f21cde 100755
--- a/src/FTTextureGlyph.cpp
+++ b/src/FTTextureGlyph.cpp
@@ -41,13 +41,13 @@ FTTextureGlyph::FTTextureGlyph( FT_GlyphSlot glyph, int id, int xOffset, int yOf
 //      +----+
 //           1
     
-    uv[0].x = static_cast<float>(xOffset) / static_cast<float>(width);
-    uv[0].y = static_cast<float>(yOffset) / static_cast<float>(height);
-    uv[1].x = static_cast<float>( xOffset + destWidth) / static_cast<float>(width);
-    uv[1].y = static_cast<float>( yOffset + destHeight) / static_cast<float>(height);
+    uv[0].X( static_cast<float>(xOffset) / static_cast<float>(width));
+    uv[0].Y( static_cast<float>(yOffset) / static_cast<float>(height));
+    uv[1].X( static_cast<float>( xOffset + destWidth) / static_cast<float>(width));
+    uv[1].Y( static_cast<float>( yOffset + destHeight) / static_cast<float>(height));
     
-    pos.x = glyph->bitmap_left;
-    pos.y = glyph->bitmap_top;
+    pos.X( glyph->bitmap_left);
+    pos.Y( glyph->bitmap_top);
 }
 
 
@@ -63,20 +63,20 @@ float FTTextureGlyph::Render( const FTPoint& pen)
         activeTextureID = glTextureID;
     }
     
-    glTranslatef(  pen.x,  pen.y, 0);
+    glTranslatef( pen.X(),  pen.Y(), 0.0f);
 
     glBegin( GL_QUADS);
-        glTexCoord2f( uv[0].x, uv[0].y);
-        glVertex2f( pos.x, pos.y);
+        glTexCoord2f( uv[0].X(), uv[0].Y());
+        glVertex2f( pos.X(), pos.Y());
 
-        glTexCoord2f( uv[0].x, uv[1].y);
-        glVertex2f( pos.x, pos.y - destHeight);
+        glTexCoord2f( uv[0].X(), uv[1].Y());
+        glVertex2f( pos.X(), pos.Y() - destHeight);
 
-        glTexCoord2f( uv[1].x, uv[1].y);
-        glVertex2f( destWidth + pos.x, pos.y - destHeight);
+        glTexCoord2f( uv[1].X(), uv[1].Y());
+        glVertex2f( destWidth + pos.X(), pos.Y() - destHeight);
         
-        glTexCoord2f( uv[1].x, uv[0].y);
-        glVertex2f( destWidth + pos.x, pos.y);
+        glTexCoord2f( uv[1].X(), uv[0].Y());
+        glVertex2f( destWidth + pos.X(), pos.Y());
     glEnd();
 
     return advance;
diff --git a/src/FTVectoriser.cpp b/src/FTVectoriser.cpp
index 9dc14bc..8fd1a7e 100644
--- a/src/FTVectoriser.cpp
+++ b/src/FTVectoriser.cpp
@@ -76,7 +76,8 @@ void FTMesh::AddPoint( const FTGL_DOUBLE x, const FTGL_DOUBLE y, const FTGL_DOUB
 FTGL_DOUBLE* FTMesh::Combine( const FTGL_DOUBLE x, const FTGL_DOUBLE y, const FTGL_DOUBLE z)
 {
     tempPointList.push_back( FTPoint( x, y,z));
-    return &tempPointList.back().x;
+//    return &tempPointList.back().X();
+    return static_cast<FTGL_DOUBLE*>(tempPointList.back());
 }
 
 
@@ -211,7 +212,8 @@ void FTVectoriser::MakeMesh( FTGL_DOUBLE zNormal)
             
                 for( size_t p = 0; p < contour->PointCount(); ++p)
                 {
-                    FTGL_DOUBLE* d = const_cast<FTGL_DOUBLE*>(&contour->Point(p).x);
+                    FTPoint point = contour->Point(p);
+                    FTGL_DOUBLE* d = static_cast<FTGL_DOUBLE*>(point);
                     gluTessVertex( tobj, d, d);
                 }
 
diff --git a/test/FTFace-Test.cpp b/test/FTFace-Test.cpp
index 44e4122..0f09355 100755
--- a/test/FTFace-Test.cpp
+++ b/test/FTFace-Test.cpp
@@ -99,14 +99,14 @@ class FTFaceTest : public CppUnit::TestCase
         {
             FTFace test(ARIAL_FONT_FILE);
             FTPoint kerningVector = test.KernAdvance( 'A', 'A');
-            CPPUNIT_ASSERT( kerningVector.x == 0);
-            CPPUNIT_ASSERT( kerningVector.y == 0);
-            CPPUNIT_ASSERT( kerningVector.z == 0);
+            CPPUNIT_ASSERT( kerningVector.X() == 0);
+            CPPUNIT_ASSERT( kerningVector.Y() == 0);
+            CPPUNIT_ASSERT( kerningVector.Z() == 0);
         
             kerningVector = test.KernAdvance( 0x6FB3, 0x9580);
-            CPPUNIT_ASSERT( kerningVector.x == 0);
-            CPPUNIT_ASSERT( kerningVector.y == 0);
-            CPPUNIT_ASSERT( kerningVector.z == 0);
+            CPPUNIT_ASSERT( kerningVector.X() == 0);
+            CPPUNIT_ASSERT( kerningVector.Y() == 0);
+            CPPUNIT_ASSERT( kerningVector.Z() == 0);
         }
         
         
diff --git a/test/FTGlyphContainer-Test.cpp b/test/FTGlyphContainer-Test.cpp
index e02aee0..1134941 100755
--- a/test/FTGlyphContainer-Test.cpp
+++ b/test/FTGlyphContainer-Test.cpp
@@ -95,7 +95,7 @@ class FTGlyphContainerTest : public CppUnit::TestCase
             
             FTPoint pen;
             
-            float advance = glyphContainer->Render( 'A', 0, pen).x;
+            float advance = glyphContainer->Render( 'A', 0, pen).X();
             
             CPPUNIT_ASSERT_DOUBLES_EQUAL( 50, advance, 0.01);
         }
diff --git a/test/FTMesh-Test.cpp b/test/FTMesh-Test.cpp
index 38e6ddc..42b19d0 100755
--- a/test/FTMesh-Test.cpp
+++ b/test/FTMesh-Test.cpp
@@ -113,10 +113,10 @@ class FTMeshTest : public CppUnit::TestCase
             
             for( x = 0; x < 200; ++x)
             {
-                ftglCombine( testPoint, NULL, NULL, (void**)hole, &mesh);            
+                ftglCombine( testPoint, NULL, NULL, (void**)hole, &mesh);
             }
 
-            CPPUNIT_ASSERT( *testOutput == &(mesh.TempPointList().front().x));
+            CPPUNIT_ASSERT( *testOutput == static_cast<FTGL_DOUBLE*>(mesh.TempPointList().front()));
             
             for( x = 201; x < 300; ++x)
             {
@@ -125,7 +125,7 @@ class FTMeshTest : public CppUnit::TestCase
 
             ftglEnd( &mesh);
             
-            CPPUNIT_ASSERT( *testOutput == &(mesh.TempPointList().front().x));
+            CPPUNIT_ASSERT( *testOutput == static_cast<FTGL_DOUBLE*>(mesh.TempPointList().front()));
         }
         
         void setUp() 
diff --git a/test/FTPoint-Test.cpp b/test/FTPoint-Test.cpp
index f7a0234..af3b3d0 100755
--- a/test/FTPoint-Test.cpp
+++ b/test/FTPoint-Test.cpp
@@ -28,15 +28,15 @@ class FTPointTest : public CppUnit::TestCase
         {
             FTPoint point1;
 
-            CPPUNIT_ASSERT( point1.x == 0.0f);
-            CPPUNIT_ASSERT( point1.y == 0.0f);
-            CPPUNIT_ASSERT( point1.z == 0.0f);
+            CPPUNIT_ASSERT( point1.X() == 0.0f);
+            CPPUNIT_ASSERT( point1.Y() == 0.0f);
+            CPPUNIT_ASSERT( point1.Z() == 0.0f);
             
             FTPoint point2( 1.0f, 2.0f, 3.0f);
 
-            CPPUNIT_ASSERT( point2.x == 1.0f);
-            CPPUNIT_ASSERT( point2.y == 2.0f);
-            CPPUNIT_ASSERT( point2.z == 3.0f);
+            CPPUNIT_ASSERT( point2.X() == 1.0f);
+            CPPUNIT_ASSERT( point2.Y() == 2.0f);
+            CPPUNIT_ASSERT( point2.Z() == 3.0f);
             
             FT_Vector ftVector;
             ftVector.x = 4;
@@ -44,9 +44,9 @@ class FTPointTest : public CppUnit::TestCase
             
             FTPoint point3( ftVector);
             
-            CPPUNIT_ASSERT( point3.x ==  4.0f);
-            CPPUNIT_ASSERT( point3.y == 23.0f);
-            CPPUNIT_ASSERT( point3.z ==  0.0f); 
+            CPPUNIT_ASSERT( point3.X() ==  4.0f);
+            CPPUNIT_ASSERT( point3.Y() == 23.0f);
+            CPPUNIT_ASSERT( point3.Z() ==  0.0f); 
         }
 
         
@@ -99,11 +99,11 @@ class FTPointTest : public CppUnit::TestCase
         void testSetters()
         {
             FTPoint point;
-            FTPoint point1( 1.0, 2.0, 3.0);
+            FTPoint point1( 1, 2, 3);
             
-            point.X(1.0);
-            point.Y(2.0);
-            point.Z(3.0);
+            point.X(1);
+            point.Y(2);
+            point.Z(3);
             
             CPPUNIT_ASSERT(point == point1);
         }
diff --git a/test/FTVectoriser-Test.cpp b/test/FTVectoriser-Test.cpp
index 848ce98..af5495b 100755
--- a/test/FTVectoriser-Test.cpp
+++ b/test/FTVectoriser-Test.cpp
@@ -364,8 +364,8 @@ class FTVectoriserTest : public CppUnit::TestCase
                 
                 for( size_t p = 0; p < contour->PointCount(); ++p)
                 {
-                    CPPUNIT_ASSERT_DOUBLES_EQUAL( *(testOutline + d),     contour->Point(p).x / 64.0f, 0.01);
-                    CPPUNIT_ASSERT_DOUBLES_EQUAL( *(testOutline + d + 1), contour->Point(p).y / 64.0f, 0.01);
+                    CPPUNIT_ASSERT_DOUBLES_EQUAL( *(testOutline + d),     contour->Point(p).X() / 64.0f, 0.01);
+                    CPPUNIT_ASSERT_DOUBLES_EQUAL( *(testOutline + d + 1), contour->Point(p).Y() / 64.0f, 0.01);
                     d += 3;
                 }
             }
@@ -412,8 +412,8 @@ class FTVectoriserTest : public CppUnit::TestCase
 
                 for( unsigned int x = 0; x < numberOfVertices; ++x)
                 {
-                    CPPUNIT_ASSERT_DOUBLES_EQUAL( *(testMesh + d),     subMesh->Point(x).x / 64, 0.01);
-                    CPPUNIT_ASSERT_DOUBLES_EQUAL( *(testMesh + d + 1), subMesh->Point(x).y / 64, 0.01);
+                    CPPUNIT_ASSERT_DOUBLES_EQUAL( *(testMesh + d),     subMesh->Point(x).X() / 64, 0.01);
+                    CPPUNIT_ASSERT_DOUBLES_EQUAL( *(testMesh + d + 1), subMesh->Point(x).Y() / 64, 0.01);
                     d += 3;
                 }
             }