ソースを参照

Removed function BarycentricCoordinates to GLS.Coordinate unit

GLScene 3 年 前
コミット
623fb3f251
46 ファイル変更513 行追加520 行削除
  1. 5 0
      AdvDemos/Earth/fEarthD.dfm
  2. 16 14
      AdvDemos/Earth/fEarthD.pas
  3. 2 2
      AdvDemos/GLSViewer/Source/fMain.pas
  4. 1 1
      Demos/behaviours/Torque/fTorqueD.pas
  5. 6 6
      Demos/graph/heightfield/fHeightFieldD.pas
  6. 5 5
      Demos/materials/TransparencyAdvanced/fTransparencyAdv.pas
  7. 2 2
      Demos/materials/multipass/fMultiPassD.pas
  8. 2 2
      Demos/materials/multipass/fMultipassC.h
  9. 1 1
      Demos/meshes/actor/fActorD.dfm
  10. 1 1
      Demos/meshes/formula/fFormulaC.cpp
  11. 1 1
      Demos/meshes/formula/fFormulaC.h
  12. 2 2
      Demos/meshes/formula/fFormulaD.pas
  13. 1 1
      Demos/movements/objmove/fObjmoveC.cpp
  14. 1 1
      Demos/movements/objmove/fObjmoveD.pas
  15. 1 1
      Demos/physics/NewtonWalkCarry/fNewtonWalkCarryD.pas
  16. 1 2
      Demos/specialsFX/Atmosphere/AtmosphereC.cbproj
  17. 1 1
      Demos/specialsFX/Atmosphere/fAtmosphereC.h
  18. 8 8
      Packages/GLScene_Cg_DT.dproj
  19. 3 3
      Source/GLS.Atmosphere.pas
  20. 4 4
      Source/GLS.BitmapFont.pas
  21. 10 10
      Source/GLS.Canvas.pas
  22. 197 197
      Source/GLS.Color.pas
  23. 136 99
      Source/GLS.Coordinates.pas
  24. 1 1
      Source/GLS.Extrusion.pas
  25. 3 3
      Source/GLS.FBORenderer.pas
  26. 4 4
      Source/GLS.FileMS3D.pas
  27. 2 2
      Source/GLS.FireFX.pas
  28. 1 1
      Source/GLS.GameMenu.pas
  29. 7 7
      Source/GLS.Graph.pas
  30. 2 2
      Source/GLS.LensFlare.pas
  31. 1 1
      Source/GLS.LinePFX.pas
  32. 2 2
      Source/GLS.MaterialEx.pas
  33. 4 4
      Source/GLS.Mesh.pas
  34. 1 1
      Source/GLS.MeshBSP.pas
  35. 1 1
      Source/GLS.Mirror.pas
  36. 10 7
      Source/GLS.Objects.pas
  37. 8 8
      Source/GLS.ParticleFX.pas
  38. 29 29
      Source/GLS.RandomHDS.pas
  39. 1 1
      Source/GLS.RenderContextInfo.pas
  40. 3 3
      Source/GLS.SceneRegister.pas
  41. 1 1
      Source/GLS.ShadowPlane.pas
  42. 12 9
      Source/GLS.SkyDome.pas
  43. 1 1
      Source/GLS.ThorFX.pas
  44. 0 56
      Source/GLS.VectorGeometry.pas
  45. 11 11
      Source/GLS.Windows.pas
  46. 1 1
      Source/GLSL.BumpShaders.pas

+ 5 - 0
AdvDemos/Earth/fEarthD.dfm

@@ -67,6 +67,10 @@ object Form1: TForm1
         SplineMode = lsmSegments
         SplineMode = lsmSegments
         Options = []
         Options = []
       end
       end
+      object ConstellationBorders: TGLLines
+        Nodes = <>
+        Options = []
+      end
     end
     end
     object DCEarthSystem: TGLDummyCube
     object DCEarthSystem: TGLDummyCube
       ObjectsSorting = osNone
       ObjectsSorting = osNone
@@ -108,6 +112,7 @@ object Form1: TForm1
         Material.MaterialLibrary = GLMaterialLibrary
         Material.MaterialLibrary = GLMaterialLibrary
         Material.LibMaterialName = 'earthDay'
         Material.LibMaterialName = 'earthDay'
         Direction.Coordinates = {000000000000803F0000000000000000}
         Direction.Coordinates = {000000000000803F0000000000000000}
+        ShowAxes = True
         TurnAngle = -150.000000000000000000
         TurnAngle = -150.000000000000000000
         Up.Coordinates = {00000000000000800000803F00000000}
         Up.Coordinates = {00000000000000800000803F00000000}
         Radius = 0.500000000000000000
         Radius = 0.500000000000000000

+ 16 - 14
AdvDemos/Earth/fEarthD.pas

@@ -55,6 +55,7 @@ type
     GLCameraControler: TGLCamera;
     GLCameraControler: TGLCamera;
     GLSkyDome: TGLSkyDome;
     GLSkyDome: TGLSkyDome;
     ConstellationLines: TGLLines;
     ConstellationLines: TGLLines;
+    ConstellationBorders: TGLLines;
     procedure FormCreate(Sender: TObject);
     procedure FormCreate(Sender: TObject);
     procedure GLDirectOpenGL1Render(Sender: TObject; var rci: TGLRenderContextInfo);
     procedure GLDirectOpenGL1Render(Sender: TObject; var rci: TGLRenderContextInfo);
     procedure Timer1Timer(Sender: TObject);
     procedure Timer1Timer(Sender: TObject);
@@ -71,7 +72,7 @@ type
     procedure GLSceneViewerBeforeRender(Sender: TObject);
     procedure GLSceneViewerBeforeRender(Sender: TObject);
   private
   private
     procedure LoadConstellationLines;
     procedure LoadConstellationLines;
-    function AtmosphereColor(const rayStart, rayEnd: TGLVector): TColorVector;
+    function AtmosphereColor(const rayStart, rayEnd: TGLVector): TGLColorVector;
   public
   public
     ConstellationsAlpha: Single;
     ConstellationsAlpha: Single;
     TimeMultiplier: Single;
     TimeMultiplier: Single;
@@ -92,8 +93,8 @@ const
   cAtmosphereRadius: Single = 0.55;
   cAtmosphereRadius: Single = 0.55;
   // use value slightly lower than actual radius, for antialiasing effect
   // use value slightly lower than actual radius, for antialiasing effect
   cPlanetRadius: Single = 0.495;
   cPlanetRadius: Single = 0.495;
-  cLowAtmColor: TColorVector = (X:1; Y:1; Z:1; W:1);
-  cHighAtmColor: TColorVector = (X:0; Y:0; Z:1; W:1);
+  cLowAtmColor: TGLColorVector = (X:1; Y:1; Z:1; W:1);
+  cHighAtmColor: TGLColorVector = (X:0; Y:0; Z:1; W:1);
   cIntDivTable: array[2..20] of Single =
   cIntDivTable: array[2..20] of Single =
     (1 / 2, 1 / 3, 1 / 4, 1 / 5, 1 / 6, 1 / 7, 1 / 8, 1 / 9, 1 / 10,
     (1 / 2, 1 / 3, 1 / 4, 1 / 5, 1 / 6, 1 / 7, 1 / 8, 1 / 9, 1 / 10,
     1 / 11, 1 / 12, 1 / 13, 1 / 14, 1 / 15, 1 / 16, 1 / 17, 1 / 18, 1 / 19, 1 / 20);
     1 / 11, 1 / 12, 1 / 13, 1 / 14, 1 / 15, 1 / 16, 1 / 17, 1 / 18, 1 / 19, 1 / 20);
@@ -130,11 +131,11 @@ begin
 end;
 end;
 
 
 function TForm1.AtmosphereColor(const rayStart, rayEnd: TGLVector)
 function TForm1.AtmosphereColor(const rayStart, rayEnd: TGLVector)
-  : TColorVector;
+  : TGLColorVector;
 var
 var
   i, n: Integer;
   i, n: Integer;
   atmPoint, normal: TGLVector;
   atmPoint, normal: TGLVector;
-  altColor: TColorVector;
+  altColor: TGLColorVector;
   alt, rayLength, contrib, decay, intensity, invN: Single;
   alt, rayLength, contrib, decay, intensity, invN: Single;
 
 
 begin
 begin
@@ -177,7 +178,7 @@ end;
 
 
 procedure TForm1.GLDirectOpenGL1Render(Sender: TObject; var rci: TGLRenderContextInfo);
 procedure TForm1.GLDirectOpenGL1Render(Sender: TObject; var rci: TGLRenderContextInfo);
 
 
-  function ComputeColor(var rayDest: TGLVector; mayHitGround: Boolean): TColorVector;
+  function ComputeColor(var rayDest: TGLVector; mayHitGround: Boolean): TGLColorVector;
   var
   var
     ai1, ai2, pi1, pi2: TGLVector;
     ai1, ai2, pi1, pi2: TGLVector;
     rayVector: TGLVector;
     rayVector: TGLVector;
@@ -241,8 +242,7 @@ begin
     k1 := (cSlices + 1) - k0;
     k1 := (cSlices + 1) - k0;
     for j := 0 to cSlices do
     for j := 0 to cSlices do
     begin
     begin
-      VectorCombine(diskRight, diskUp,
-        cosCache[j] * radius, sinCache[j] * radius,
+      VectorCombine(diskRight, diskUp, cosCache[j] * radius, sinCache[j] * radius,
         pVertex[k0 + j]);
         pVertex[k0 + j]);
       if i < 13 then
       if i < 13 then
         pColor[k0 + j] := ComputeColor(pVertex[k0 + j], i <= 7);
         pColor[k0 + j] := ComputeColor(pVertex[k0 + j], i <= 7);
@@ -316,6 +316,7 @@ begin
   sl := TStringList.Create;
   sl := TStringList.Create;
   line := TStringList.Create;
   line := TStringList.Create;
   sl.LoadFromFile('Data\Constellations.dat');
   sl.LoadFromFile('Data\Constellations.dat');
+//  sl.LoadFromFile('Data\Constellation_borders.dat');
   for i := 0 to sl.Count - 1 do
   for i := 0 to sl.Count - 1 do
   begin
   begin
     line.CommaText := sl[i];
     line.CommaText := sl[i];
@@ -372,12 +373,13 @@ begin
     cameraTimeSteps := cameraTimeSteps - 0.005;
     cameraTimeSteps := cameraTimeSteps - 0.005;
   end;
   end;
   // smooth constellation appearance/disappearance
   // smooth constellation appearance/disappearance
-  with ConstellationLines.LineColor do
-    if Alpha <> constellationsAlpha then
-    begin
-      Alpha := ClampValue(Alpha + Sign(constellationsAlpha - Alpha) * deltaTime, 0, 0.5);
-      ConstellationLines.Visible := (Alpha > 0);
-    end;
+  if ConstellationLines.LineColor.Alpha <> constellationsAlpha then
+  begin
+    ConstellationLines.LineColor.Alpha :=
+      ClampValue(ConstellationLines.LineColor.Alpha + Sign(constellationsAlpha -
+                 ConstellationLines.LineColor.Alpha) * deltaTime, 0, 0.5);
+    ConstellationLines.Visible := (ConstellationLines.LineColor.Alpha > 0);
+  end;
 end;
 end;
 
 
 procedure TForm1.GLSceneViewerMouseDown(Sender: TObject;
 procedure TForm1.GLSceneViewerMouseDown(Sender: TObject;

+ 2 - 2
AdvDemos/GLSViewer/Source/fMain.pas

@@ -248,8 +248,8 @@ type
   // Hidden line shader (specific implem for the viewer, *not* generic)
   // Hidden line shader (specific implem for the viewer, *not* generic)
   THiddenLineShader = class(TGLShader)
   THiddenLineShader = class(TGLShader)
   private
   private
-    LinesColor: TColorVector;
-    BackgroundColor: TColorVector;
+    LinesColor: TGLColorVector;
+    BackgroundColor: TGLColorVector;
     PassCount: Integer;
     PassCount: Integer;
   public
   public
     procedure DoApply(var rci: TGLRenderContextInfo; Sender: TObject); override;
     procedure DoApply(var rci: TGLRenderContextInfo; Sender: TObject); override;

+ 1 - 1
Demos/behaviours/Torque/fTorqueD.pas

@@ -111,7 +111,7 @@ procedure TFormTorque.GLSceneViewer1MouseDown(Sender: TObject; Button: TMouseBut
   Shift: TShiftState; X, Y: Integer);
   Shift: TShiftState; X, Y: Integer);
 var
 var
   pickedObject: TGLCustomSceneObject;
   pickedObject: TGLCustomSceneObject;
-  oldColor: TColorVector;
+  oldColor: TGLColorVector;
   rci: TGLRenderContextInfo;
   rci: TGLRenderContextInfo;
 begin
 begin
   // if an object is picked...
   // if an object is picked...

+ 6 - 6
Demos/graph/heightfield/fHeightFieldD.pas

@@ -71,11 +71,11 @@ type
   private
   private
 
 
     procedure Formula1(const X, Y: Single; var z: Single;
     procedure Formula1(const X, Y: Single; var z: Single;
-      var Color: TColorVector; var texPoint: TTexPoint);
+      var Color: TGLColorVector; var texPoint: TTexPoint);
     procedure Formula2(const X, Y: Single; var z: Single;
     procedure Formula2(const X, Y: Single; var z: Single;
-      var Color: TColorVector; var texPoint: TTexPoint);
+      var Color: TGLColorVector; var texPoint: TTexPoint);
     procedure Formula3(const X, Y: Single; var z: Single;
     procedure Formula3(const X, Y: Single; var z: Single;
-      var Color: TColorVector; var texPoint: TTexPoint);
+      var Color: TGLColorVector; var texPoint: TTexPoint);
   public
   public
     mx, my: Integer;
     mx, my: Integer;
   end;
   end;
@@ -97,7 +97,7 @@ begin
 end;
 end;
 
 
 procedure TFormHeightField.Formula1(const X, Y: Single; var z: Single;
 procedure TFormHeightField.Formula1(const X, Y: Single; var z: Single;
-  var Color: TColorVector; var texPoint: TTexPoint);
+  var Color: TGLColorVector; var texPoint: TTexPoint);
 begin
 begin
   // first formula
   // first formula
   z := VectorNorm(X, Y);
   z := VectorNorm(X, Y);
@@ -106,7 +106,7 @@ begin
 end;
 end;
 
 
 procedure TFormHeightField.Formula2(const X, Y: Single; var z: Single;
 procedure TFormHeightField.Formula2(const X, Y: Single; var z: Single;
-  var Color: TColorVector; var texPoint: TTexPoint);
+  var Color: TGLColorVector; var texPoint: TTexPoint);
 begin
 begin
   // 2nd formula
   // 2nd formula
   z := 0.5 * cos(X * 6.28) * sin(Sqrt(abs(Y)) * 6.28);
   z := 0.5 * cos(X * 6.28) * sin(Sqrt(abs(Y)) * 6.28);
@@ -114,7 +114,7 @@ begin
 end;
 end;
 
 
 procedure TFormHeightField.Formula3(const X, Y: Single; var z: Single;
 procedure TFormHeightField.Formula3(const X, Y: Single; var z: Single;
-  var Color: TColorVector; var texPoint: TTexPoint);
+  var Color: TGLColorVector; var texPoint: TTexPoint);
 begin
 begin
   // 3rd formula, dynamic
   // 3rd formula, dynamic
   z := 1 / (1 + VectorNorm(Sphere1.position.X - X, Sphere1.position.Y - Y));
   z := 1 / (1 + VectorNorm(Sphere1.position.X - X, Sphere1.position.Y - Y));

+ 5 - 5
Demos/materials/TransparencyAdvanced/fTransparencyAdv.pas

@@ -123,11 +123,11 @@ end;
 
 
 procedure TForm1.CreateShapes;
 procedure TForm1.CreateShapes;
 const
 const
-  vLtBlue: TColorVector = (X: 0.00; Y: 0.00; Z: 1.00; W:0.90);
-  vLtPink: TColorVector = (X: 0.40; Y:0.00; Z:0.20; W:0.50);
-  vLtYellow: TColorVector = (X: 0.98; Y:0.96; Z:0.14; W:0.30);
-  vLtMagenta: TColorVector = (X: 0.83; Y:0.04; Z:0.83; W:0.70);
-  vLtGreen: TColorVector = (X: 0.05; Y:0.98; Z:0.14; W:0.30);
+  vLtBlue: TGLColorVector = (X: 0.00; Y: 0.00; Z: 1.00; W:0.90);
+  vLtPink: TGLColorVector = (X: 0.40; Y:0.00; Z:0.20; W:0.50);
+  vLtYellow: TGLColorVector = (X: 0.98; Y:0.96; Z:0.14; W:0.30);
+  vLtMagenta: TGLColorVector = (X: 0.83; Y:0.04; Z:0.83; W:0.70);
+  vLtGreen: TGLColorVector = (X: 0.05; Y:0.98; Z:0.14; W:0.30);
 
 
 var
 var
   vd: array [0 .. 3] of TGLVertexData;
   vd: array [0 .. 3] of TGLVertexData;

+ 2 - 2
Demos/materials/multipass/fMultiPassD.pas

@@ -63,7 +63,7 @@ type
 
 
   THiddenLineShader = class(TGLShader)
   THiddenLineShader = class(TGLShader)
   private
   private
-    BackgroundColor, LineColor: TColorVector;
+    BackgroundColor, LineColor: TGLColorVector;
     PassCount: Integer;
     PassCount: Integer;
   public
   public
     procedure DoApply(var rci: TGLRenderContextInfo; Sender: TObject); override;
     procedure DoApply(var rci: TGLRenderContextInfo; Sender: TObject); override;
@@ -72,7 +72,7 @@ type
 
 
   TOutLineShader = class(TGLShader)
   TOutLineShader = class(TGLShader)
   private
   private
-    BackgroundColor, LineColor: TColorVector;
+    BackgroundColor, LineColor: TGLColorVector;
     OutlineSmooth, Lighting: Boolean;
     OutlineSmooth, Lighting: Boolean;
     OutlineWidth, Oldlinewidth: Single;
     OutlineWidth, Oldlinewidth: Single;
     PassCount: Integer;
     PassCount: Integer;

+ 2 - 2
Demos/materials/multipass/fMultipassC.h

@@ -51,7 +51,7 @@ public:
 	__fastcall virtual THiddenLineShader(TComponent* AOwner);
 	__fastcall virtual THiddenLineShader(TComponent* AOwner);
 	__fastcall virtual ~THiddenLineShader(void);
 	__fastcall virtual ~THiddenLineShader(void);
 
 
-        TColorVector BackgroundColor, LineColor;
+        TGLColorVector BackgroundColor, LineColor;
         int PassCount;
         int PassCount;
 
 
 	void __fastcall DoApply(TGLRenderContextInfo &rci, System::TObject* Sender);
 	void __fastcall DoApply(TGLRenderContextInfo &rci, System::TObject* Sender);
@@ -66,7 +66,7 @@ public:
 	__fastcall virtual TOutLineShader(TComponent* AOwner);
 	__fastcall virtual TOutLineShader(TComponent* AOwner);
 	__fastcall virtual ~TOutLineShader(void);
 	__fastcall virtual ~TOutLineShader(void);
         
         
-        TColorVector BackgroundColor, LineColor;
+        TGLColorVector BackgroundColor, LineColor;
         bool OutlineSmooth, Lighting;
         bool OutlineSmooth, Lighting;
         float OutlineWidth, OldlineWidth;
         float OutlineWidth, OldlineWidth;
         int PassCount;
         int PassCount;

+ 1 - 1
Demos/meshes/actor/fActorD.dfm

@@ -237,7 +237,7 @@ object FormActor: TFormActor
         Position.Coordinates = {0000000000000000000080BF0000803F}
         Position.Coordinates = {0000000000000000000080BF0000803F}
         Loops = 1
         Loops = 1
         OuterRadius = 3.000000000000000000
         OuterRadius = 3.000000000000000000
-        Slices = 8
+        Slices = 100
         SweepAngle = 360.000000000000000000
         SweepAngle = 360.000000000000000000
       end
       end
     end
     end

+ 1 - 1
Demos/meshes/formula/fFormulaC.cpp

@@ -40,7 +40,7 @@ TAffineVector __fastcall TForm1::MakeVect(const float aX, const float aY)
 void __fastcall TForm1::AddTriangle(const TAffineVector p1,
 void __fastcall TForm1::AddTriangle(const TAffineVector p1,
 									const TAffineVector p2,
 									const TAffineVector p2,
 									const TAffineVector p3,
 									const TAffineVector p3,
-									const TColorVector color)
+									const TGLColorVector color)
 {
 {
   Mesh1->Vertices->AddVertex(p1, NullVector, color);
   Mesh1->Vertices->AddVertex(p1, NullVector, color);
   Mesh1->Vertices->AddVertex(p2, NullVector, color);
   Mesh1->Vertices->AddVertex(p2, NullVector, color);

+ 1 - 1
Demos/meshes/formula/fFormulaC.h

@@ -63,7 +63,7 @@ private:	// User declarations
 	void __fastcall AddTriangle(const TAffineVector p1,
 	void __fastcall AddTriangle(const TAffineVector p1,
 						  const TAffineVector p2,
 						  const TAffineVector p2,
 						  const TAffineVector p3,
 						  const TAffineVector p3,
-						  const TColorVector color);
+						  const TGLColorVector color);
 public:		// User declarations
 public:		// User declarations
 	__fastcall TForm1(TComponent* Owner);
 	__fastcall TForm1(TComponent* Owner);
 };
 };

+ 2 - 2
Demos/meshes/formula/fFormulaD.pas

@@ -58,7 +58,7 @@ type
     invRes1, invRes2 : Single;
     invRes1, invRes2 : Single;
     function MakeVect(const aX, aY : Single) : TAffineVector;
     function MakeVect(const aX, aY : Single) : TAffineVector;
     procedure AddTriangle(const p1, p2, p3 : TAffineVector;
     procedure AddTriangle(const p1, p2, p3 : TAffineVector;
-                          const color : TColorVector);
+                          const color : TGLColorVector);
   public
   public
      
      
   end;
   end;
@@ -80,7 +80,7 @@ begin
 end;
 end;
 
 
 procedure TFormFormula.AddTriangle(const p1, p2, p3 : TAffineVector;
 procedure TFormFormula.AddTriangle(const p1, p2, p3 : TAffineVector;
-                         const color : TColorVector);
+                         const color : TGLColorVector);
 begin
 begin
   with Mesh1.Vertices do begin
   with Mesh1.Vertices do begin
      AddVertex(p1, NullVector, color);
      AddVertex(p1, NullVector, color);

+ 1 - 1
Demos/movements/objmove/fObjmoveC.cpp

@@ -22,7 +22,7 @@
 #pragma resource "*.dfm"
 #pragma resource "*.dfm"
 TForm1 *Form1;
 TForm1 *Form1;
 
 
-const TColorVector
+const TGLColorVector
   SelectionColor[]  = {0.243, 0.243, 0.243, 1.000};
   SelectionColor[]  = {0.243, 0.243, 0.243, 1.000};
 
 
 
 

+ 1 - 1
Demos/movements/objmove/fObjmoveD.pas

@@ -86,7 +86,7 @@ type
   end;
   end;
 
 
 const
 const
-  SelectionColor: TColorVector = (X : 0.243; Y : 0.243; Z: 0.243; W : 1.000);
+  SelectionColor: TGLColorVector = (X : 0.243; Y : 0.243; Z: 0.243; W : 1.000);
 
 
 var
 var
   FormObjmove: TFormObjmove;
   FormObjmove: TFormObjmove;

+ 1 - 1
Demos/physics/NewtonWalkCarry/fNewtonWalkCarryD.pas

@@ -138,7 +138,7 @@ var
   cp: TPoint;
   cp: TPoint;
   visible_cursor: boolean;
   visible_cursor: boolean;
   ScObj, FScObj: TGLBaseSceneObject;
   ScObj, FScObj: TGLBaseSceneObject;
-  targetColor: TColorVector;
+  targetColor: TGLColorVector;
   picked: TGLCustomSceneObject;
   picked: TGLCustomSceneObject;
   mm: TMatrix4f;
   mm: TMatrix4f;
 
 

+ 1 - 2
Demos/specialsFX/Atmosphere/AtmosphereC.cbproj

@@ -63,7 +63,7 @@
         <Multithreaded>true</Multithreaded>
         <Multithreaded>true</Multithreaded>
         <ProjectType>CppVCLApplication</ProjectType>
         <ProjectType>CppVCLApplication</ProjectType>
         <_TCHARMapping>wchar_t</_TCHARMapping>
         <_TCHARMapping>wchar_t</_TCHARMapping>
-        <AllPackageLibs>rtl.lib;vcl.lib;GLScene_RT.lib;fmx.lib;xmlrtl.lib;vclimg.lib;GR32_RT.lib</AllPackageLibs>
+        <AllPackageLibs>rtl.lib;vcl.lib;GLScene_RT.lib;fmx.lib;xmlrtl.lib;vclimg.lib</AllPackageLibs>
         <Icon_MainIcon>$(BDS)\bin\cbuilder_PROJECTICON.ico</Icon_MainIcon>
         <Icon_MainIcon>$(BDS)\bin\cbuilder_PROJECTICON.ico</Icon_MainIcon>
         <DCC_CBuilderOutput>JPHNE</DCC_CBuilderOutput>
         <DCC_CBuilderOutput>JPHNE</DCC_CBuilderOutput>
         <DynamicRTL>true</DynamicRTL>
         <DynamicRTL>true</DynamicRTL>
@@ -127,7 +127,6 @@
         <BT_BuildType>Debug</BT_BuildType>
         <BT_BuildType>Debug</BT_BuildType>
         <FinalOutputDir>.</FinalOutputDir>
         <FinalOutputDir>.</FinalOutputDir>
         <AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
         <AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
-        <LinkPackageStatics>GR32_RT.lib</LinkPackageStatics>
     </PropertyGroup>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
     <PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
         <VerInfo_Locale>1033</VerInfo_Locale>
         <VerInfo_Locale>1033</VerInfo_Locale>

+ 1 - 1
Demos/specialsFX/Atmosphere/fAtmosphereC.h

@@ -9,6 +9,7 @@
 #include <Vcl.StdCtrls.hpp>
 #include <Vcl.StdCtrls.hpp>
 #include <Vcl.Forms.hpp>
 #include <Vcl.Forms.hpp>
 #include <Vcl.ExtCtrls.hpp>
 #include <Vcl.ExtCtrls.hpp>
+#include "Vcl.imaging.JPeg.hpp"
 
 
 #include "GLS.Scene.hpp"
 #include "GLS.Scene.hpp"
 #include "GLS.Objects.hpp"
 #include "GLS.Objects.hpp"
@@ -22,7 +23,6 @@
 #include "GLS.Atmosphere.hpp"
 #include "GLS.Atmosphere.hpp"
 #include "GLS.SimpleNavigation.hpp"
 #include "GLS.SimpleNavigation.hpp"
 #include "GLS.Behaviours.hpp"
 #include "GLS.Behaviours.hpp"
-#include "JPeg.hpp"
 #include "GLS.Coordinates.hpp"
 #include "GLS.Coordinates.hpp"
 #include "GLS.BaseClasses.hpp"
 #include "GLS.BaseClasses.hpp"
 #include "GLS.Color.hpp"
 #include "GLS.Color.hpp"

+ 8 - 8
Packages/GLScene_Cg_DT.dproj

@@ -164,23 +164,23 @@
                         <Overwrite>true</Overwrite>
                         <Overwrite>true</Overwrite>
                     </Platform>
                     </Platform>
                 </DeployFile>
                 </DeployFile>
-                <DeployFile LocalName="$(BDS)\Redist\iossim32\libcgunwind.1.0.dylib" Class="DependencyModule">
-                    <Platform Name="iOSSimulator">
+                <DeployFile LocalName="$(BDS)\Redist\osx32\libcgunwind.1.0.dylib" Class="DependencyModule">
+                    <Platform Name="OSX32">
                         <Overwrite>true</Overwrite>
                         <Overwrite>true</Overwrite>
                     </Platform>
                     </Platform>
                 </DeployFile>
                 </DeployFile>
-                <DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule">
-                    <Platform Name="iOSSimulator">
+                <DeployFile LocalName="$(BDS)\Redist\osx32\libcgsqlite3.dylib" Class="DependencyModule">
+                    <Platform Name="OSX32">
                         <Overwrite>true</Overwrite>
                         <Overwrite>true</Overwrite>
                     </Platform>
                     </Platform>
                 </DeployFile>
                 </DeployFile>
-                <DeployFile LocalName="$(BDS)\Redist\osx32\libcgunwind.1.0.dylib" Class="DependencyModule">
-                    <Platform Name="OSX32">
+                <DeployFile LocalName="$(BDS)\Redist\iossim32\libcgunwind.1.0.dylib" Class="DependencyModule">
+                    <Platform Name="iOSSimulator">
                         <Overwrite>true</Overwrite>
                         <Overwrite>true</Overwrite>
                     </Platform>
                     </Platform>
                 </DeployFile>
                 </DeployFile>
-                <DeployFile LocalName="$(BDS)\Redist\osx32\libcgsqlite3.dylib" Class="DependencyModule">
-                    <Platform Name="OSX32">
+                <DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule">
+                    <Platform Name="iOSSimulator">
                         <Overwrite>true</Overwrite>
                         <Overwrite>true</Overwrite>
                     </Platform>
                     </Platform>
                 </DeployFile>
                 </DeployFile>

+ 3 - 3
Source/GLS.Atmosphere.pas

@@ -169,11 +169,11 @@ var
   diskNormal, diskRight, diskUp:  TGLVector;
   diskNormal, diskRight, diskUp:  TGLVector;
 
 
 
 
-  function AtmosphereColor(const rayStart, rayEnd: TGLVector): TColorVector;
+  function AtmosphereColor(const rayStart, rayEnd: TGLVector): TGLColorVector;
   var
   var
     I, n:     Integer;
     I, n:     Integer;
     atmPoint, normal: TGLVector;
     atmPoint, normal: TGLVector;
-    altColor: TColorVector;
+    altColor: TGLColorVector;
     alt, rayLength, contrib, decay, intensity, invN: Single;
     alt, rayLength, contrib, decay, intensity, invN: Single;
   begin
   begin
     Result := clrTransparent;
     Result := clrTransparent;
@@ -214,7 +214,7 @@ var
   end;
   end;
 
 
 
 
-  function ComputeColor(var rayDest: TGLVector; mayHitGround: Boolean): TColorVector;
+  function ComputeColor(var rayDest: TGLVector; mayHitGround: Boolean): TGLColorVector;
   var
   var
     ai1, ai2, pi1, pi2: TGLVector;
     ai1, ai2, pi1, pi2: TGLVector;
     rayVector: TGLVector;
     rayVector: TGLVector;

+ 4 - 4
Source/GLS.BitmapFont.pas

@@ -189,13 +189,13 @@ type
        Enable states are also possibly altered. *)
        Enable states are also possibly altered. *)
     procedure RenderString(var ARci: TGLRenderContextInfo;
     procedure RenderString(var ARci: TGLRenderContextInfo;
       const aText: UnicodeString; aAlignment: TAlignment;
       const aText: UnicodeString; aAlignment: TAlignment;
-      aLayout: TTextLayout; const aColor: TColorVector;
+      aLayout: TTextLayout; const aColor: TGLColorVector;
       aPosition: PGLVector = nil; aReverseY: boolean = False); overload; virtual;
       aPosition: PGLVector = nil; aReverseY: boolean = False); overload; virtual;
     (* A simpler canvas-style TextOut helper for RenderString.
     (* A simpler canvas-style TextOut helper for RenderString.
        The rendering is reversed along Y by default, to allow direct use
        The rendering is reversed along Y by default, to allow direct use
        with TGLCanvas *)
        with TGLCanvas *)
     procedure TextOut(var rci: TGLRenderContextInfo; X, Y: Single;
     procedure TextOut(var rci: TGLRenderContextInfo; X, Y: Single;
-      const Text: UnicodeString; const Color: TColorVector); overload;
+      const Text: UnicodeString; const Color: TGLColorVector); overload;
     procedure TextOut(var rci: TGLRenderContextInfo; X, Y: Single;
     procedure TextOut(var rci: TGLRenderContextInfo; X, Y: Single;
       const Text: UnicodeString; const Color: TColor); overload;
       const Text: UnicodeString; const Color: TColor); overload;
     function TextWidth(const Text: UnicodeString): Integer;
     function TextWidth(const Text: UnicodeString): Integer;
@@ -832,7 +832,7 @@ end;
 
 
 procedure TGLCustomBitmapFont.RenderString(var ARci: TGLRenderContextInfo;
 procedure TGLCustomBitmapFont.RenderString(var ARci: TGLRenderContextInfo;
   const aText: UnicodeString; aAlignment: TAlignment; aLayout: TTextLayout;
   const aText: UnicodeString; aAlignment: TAlignment; aLayout: TTextLayout;
-  const aColor: TColorVector; aPosition: PGLVector = nil;
+  const aColor: TGLColorVector; aPosition: PGLVector = nil;
   aReverseY: boolean = False);
   aReverseY: boolean = False);
 
 
   function AlignmentAdjustement(p: Integer): Single;
   function AlignmentAdjustement(p: Integer): Single;
@@ -964,7 +964,7 @@ begin
 end;
 end;
 
 
 procedure TGLCustomBitmapFont.TextOut(var rci: TGLRenderContextInfo; X, Y: Single;
 procedure TGLCustomBitmapFont.TextOut(var rci: TGLRenderContextInfo; X, Y: Single;
-  const Text: UnicodeString; const Color: TColorVector);
+  const Text: UnicodeString; const Color: TGLColorVector);
 var
 var
   V: TGLVector;
   V: TGLVector;
 begin
 begin

+ 10 - 10
Source/GLS.Canvas.pas

@@ -121,9 +121,9 @@ type
     procedure FillRect(const x1, y1, x2, y2: Single); overload;
     procedure FillRect(const x1, y1, x2, y2: Single); overload;
     // Draw the (x1,y1)-(x2, y2) rectangle (filled with given gradient's color). 
     // Draw the (x1,y1)-(x2, y2) rectangle (filled with given gradient's color). 
     procedure FillRectGradient(const x1, y1, x2, y2: Single;
     procedure FillRectGradient(const x1, y1, x2, y2: Single;
-      const x1y1Color, x2y1Color, x2y2Color, x1y2Color: TColorVector); overload;
+      const x1y1Color, x2y1Color, x2y2Color, x1y2Color: TGLColorVector); overload;
     procedure FillRectGradient(const x1, y1, x2, y2: Integer;
     procedure FillRectGradient(const x1, y1, x2, y2: Integer;
-      const x1y1Color, x2y1Color, x2y2Color, x1y2Color: TColorVector); overload;
+      const x1y1Color, x2y1Color, x2y2Color, x1y2Color: TGLColorVector); overload;
     // Draws an ellipse with (x1,y1)-(x2, y2) bounding rectangle. 
     // Draws an ellipse with (x1,y1)-(x2, y2) bounding rectangle. 
     procedure EllipseBB(const x1, y1, x2, y2: Integer); overload;
     procedure EllipseBB(const x1, y1, x2, y2: Integer); overload;
     procedure EllipseBB(const x1, y1, x2, y2: Single); overload;
     procedure EllipseBB(const x1, y1, x2, y2: Single); overload;
@@ -139,11 +139,11 @@ type
     OpenGL will use the last PenColor and PenAlpha as the center color and do gradient 
     OpenGL will use the last PenColor and PenAlpha as the center color and do gradient 
   	to edge of ellipse using the edgeColor parameter. *)
   	to edge of ellipse using the edgeColor parameter. *)
     procedure FillEllipseGradient(const x, y, xRadius, yRadius: Single;
     procedure FillEllipseGradient(const x, y, xRadius, yRadius: Single;
-      const edgeColor: TColorVector); overload;
+      const edgeColor: TGLColorVector); overload;
     procedure FillEllipseGradient(const x, y: Integer;
     procedure FillEllipseGradient(const x, y: Integer;
-      const xRadius, yRadius: Integer; const edgeColor: TColorVector); overload;
+      const xRadius, yRadius: Integer; const edgeColor: TGLColorVector); overload;
     procedure FillEllipseGradient(const x, y, Radius: Single;
     procedure FillEllipseGradient(const x, y, Radius: Single;
-      const edgeColor: TColorVector); overload;
+      const edgeColor: TGLColorVector); overload;
     (* Draw an elliptical arc.
     (* Draw an elliptical arc.
        The points (x1, y1) and (x2, y2) specify the bounding rectangle.
        The points (x1, y1) and (x2, y2) specify the bounding rectangle.
        An ellipse formed by the specified bounding rectangle defines the curve of the arc.
        An ellipse formed by the specified bounding rectangle defines the curve of the arc.
@@ -525,7 +525,7 @@ begin
 end;
 end;
 
 
 procedure TGLCanvas.FillRectGradient(const x1, y1, x2, y2: Single;
 procedure TGLCanvas.FillRectGradient(const x1, y1, x2, y2: Single;
-  const x1y1Color, x2y1Color, x2y2Color, x1y2Color: TColorVector);
+  const x1y1Color, x2y1Color, x2y2Color, x1y2Color: TGLColorVector);
 begin
 begin
   StartPrimitive(GL_QUADS);
   StartPrimitive(GL_QUADS);
   gl.Color4f(x1y1Color.X, x1y1Color.Y, x1y1Color.Z, x1y1Color.W);
   gl.Color4f(x1y1Color.X, x1y1Color.Y, x1y1Color.Z, x1y1Color.W);
@@ -543,7 +543,7 @@ begin
 end;
 end;
 
 
 procedure TGLCanvas.FillRectGradient(const x1, y1, x2, y2: Integer;
 procedure TGLCanvas.FillRectGradient(const x1, y1, x2, y2: Integer;
-  const x1y1Color, x2y1Color, x2y2Color, x1y2Color: TColorVector);
+  const x1y1Color, x2y1Color, x2y2Color, x1y2Color: TGLColorVector);
 begin
 begin
   StartPrimitive(GL_QUADS);
   StartPrimitive(GL_QUADS);
   gl.Color4f(x1y1Color.X, x1y1Color.Y, x1y1Color.Z, x1y1Color.W);
   gl.Color4f(x1y1Color.X, x1y1Color.Y, x1y1Color.Z, x1y1Color.W);
@@ -560,7 +560,7 @@ begin
   gl.Color4fv(@FCurrentPenColorVector);
   gl.Color4fv(@FCurrentPenColorVector);
 end;
 end;
 
 
-procedure TGLCanvas.FillEllipseGradient(const x, y: Integer; const xRadius, yRadius: Integer; const edgeColor: TColorVector);
+procedure TGLCanvas.FillEllipseGradient(const x, y: Integer; const xRadius, yRadius: Integer; const edgeColor: TGLColorVector);
 begin
 begin
   StartPrimitive(GL_TRIANGLE_FAN);
   StartPrimitive(GL_TRIANGLE_FAN);
 
 
@@ -576,7 +576,7 @@ begin
   gl.Color4fv(@FCurrentPenColorVector);
   gl.Color4fv(@FCurrentPenColorVector);
 end;
 end;
 
 
-procedure TGLCanvas.FillEllipseGradient(const x, y, xRadius, yRadius: Single; const edgeColor: TColorVector);
+procedure TGLCanvas.FillEllipseGradient(const x, y, xRadius, yRadius: Single; const edgeColor: TGLColorVector);
 begin
 begin
   StartPrimitive(GL_TRIANGLE_FAN);
   StartPrimitive(GL_TRIANGLE_FAN);
   gl.Vertex2f(x, y); // really necessary now :)
   gl.Vertex2f(x, y); // really necessary now :)
@@ -588,7 +588,7 @@ begin
   gl.Color4fv(@FCurrentPenColorVector);
   gl.Color4fv(@FCurrentPenColorVector);
 end;
 end;
 
 
-procedure TGLCanvas.FillEllipseGradient(const x, y, Radius: Single; const edgeColor: TColorVector);
+procedure TGLCanvas.FillEllipseGradient(const x, y, Radius: Single; const edgeColor: TGLColorVector);
 begin
 begin
   FillEllipseGradient(x, y, Radius, Radius, edgeColor);
   FillEllipseGradient(x, y, Radius, Radius, edgeColor);
 end;
 end;

+ 197 - 197
Source/GLS.Color.pas

@@ -23,8 +23,8 @@ uses
   GLS.BaseClasses;
   GLS.BaseClasses;
 
 
 type
 type
-  PColorVector = ^TColorVector;
-  TColorVector = TVector4f;
+  PColorVector = ^TGLColorVector;
+  TGLColorVector = TVector4f;
 
 
   PRGBColor = ^TRGBColor;
   PRGBColor = ^TRGBColor;
   TRGBColor = TVector3b;
   TRGBColor = TVector3b;
@@ -32,14 +32,14 @@ type
   // Wraps an OpenGL color.
   // Wraps an OpenGL color.
   TGLColor = class(TGLUpdateAbleObject)
   TGLColor = class(TGLUpdateAbleObject)
   private
   private
-    FColor: TColorVector;
+    FColor: TGLColorVector;
     FPDefaultColor: PColorVector;
     FPDefaultColor: PColorVector;
-    procedure SetColorVector(const aColor: TColorVector); overload;
+    procedure SetColorVector(const aColor: TGLColorVector); overload;
     procedure SetColorComponent(index: Integer; value: Single);
     procedure SetColorComponent(index: Integer; value: Single);
     function GetColorComponent(const index: Integer): Single;
     function GetColorComponent(const index: Integer): Single;
     procedure SetAsWinColor(const val: TColor);
     procedure SetAsWinColor(const val: TColor);
     function GetAsWinColor: TColor;
     function GetAsWinColor: TColor;
-    procedure SetDirectColorVector(const aColor: TColorVector);
+    procedure SetDirectColorVector(const aColor: TGLColorVector);
   protected
   protected
     procedure DefineProperties(Filer: TFiler); override;
     procedure DefineProperties(Filer: TFiler); override;
     procedure ReadData(Stream: TStream);
     procedure ReadData(Stream: TStream);
@@ -49,19 +49,19 @@ type
   public
   public
     constructor Create(AOwner: TPersistent); override;
     constructor Create(AOwner: TPersistent); override;
     constructor CreateInitialized(AOwner: TPersistent;
     constructor CreateInitialized(AOwner: TPersistent;
-      const Color: TColorVector; changeEvent: TNotifyEvent = nil);
+      const Color: TGLColorVector; changeEvent: TNotifyEvent = nil);
     destructor Destroy; override;
     destructor Destroy; override;
     procedure NotifyChange(Sender: TObject); override;
     procedure NotifyChange(Sender: TObject); override;
     procedure Assign(Source: TPersistent); override;
     procedure Assign(Source: TPersistent); override;
-    procedure Initialize(const color: TColorVector);
+    procedure Initialize(const color: TGLColorVector);
     function AsAddress: PSingle;
     function AsAddress: PSingle;
     procedure RandomColor;
     procedure RandomColor;
     procedure SetColor(Red, Green, Blue: Single; Alpha: Single = 1); overload;
     procedure SetColor(Red, Green, Blue: Single; Alpha: Single = 1); overload;
-    property Color: TColorVector read FColor write SetColorVector;
-    property DirectColor: TColorVector read FColor write SetDirectColorVector;
+    property Color: TGLColorVector read FColor write SetColorVector;
+    property DirectColor: TGLColorVector read FColor write SetDirectColorVector;
     property AsWinColor: TColor read GetAsWinColor write SetAsWinColor;
     property AsWinColor: TColor read GetAsWinColor write SetAsWinColor;
     property hsva: TGLVector read GetHSVA write SetHSVA;
     property hsva: TGLVector read GetHSVA write SetHSVA;
-    property DefaultColor: TColorVector read FColor;
+    property DefaultColor: TGLColorVector read FColor;
   published
   published
     property Red: Single index 0 read GetColorComponent write SetColorComponent
     property Red: Single index 0 read GetColorComponent write SetColorComponent
       stored False;
       stored False;
@@ -73,23 +73,23 @@ type
       write SetColorComponent stored False;
       write SetColorComponent stored False;
   end;
   end;
 
 
-  PColorEntry = ^TColorEntry;
+  PGLColorEntry = ^TGLColorEntry;
 
 
-  TColorEntry = record
+  TGLColorEntry = record
     Name: String;
     Name: String;
-    Color: TColorVector;
+    Color: TGLColorVector;
   end;
   end;
 
 
   TGLColorManager = class(TList)
   TGLColorManager = class(TList)
   public
   public
     destructor Destroy; override;
     destructor Destroy; override;
-    procedure AddColor(const aName: String; const aColor: TColorVector);
+    procedure AddColor(const aName: String; const aColor: TGLColorVector);
     procedure EnumColors(Proc: TGetStrProc); overload;
     procedure EnumColors(Proc: TGetStrProc); overload;
     procedure EnumColors(AValues: TStrings); overload;
     procedure EnumColors(AValues: TStrings); overload;
-    function FindColor(const aName: String): TColorVector;
+    function FindColor(const aName: String): TGLColorVector;
     // Convert a clrXxxx or a '<Red Green Blue Alpha> to a color vector
     // Convert a clrXxxx or a '<Red Green Blue Alpha> to a color vector
-    function GetColor(const aName: String): TColorVector;
-    function GetColorName(const aColor: TColorVector): String;
+    function GetColor(const aName: String): TGLColorVector;
+    function GetColorName(const aColor: TGLColorVector): String;
     procedure RegisterDefaultColors;
     procedure RegisterDefaultColors;
     procedure RemoveColor(const aName: String);
     procedure RemoveColor(const aName: String);
   end;
   end;
@@ -97,21 +97,21 @@ type
 // Builds a TColor from Red Green Blue components.
 // Builds a TColor from Red Green Blue components.
 function RGB2Color(const r, g, b: Byte): TColor; inline;
 function RGB2Color(const r, g, b: Byte): TColor; inline;
 function ColorManager: TGLColorManager;
 function ColorManager: TGLColorManager;
-procedure RegisterColor(const aName: String; const aColor: TColorVector);
+procedure RegisterColor(const aName: String; const aColor: TGLColorVector);
 procedure UnRegisterColor(const aName: String);
 procedure UnRegisterColor(const aName: String);
 function GetRValue(rgb: DWORD): Byte; {$NODEFINE GetRValue}
 function GetRValue(rgb: DWORD): Byte; {$NODEFINE GetRValue}
 function GetGValue(rgb: DWORD): Byte; {$NODEFINE GetGValue}
 function GetGValue(rgb: DWORD): Byte; {$NODEFINE GetGValue}
 function GetBValue(rgb: DWORD): Byte; {$NODEFINE GetBValue}
 function GetBValue(rgb: DWORD): Byte; {$NODEFINE GetBValue}
 procedure InitGLSceneColors;
 procedure InitGLSceneColors;
 // Converts a delphi color into its RGB fragments and correct range.
 // Converts a delphi color into its RGB fragments and correct range.
-function ConvertWinColor(aColor: TColor; Alpha: Single = 1): TColorVector;
+function ConvertWinColor(aColor: TColor; Alpha: Single = 1): TGLColorVector;
 // Converts a color vector (containing float values)
 // Converts a color vector (containing float values)
-function ConvertColorVector(const aColor: TColorVector): TColor; overload;
+function ConvertColorVector(const aColor: TGLColorVector): TColor; overload;
 (* Converts a color vector (containing float values) and alter intensity.
 (* Converts a color vector (containing float values) and alter intensity.
   intensity is in [0..1] *)
   intensity is in [0..1] *)
-function ConvertColorVector(const aColor: TColorVector; intensity: Single): TColor; overload;
+function ConvertColorVector(const aColor: TGLColorVector; intensity: Single): TColor; overload;
 // Converts RGB components into a color vector with correct range
 // Converts RGB components into a color vector with correct range
-function ConvertRGBColor(const aColor: array of Byte): TColorVector;
+function ConvertRGBColor(const aColor: array of Byte): TGLColorVector;
 
 
 // color definitions
 // color definitions
 const
 const
@@ -192,166 +192,166 @@ const
   // since they depend on the desktop scheme)
   // since they depend on the desktop scheme)
 const
 const
 {$J+ - allow change of the following typed constants}
 {$J+ - allow change of the following typed constants}
-  clrScrollBar: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrBackground: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrActiveCaption: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrInactiveCaption: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrMenu: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrWindow: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrWindowFrame: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrMenuText: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrWindowText: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrCaptionText: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrActiveBorder: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrInactiveBorder: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrAppWorkSpace: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrHighlight: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrHighlightText: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrBtnFace: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrBtnShadow: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrGrayText: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrBtnText: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrInactiveCaptionText: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrBtnHighlight: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clr3DDkShadow: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clr3DLight: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrInfoText: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrInfoBk: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrScrollBar: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrBackground: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrActiveCaption: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrInactiveCaption: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrMenu: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrWindow: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrWindowFrame: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrMenuText: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrWindowText: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrCaptionText: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrActiveBorder: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrInactiveBorder: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrAppWorkSpace: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrHighlight: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrHighlightText: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrBtnFace: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrBtnShadow: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrGrayText: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrBtnText: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrInactiveCaptionText: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrBtnHighlight: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clr3DDkShadow: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clr3DLight: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrInfoText: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrInfoBk: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
 
 
 {$J- - disable change of other typed constants}
 {$J- - disable change of other typed constants}
   // 'static' color definitions sort of grays
   // 'static' color definitions sort of grays
-  clrTransparent: TColorVector = (X: 0; Y: 0; Z: 0; W: 0);
-  clrBlack: TColorVector = (X: 0; Y: 0; Z: 0; W: 1);
-  clrGray05: TColorVector = (X: 0.05; Y: 0.05; Z: 0.05; W: 1);
-  clrGray10: TColorVector = (X: 0.10; Y: 0.10; Z: 0.10; W: 1);
-  clrGray15: TColorVector = (X: 0.15; Y: 0.15; Z: 0.15; W: 1);
-  clrGray20: TColorVector = (X: 0.20; Y: 0.20; Z: 0.20; W: 1);
-  clrGray25: TColorVector = (X: 0.25; Y: 0.25; Z: 0.25; W: 1);
-  clrGray30: TColorVector = (X: 0.30; Y: 0.30; Z: 0.30; W: 1);
-  clrGray35: TColorVector = (X: 0.35; Y: 0.35; Z: 0.35; W: 1);
-  clrGray40: TColorVector = (X: 0.40; Y: 0.40; Z: 0.40; W: 1);
-  clrGray45: TColorVector = (X: 0.45; Y: 0.45; Z: 0.45; W: 1);
-  clrGray50: TColorVector = (X: 0.50; Y: 0.50; Z: 0.50; W: 1);
-  clrGray55: TColorVector = (X: 0.55; Y: 0.55; Z: 0.55; W: 1);
-  clrGray60: TColorVector = (X: 0.60; Y: 0.60; Z: 0.60; W: 1);
-  clrGray65: TColorVector = (X: 0.65; Y: 0.65; Z: 0.65; W: 1);
-  clrGray70: TColorVector = (X: 0.70; Y: 0.70; Z: 0.70; W: 1);
-  clrGray75: TColorVector = (X: 0.75; Y: 0.75; Z: 0.75; W: 1);
-  clrGray80: TColorVector = (X: 0.80; Y: 0.80; Z: 0.80; W: 1);
-  clrGray85: TColorVector = (X: 0.85; Y: 0.85; Z: 0.85; W: 1);
-  clrGray90: TColorVector = (X: 0.90; Y: 0.90; Z: 0.90; W: 1);
-  clrGray95: TColorVector = (X: 0.95; Y: 0.95; Z: 0.95; W: 1);
-  clrWhite: TColorVector = (X: 1; Y: 1; Z: 1; W: 1);
+  clrTransparent: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 0);
+  clrBlack: TGLColorVector = (X: 0; Y: 0; Z: 0; W: 1);
+  clrGray05: TGLColorVector = (X: 0.05; Y: 0.05; Z: 0.05; W: 1);
+  clrGray10: TGLColorVector = (X: 0.10; Y: 0.10; Z: 0.10; W: 1);
+  clrGray15: TGLColorVector = (X: 0.15; Y: 0.15; Z: 0.15; W: 1);
+  clrGray20: TGLColorVector = (X: 0.20; Y: 0.20; Z: 0.20; W: 1);
+  clrGray25: TGLColorVector = (X: 0.25; Y: 0.25; Z: 0.25; W: 1);
+  clrGray30: TGLColorVector = (X: 0.30; Y: 0.30; Z: 0.30; W: 1);
+  clrGray35: TGLColorVector = (X: 0.35; Y: 0.35; Z: 0.35; W: 1);
+  clrGray40: TGLColorVector = (X: 0.40; Y: 0.40; Z: 0.40; W: 1);
+  clrGray45: TGLColorVector = (X: 0.45; Y: 0.45; Z: 0.45; W: 1);
+  clrGray50: TGLColorVector = (X: 0.50; Y: 0.50; Z: 0.50; W: 1);
+  clrGray55: TGLColorVector = (X: 0.55; Y: 0.55; Z: 0.55; W: 1);
+  clrGray60: TGLColorVector = (X: 0.60; Y: 0.60; Z: 0.60; W: 1);
+  clrGray65: TGLColorVector = (X: 0.65; Y: 0.65; Z: 0.65; W: 1);
+  clrGray70: TGLColorVector = (X: 0.70; Y: 0.70; Z: 0.70; W: 1);
+  clrGray75: TGLColorVector = (X: 0.75; Y: 0.75; Z: 0.75; W: 1);
+  clrGray80: TGLColorVector = (X: 0.80; Y: 0.80; Z: 0.80; W: 1);
+  clrGray85: TGLColorVector = (X: 0.85; Y: 0.85; Z: 0.85; W: 1);
+  clrGray90: TGLColorVector = (X: 0.90; Y: 0.90; Z: 0.90; W: 1);
+  clrGray95: TGLColorVector = (X: 0.95; Y: 0.95; Z: 0.95; W: 1);
+  clrWhite: TGLColorVector = (X: 1; Y: 1; Z: 1; W: 1);
 
 
   // other grays
   // other grays
-  clrDimGray: TColorVector = (X: 0.329412; Y: 0.329412; Z: 0.329412; W: 1);
-  clrGray: TColorVector = (X: 0.752941; Y: 0.752941; Z: 0.752941; W: 1);
-  clrLightGray: TColorVector = (X: 0.658824; Y: 0.658824; Z: 0.658824; W: 1);
+  clrDimGray: TGLColorVector = (X: 0.329412; Y: 0.329412; Z: 0.329412; W: 1);
+  clrGray: TGLColorVector = (X: 0.752941; Y: 0.752941; Z: 0.752941; W: 1);
+  clrLightGray: TGLColorVector = (X: 0.658824; Y: 0.658824; Z: 0.658824; W: 1);
 
 
   // colors en masse
   // colors en masse
-  clrAqua: TColorVector = (X: 0; Y: 1; Z: 1; W: 1);
-  clrAquamarine: TColorVector = (X: 0.439216; Y: 0.858824; Z: 0.576471; W: 1);
-  clrBakersChoc: TColorVector = (X: 0.36; Y: 0.20; Z: 0.09; W: 1);
-  clrBlue: TColorVector = (X: 0; Y: 0; Z: 1; W: 1);
-  clrBlueViolet: TColorVector = (X: 0.62352; Y: 0.372549; Z: 0.623529; W: 1);
-  clrBrown: TColorVector = (X: 0.647059; Y: 0.164706; Z: 0.164706; W: 1);
-  clrCadetBlue: TColorVector = (X: 0.372549; Y: 0.623529; Z: 0.623529; W: 1);
-  clrCoral: TColorVector = (X: 1; Y: 0.498039; Z: 0.0; W: 1);
-  clrCornflowerBlue: TColorVector = (X: 0.258824; Y: 0.258824; Z: 0.435294; W: 1);
-  clrDarkGreen: TColorVector = (X: 0.184314; Y: 0.309804; Z: 0.184314; W: 1);
-  clrDarkOliveGreen: TColorVector = (X: 0.309804; Y: 0.309804; Z: 0.184314; W: 1);
-  clrDarkOrchid: TColorVector = (X: 0.6; Y: 0.196078; Z: 0.8; W: 1);
-  clrDarkSlateBlue: TColorVector = (X: 0.419608; Y: 0.137255; Z: 0.556863; W: 1);
-  clrDarkSlateGray: TColorVector = (X: 0.184314; Y: 0.309804; Z: 0.309804; W: 1);
-  clrDarkSlateGrey: TColorVector = (X: 0.184314; Y: 0.309804; Z: 0.309804; W: 1);
-  clrDarkTurquoise: TColorVector = (X: 0.439216; Y: 0.576471; Z: 0.858824; W: 1);
-  clrFirebrick: TColorVector = (X: 0.556863; Y: 0.137255; Z: 0.137255; W: 1);
-  clrForestGreen: TColorVector = (X: 0.137255; Y: 0.556863; Z: 0.137255; W: 1);
-  clrFuchsia: TColorVector = (X: 1; Y: 0; Z: 1; W: 1);
-  clrGold: TColorVector = (X: 0.8; Y: 0.498039; Z: 0.196078; W: 1);
-  clrGoldenrod: TColorVector = (X: 0.858824; Y: 0.858824; Z: 0.439216; W: 1);
-  clrGreenYellow: TColorVector = (X: 0.576471; Y: 0.858824; Z: 0.439216; W: 1);
-  clrIndian: TColorVector = (X: 0.309804; Y: 0.184314; Z: 0.184314; W: 1);
-  clrKhaki: TColorVector = (X: 0.623529; Y: 0.623529; Z: 0.372549; W: 1);
-  clrLightBlue: TColorVector = (X: 0.74902; Y: 0.847059; Z: 0.847059; W: 1);
-  clrLightSteelBlue: TColorVector = (X: 0.560784; Y: 0.560784; Z: 0.737255; W: 1);
-  clrLime: TColorVector = (X: 0; Y: 1; Z: 0; W: 1);
-  clrLimeGreen: TColorVector = (X: 0.196078; Y: 0.8; Z: 0.196078; W: 1);
-  clrMaroon: TColorVector = (X: 0.556863; Y: 0.137255; Z: 0.419608; W: 1);
-  clrMediumAquamarine: TColorVector = (X: 0.196078; Y: 0.8; Z: 0.6; W: 1);
-  clrMediumBlue: TColorVector = (X: 0.196078; Y: 0.196078; Z: 0.8; W: 1);
-  clrMediumForestGreen: TColorVector = (X: 0.419608; Y: 0.556863; Z: 0.137255; W: 1);
-  clrMediumGoldenrod: TColorVector = (X: 0.917647; Y: 0.917647; Z: 0.678431; W: 1);
-  clrMediumOrchid: TColorVector = (X: 0.576471; Y: 0.439216; Z: 0.858824; W: 1);
-  clrMediumSeaGreen: TColorVector = (X: 0.258824; Y: 0.435294; Z: 0.258824; W: 1);
-  clrMediumSlateBlue: TColorVector = (X: 0.498039; Y: 0; Z: 1; W: 1);
-  clrMediumSpringGreen: TColorVector = (X: 0.498039; Y: 1; Z: 0; W: 1);
-  clrMediumTurquoise: TColorVector = (X: 0.439216; Y: 0.858824; Z: 0.858824; W: 1);
-  clrMediumViolet: TColorVector = (X: 0.858824; Y: 0.439216; Z: 0.576471; W: 1);
-  clrMediumPurple: TColorVector = (X: 0.73; Y: 0.16; Z: 0.96; W: 1);
-  clrMidnightBlue: TColorVector = (X: 0.184314; Y: 0.184314; Z: 0.309804; W: 1);
-  clrNavy: TColorVector = (X: 0.137255; Y: 0.137255; Z: 0.556863; W: 1);
-  clrNavyBlue: TColorVector = (X: 0.137255; Y: 0.137255; Z: 0.556863; W: 1);
-  clrOrange: TColorVector = (X: 1; Y: 0.5; Z: 0.0; W: 1);
-  clrOrangeRed: TColorVector = (X: 1; Y: 0.25; Z: 0; W: 1);
-  clrOrchid: TColorVector = (X: 0.858824; Y: 0.439216; Z: 0.858824; W: 1);
-  clrPaleGreen: TColorVector = (X: 0.560784; Y: 0.737255; Z: 0.560784; W: 1);
-  clrPink: TColorVector = (X: 0.737255; Y: 0.560784; Z: 0.560784; W: 1);
-  clrPlum: TColorVector = (X: 0.917647; Y: 0.678431; Z: 0.917647; W: 1);
-  clrSalmon: TColorVector = (X: 0.435294; Y: 0.258824; Z: 0.258824; W: 1);
-  clrSeaGreen: TColorVector = (X: 0.137255; Y: 0.556863; Z: 0.419608; W: 1);
-  clrSienna: TColorVector = (X: 0.556863; Y: 0.419608; Z: 0.137255; W: 1);
-  clrSkyBlue: TColorVector = (X: 0.196078; Y: 0.6; Z: 0.8; W: 1);
-  clrSlateBlue: TColorVector = (X: 0; Y: 0.498039; Z: 1; W: 1);
-  clrSpringGreen: TColorVector = (X: 0; Y: 1; Z: 0.498039; W: 1);
-  clrSteelBlue: TColorVector = (X: 0.137255; Y: 0.419608; Z: 0.556863; W: 1);
-  clrTan: TColorVector = (X: 0.858824; Y: 0.576471; Z: 0.439216; W: 1);
-  clrThistle: TColorVector = (X: 0.847059; Y: 0.74902; Z: 0.847059; W: 1);
-  clrTurquoise: TColorVector = (X: 0.678431; Y: 0.917647; Z: 0.917647; W: 1);
-  clrViolet: TColorVector = (X: 0.309804; Y: 0.184314; Z: 0.309804; W: 1);
-  clrVioletRed: TColorVector = (X: 0.8; Y: 0.196078; Z: 0.6; W: 1);
-  clrYellowGreen: TColorVector = (X: 0.6; Y: 0.8; Z: 0.196078; W: 1);
-  clrSummerSky: TColorVector = (X: 0.22; Y: 0.69; Z: 0.87; W: 1);
-  clrRichBlue: TColorVector = (X: 0.35; Y: 0.35; Z: 0.67; W: 1);
-  clrBrass: TColorVector = (X: 0.71; Y: 0.65; Z: 0.26; W: 1);
-  clrCopper: TColorVector = (X: 0.72; Y: 0.45; Z: 0.20; W: 1);
-  clrBronze: TColorVector = (X: 0.55; Y: 0.47; Z: 0.14; W: 1);
-  clrBronze2: TColorVector = (X: 0.65; Y: 0.49; Z: 0.24; W: 1);
-  clrSilver: TColorVector = (X: 0.90; Y: 0.91; Z: 0.98; W: 1);
-  clrBrightGold: TColorVector = (X: 0.85; Y: 0.85; Z: 0.10; W: 1);
-  clrOldGold: TColorVector = (X: 0.81; Y: 0.71; Z: 0.23; W: 1);
-  clrFeldspar: TColorVector = (X: 0.82; Y: 0.57; Z: 0.46; W: 1);
-  clrQuartz: TColorVector = (X: 0.85; Y: 0.85; Z: 0.95; W: 1);
-  clrNeonPink: TColorVector = (X: 1.00; Y: 0.43; Z: 0.78; W: 1);
-  clrDarkPurple: TColorVector = (X: 0.53; Y: 0.12; Z: 0.47; W: 1);
-  clrNeonBlue: TColorVector = (X: 0.30; Y: 0.30; Z: 1.00; W: 1);
-  clrCoolCopper: TColorVector = (X: 0.85; Y: 0.53; Z: 0.10; W: 1);
-  clrMandarinOrange: TColorVector = (X: 0.89; Y: 0.47; Z: 0.20; W: 1);
-  clrLightWood: TColorVector = (X: 0.91; Y: 0.76; Z: 0.65; W: 1);
-  clrMediumWood: TColorVector = (X: 0.65; Y: 0.50; Z: 0.39; W: 1);
-  clrDarkWood: TColorVector = (X: 0.52; Y: 0.37; Z: 0.26; W: 1);
-  clrSpicyPink: TColorVector = (X: 1.00; Y: 0.11; Z: 0.68; W: 1);
-  clrSemiSweetChoc: TColorVector = (X: 0.42; Y: 0.26; Z: 0.15; W: 1);
-  clrFlesh: TColorVector = (X: 0.96; Y: 0.80; Z: 0.69; W: 1);
-  clrNewTan: TColorVector = (X: 0.92; Y: 0.78; Z: 0.62; W: 1);
-  clrNewMidnightBlue: TColorVector = (X: 0.00; Y: 0.00; Z: 0.61; W: 1);
-  clrVeryDarkBrown: TColorVector = (X: 0.35; Y: 0.16; Z: 0.14; W: 1);
-  clrDarkBrown: TColorVector = (X: 0.36; Y: 0.25; Z: 0.20; W: 1);
-  clrDarkTan: TColorVector = (X: 0.59; Y: 0.41; Z: 0.31; W: 1);
-  clrGreenCopper: TColorVector = (X: 0.32; Y: 0.49; Z: 0.46; W: 1);
-  clrDkGreenCopper: TColorVector = (X: 0.29; Y: 0.46; Z: 0.43; W: 1);
-  clrDustyRose: TColorVector = (X: 0.52; Y: 0.39; Z: 0.39; W: 1);
-  clrHuntersGreen: TColorVector = (X: 0.13; Y: 0.37; Z: 0.31; W: 1);
-  clrScarlet: TColorVector = (X: 0.55; Y: 0.09; Z: 0.09; W: 1);
-  clrLightPurple: TColorVector = (X: 0.87; Y: 0.58; Z: 0.98; W: 1);
-  clrVeryLightPurple: TColorVector = (X: 0.94; Y: 0.81; Z: 0.99; W: 1);
-  clrGreen: TColorVector = (X: 0; Y: 0.5; Z: 0; W: 1);
-  clrOlive: TColorVector = (X: 0.5; Y: 0.5; Z: 1; W: 1);
-  clrPurple: TColorVector = (X: 1; Y: 0; Z: 1; W: 1);
-  clrTeal: TColorVector = (X: 0; Y: 0.5; Z: 0.5; W: 1);
-  clrRed: TColorVector = (X: 1; Y: 0; Z: 0; W: 1);
-  clrYellow: TColorVector = (X: 1; Y: 1; Z: 0; W: 1);
-  clrWheat: TColorVector = (X: 0.847059; Y: 0.847059; Z: 0.74902; W: 1);
+  clrAqua: TGLColorVector = (X: 0; Y: 1; Z: 1; W: 1);
+  clrAquamarine: TGLColorVector = (X: 0.439216; Y: 0.858824; Z: 0.576471; W: 1);
+  clrBakersChoc: TGLColorVector = (X: 0.36; Y: 0.20; Z: 0.09; W: 1);
+  clrBlue: TGLColorVector = (X: 0; Y: 0; Z: 1; W: 1);
+  clrBlueViolet: TGLColorVector = (X: 0.62352; Y: 0.372549; Z: 0.623529; W: 1);
+  clrBrown: TGLColorVector = (X: 0.647059; Y: 0.164706; Z: 0.164706; W: 1);
+  clrCadetBlue: TGLColorVector = (X: 0.372549; Y: 0.623529; Z: 0.623529; W: 1);
+  clrCoral: TGLColorVector = (X: 1; Y: 0.498039; Z: 0.0; W: 1);
+  clrCornflowerBlue: TGLColorVector = (X: 0.258824; Y: 0.258824; Z: 0.435294; W: 1);
+  clrDarkGreen: TGLColorVector = (X: 0.184314; Y: 0.309804; Z: 0.184314; W: 1);
+  clrDarkOliveGreen: TGLColorVector = (X: 0.309804; Y: 0.309804; Z: 0.184314; W: 1);
+  clrDarkOrchid: TGLColorVector = (X: 0.6; Y: 0.196078; Z: 0.8; W: 1);
+  clrDarkSlateBlue: TGLColorVector = (X: 0.419608; Y: 0.137255; Z: 0.556863; W: 1);
+  clrDarkSlateGray: TGLColorVector = (X: 0.184314; Y: 0.309804; Z: 0.309804; W: 1);
+  clrDarkSlateGrey: TGLColorVector = (X: 0.184314; Y: 0.309804; Z: 0.309804; W: 1);
+  clrDarkTurquoise: TGLColorVector = (X: 0.439216; Y: 0.576471; Z: 0.858824; W: 1);
+  clrFirebrick: TGLColorVector = (X: 0.556863; Y: 0.137255; Z: 0.137255; W: 1);
+  clrForestGreen: TGLColorVector = (X: 0.137255; Y: 0.556863; Z: 0.137255; W: 1);
+  clrFuchsia: TGLColorVector = (X: 1; Y: 0; Z: 1; W: 1);
+  clrGold: TGLColorVector = (X: 0.8; Y: 0.498039; Z: 0.196078; W: 1);
+  clrGoldenrod: TGLColorVector = (X: 0.858824; Y: 0.858824; Z: 0.439216; W: 1);
+  clrGreenYellow: TGLColorVector = (X: 0.576471; Y: 0.858824; Z: 0.439216; W: 1);
+  clrIndian: TGLColorVector = (X: 0.309804; Y: 0.184314; Z: 0.184314; W: 1);
+  clrKhaki: TGLColorVector = (X: 0.623529; Y: 0.623529; Z: 0.372549; W: 1);
+  clrLightBlue: TGLColorVector = (X: 0.74902; Y: 0.847059; Z: 0.847059; W: 1);
+  clrLightSteelBlue: TGLColorVector = (X: 0.560784; Y: 0.560784; Z: 0.737255; W: 1);
+  clrLime: TGLColorVector = (X: 0; Y: 1; Z: 0; W: 1);
+  clrLimeGreen: TGLColorVector = (X: 0.196078; Y: 0.8; Z: 0.196078; W: 1);
+  clrMaroon: TGLColorVector = (X: 0.556863; Y: 0.137255; Z: 0.419608; W: 1);
+  clrMediumAquamarine: TGLColorVector = (X: 0.196078; Y: 0.8; Z: 0.6; W: 1);
+  clrMediumBlue: TGLColorVector = (X: 0.196078; Y: 0.196078; Z: 0.8; W: 1);
+  clrMediumForestGreen: TGLColorVector = (X: 0.419608; Y: 0.556863; Z: 0.137255; W: 1);
+  clrMediumGoldenrod: TGLColorVector = (X: 0.917647; Y: 0.917647; Z: 0.678431; W: 1);
+  clrMediumOrchid: TGLColorVector = (X: 0.576471; Y: 0.439216; Z: 0.858824; W: 1);
+  clrMediumSeaGreen: TGLColorVector = (X: 0.258824; Y: 0.435294; Z: 0.258824; W: 1);
+  clrMediumSlateBlue: TGLColorVector = (X: 0.498039; Y: 0; Z: 1; W: 1);
+  clrMediumSpringGreen: TGLColorVector = (X: 0.498039; Y: 1; Z: 0; W: 1);
+  clrMediumTurquoise: TGLColorVector = (X: 0.439216; Y: 0.858824; Z: 0.858824; W: 1);
+  clrMediumViolet: TGLColorVector = (X: 0.858824; Y: 0.439216; Z: 0.576471; W: 1);
+  clrMediumPurple: TGLColorVector = (X: 0.73; Y: 0.16; Z: 0.96; W: 1);
+  clrMidnightBlue: TGLColorVector = (X: 0.184314; Y: 0.184314; Z: 0.309804; W: 1);
+  clrNavy: TGLColorVector = (X: 0.137255; Y: 0.137255; Z: 0.556863; W: 1);
+  clrNavyBlue: TGLColorVector = (X: 0.137255; Y: 0.137255; Z: 0.556863; W: 1);
+  clrOrange: TGLColorVector = (X: 1; Y: 0.5; Z: 0.0; W: 1);
+  clrOrangeRed: TGLColorVector = (X: 1; Y: 0.25; Z: 0; W: 1);
+  clrOrchid: TGLColorVector = (X: 0.858824; Y: 0.439216; Z: 0.858824; W: 1);
+  clrPaleGreen: TGLColorVector = (X: 0.560784; Y: 0.737255; Z: 0.560784; W: 1);
+  clrPink: TGLColorVector = (X: 0.737255; Y: 0.560784; Z: 0.560784; W: 1);
+  clrPlum: TGLColorVector = (X: 0.917647; Y: 0.678431; Z: 0.917647; W: 1);
+  clrSalmon: TGLColorVector = (X: 0.435294; Y: 0.258824; Z: 0.258824; W: 1);
+  clrSeaGreen: TGLColorVector = (X: 0.137255; Y: 0.556863; Z: 0.419608; W: 1);
+  clrSienna: TGLColorVector = (X: 0.556863; Y: 0.419608; Z: 0.137255; W: 1);
+  clrSkyBlue: TGLColorVector = (X: 0.196078; Y: 0.6; Z: 0.8; W: 1);
+  clrSlateBlue: TGLColorVector = (X: 0; Y: 0.498039; Z: 1; W: 1);
+  clrSpringGreen: TGLColorVector = (X: 0; Y: 1; Z: 0.498039; W: 1);
+  clrSteelBlue: TGLColorVector = (X: 0.137255; Y: 0.419608; Z: 0.556863; W: 1);
+  clrTan: TGLColorVector = (X: 0.858824; Y: 0.576471; Z: 0.439216; W: 1);
+  clrThistle: TGLColorVector = (X: 0.847059; Y: 0.74902; Z: 0.847059; W: 1);
+  clrTurquoise: TGLColorVector = (X: 0.678431; Y: 0.917647; Z: 0.917647; W: 1);
+  clrViolet: TGLColorVector = (X: 0.309804; Y: 0.184314; Z: 0.309804; W: 1);
+  clrVioletRed: TGLColorVector = (X: 0.8; Y: 0.196078; Z: 0.6; W: 1);
+  clrYellowGreen: TGLColorVector = (X: 0.6; Y: 0.8; Z: 0.196078; W: 1);
+  clrSummerSky: TGLColorVector = (X: 0.22; Y: 0.69; Z: 0.87; W: 1);
+  clrRichBlue: TGLColorVector = (X: 0.35; Y: 0.35; Z: 0.67; W: 1);
+  clrBrass: TGLColorVector = (X: 0.71; Y: 0.65; Z: 0.26; W: 1);
+  clrCopper: TGLColorVector = (X: 0.72; Y: 0.45; Z: 0.20; W: 1);
+  clrBronze: TGLColorVector = (X: 0.55; Y: 0.47; Z: 0.14; W: 1);
+  clrBronze2: TGLColorVector = (X: 0.65; Y: 0.49; Z: 0.24; W: 1);
+  clrSilver: TGLColorVector = (X: 0.90; Y: 0.91; Z: 0.98; W: 1);
+  clrBrightGold: TGLColorVector = (X: 0.85; Y: 0.85; Z: 0.10; W: 1);
+  clrOldGold: TGLColorVector = (X: 0.81; Y: 0.71; Z: 0.23; W: 1);
+  clrFeldspar: TGLColorVector = (X: 0.82; Y: 0.57; Z: 0.46; W: 1);
+  clrQuartz: TGLColorVector = (X: 0.85; Y: 0.85; Z: 0.95; W: 1);
+  clrNeonPink: TGLColorVector = (X: 1.00; Y: 0.43; Z: 0.78; W: 1);
+  clrDarkPurple: TGLColorVector = (X: 0.53; Y: 0.12; Z: 0.47; W: 1);
+  clrNeonBlue: TGLColorVector = (X: 0.30; Y: 0.30; Z: 1.00; W: 1);
+  clrCoolCopper: TGLColorVector = (X: 0.85; Y: 0.53; Z: 0.10; W: 1);
+  clrMandarinOrange: TGLColorVector = (X: 0.89; Y: 0.47; Z: 0.20; W: 1);
+  clrLightWood: TGLColorVector = (X: 0.91; Y: 0.76; Z: 0.65; W: 1);
+  clrMediumWood: TGLColorVector = (X: 0.65; Y: 0.50; Z: 0.39; W: 1);
+  clrDarkWood: TGLColorVector = (X: 0.52; Y: 0.37; Z: 0.26; W: 1);
+  clrSpicyPink: TGLColorVector = (X: 1.00; Y: 0.11; Z: 0.68; W: 1);
+  clrSemiSweetChoc: TGLColorVector = (X: 0.42; Y: 0.26; Z: 0.15; W: 1);
+  clrFlesh: TGLColorVector = (X: 0.96; Y: 0.80; Z: 0.69; W: 1);
+  clrNewTan: TGLColorVector = (X: 0.92; Y: 0.78; Z: 0.62; W: 1);
+  clrNewMidnightBlue: TGLColorVector = (X: 0.00; Y: 0.00; Z: 0.61; W: 1);
+  clrVeryDarkBrown: TGLColorVector = (X: 0.35; Y: 0.16; Z: 0.14; W: 1);
+  clrDarkBrown: TGLColorVector = (X: 0.36; Y: 0.25; Z: 0.20; W: 1);
+  clrDarkTan: TGLColorVector = (X: 0.59; Y: 0.41; Z: 0.31; W: 1);
+  clrGreenCopper: TGLColorVector = (X: 0.32; Y: 0.49; Z: 0.46; W: 1);
+  clrDkGreenCopper: TGLColorVector = (X: 0.29; Y: 0.46; Z: 0.43; W: 1);
+  clrDustyRose: TGLColorVector = (X: 0.52; Y: 0.39; Z: 0.39; W: 1);
+  clrHuntersGreen: TGLColorVector = (X: 0.13; Y: 0.37; Z: 0.31; W: 1);
+  clrScarlet: TGLColorVector = (X: 0.55; Y: 0.09; Z: 0.09; W: 1);
+  clrLightPurple: TGLColorVector = (X: 0.87; Y: 0.58; Z: 0.98; W: 1);
+  clrVeryLightPurple: TGLColorVector = (X: 0.94; Y: 0.81; Z: 0.99; W: 1);
+  clrGreen: TGLColorVector = (X: 0; Y: 0.5; Z: 0; W: 1);
+  clrOlive: TGLColorVector = (X: 0.5; Y: 0.5; Z: 1; W: 1);
+  clrPurple: TGLColorVector = (X: 1; Y: 0; Z: 1; W: 1);
+  clrTeal: TGLColorVector = (X: 0; Y: 0.5; Z: 0.5; W: 1);
+  clrRed: TGLColorVector = (X: 1; Y: 0; Z: 0; W: 1);
+  clrYellow: TGLColorVector = (X: 1; Y: 1; Z: 0; W: 1);
+  clrWheat: TGLColorVector = (X: 0.847059; Y: 0.847059; Z: 0.74902; W: 1);
 
 
   cDefaultNormalMapScale = 0.125;
   cDefaultNormalMapScale = 0.125;
 
 
@@ -386,7 +386,7 @@ begin
   Result := vColorManager;
   Result := vColorManager;
 end;
 end;
 
 
-function ConvertWinColor(aColor: TColor; alpha: Single = 1): TColorVector;
+function ConvertWinColor(aColor: TColor; alpha: Single = 1): TGLColorVector;
 var
 var
   winColor: Integer;
   winColor: Integer;
 begin
 begin
@@ -443,13 +443,13 @@ begin
   clrBackground := ConvertWinColor(clBackground);
   clrBackground := ConvertWinColor(clBackground);
 end;
 end;
 
 
-function ConvertColorVector(const aColor: TColorVector): TColor;
+function ConvertColorVector(const aColor: TGLColorVector): TColor;
 begin
 begin
   Result := RGB2Color(Round(255 * aColor.X), Round(255 * aColor.Y),
   Result := RGB2Color(Round(255 * aColor.X), Round(255 * aColor.Y),
     Round(255 * aColor.Z));
     Round(255 * aColor.Z));
 end;
 end;
 
 
-function ConvertColorVector(const aColor: TColorVector;
+function ConvertColorVector(const aColor: TGLColorVector;
   intensity: Single): TColor;
   intensity: Single): TColor;
 begin
 begin
   intensity := 255 * intensity;
   intensity := 255 * intensity;
@@ -457,7 +457,7 @@ begin
     Round(intensity * aColor.Z));
     Round(intensity * aColor.Z));
 end;
 end;
 
 
-function ConvertRGBColor(const aColor: array of Byte): TColorVector;
+function ConvertRGBColor(const aColor: array of Byte): TGLColorVector;
 var
 var
   n: Integer;
   n: Integer;
 begin
 begin
@@ -488,7 +488,7 @@ begin
 end;
 end;
 
 
 constructor TGLColor.CreateInitialized(AOwner: TPersistent;
 constructor TGLColor.CreateInitialized(AOwner: TPersistent;
-  const color: TColorVector; changeEvent: TNotifyEvent = nil);
+  const color: TGLColorVector; changeEvent: TNotifyEvent = nil);
 begin
 begin
   Create(AOwner);
   Create(AOwner);
   Initialize(color);
   Initialize(color);
@@ -502,7 +502,7 @@ begin
   inherited;
   inherited;
 end;
 end;
 
 
-procedure TGLColor.Initialize(const color: TColorVector);
+procedure TGLColor.Initialize(const color: TGLColorVector);
 begin
 begin
   SetVector(FColor, color);
   SetVector(FColor, color);
   if vUseDefaultColorSets then
   if vUseDefaultColorSets then
@@ -513,13 +513,13 @@ begin
   end;
   end;
 end;
 end;
 
 
-procedure TGLColor.SetColorVector(const aColor: TColorVector);
+procedure TGLColor.SetColorVector(const aColor: TGLColorVector);
 begin
 begin
   SetVector(FColor, aColor);
   SetVector(FColor, aColor);
   NotifyChange(Self);
   NotifyChange(Self);
 end;
 end;
 
 
-procedure TGLColor.SetDirectColorVector(const aColor: TColorVector);
+procedure TGLColor.SetDirectColorVector(const aColor: TGLColorVector);
 begin
 begin
   SetVector(FColor, aColor);
   SetVector(FColor, aColor);
 end;
 end;
@@ -719,20 +719,20 @@ end;
 // ------------------ TGLColorManager ------------------
 // ------------------ TGLColorManager ------------------
 // ------------------
 // ------------------
 
 
-function TGLColorManager.FindColor(const aName: String): TColorVector;
+function TGLColorManager.FindColor(const aName: String): TGLColorVector;
 var
 var
   i: Integer;
   i: Integer;
 begin
 begin
   Result := clrBlack;
   Result := clrBlack;
   for i := 0 to Count - 1 do
   for i := 0 to Count - 1 do
-    if CompareText(string(TColorEntry(Items[i]^).Name), aName) = 0 then
+    if CompareText(string(TGLColorEntry(Items[i]^).Name), aName) = 0 then
     begin
     begin
-      SetVector(Result, TColorEntry(Items[i]^).color);
+      SetVector(Result, TGLColorEntry(Items[i]^).color);
       Break;
       Break;
     end;
     end;
 end;
 end;
 
 
-function TGLColorManager.GetColor(const aName: String): TColorVector;
+function TGLColorManager.GetColor(const aName: String): TGLColorVector;
 var
 var
   workCopy: String;
   workCopy: String;
   delimiter: Integer;
   delimiter: Integer;
@@ -788,7 +788,7 @@ end;
 
 
 // ------------------------------------------------------------------------------
 // ------------------------------------------------------------------------------
 
 
-function TGLColorManager.GetColorName(const aColor: TColorVector): String;
+function TGLColorManager.GetColorName(const aColor: TGLColorVector): String;
 
 
 const
 const
   MinDiff = 1E-6;
   MinDiff = 1E-6;
@@ -798,14 +798,14 @@ var
 
 
 begin
 begin
   for i := 0 to Count - 1 do
   for i := 0 to Count - 1 do
-    with TColorEntry(Items[i]^) do
+    with TGLColorEntry(Items[i]^) do
       if (Abs(Color.X - aColor.X) < MinDiff) and
       if (Abs(Color.X - aColor.X) < MinDiff) and
         (Abs(Color.Y - aColor.Y) < MinDiff) and
         (Abs(Color.Y - aColor.Y) < MinDiff) and
         (Abs(Color.Z - aColor.Z) < MinDiff) and
         (Abs(Color.Z - aColor.Z) < MinDiff) and
         (Abs(Color.W - aColor.W) < MinDiff) then
         (Abs(Color.W - aColor.W) < MinDiff) then
         Break;
         Break;
   if i < Count then
   if i < Count then
-    Result := string(TColorEntry(Items[i]^).Name)
+    Result := string(TGLColorEntry(Items[i]^).Name)
   else
   else
     Result := Format('<%.3f %.3f %.3f %.3f>', [aColor.X, aColor.Y, aColor.Z,
     Result := Format('<%.3f %.3f %.3f %.3f>', [aColor.X, aColor.Y, aColor.Z,
       aColor.W]);
       aColor.W]);
@@ -818,16 +818,16 @@ var
   i: Integer;
   i: Integer;
 begin
 begin
   for i := 0 to Count - 1 do
   for i := 0 to Count - 1 do
-    FreeMem(Items[i], SizeOf(TColorEntry));
+    FreeMem(Items[i], SizeOf(TGLColorEntry));
   inherited Destroy;
   inherited Destroy;
 end;
 end;
 
 
 // ------------------------------------------------------------------------------
 // ------------------------------------------------------------------------------
 
 
 procedure TGLColorManager.AddColor(const aName: String;
 procedure TGLColorManager.AddColor(const aName: String;
-  const aColor: TColorVector);
+  const aColor: TGLColorVector);
 var
 var
-  newEntry: PColorEntry;
+  newEntry: PGLColorEntry;
 begin
 begin
   New(newEntry);
   New(newEntry);
   if newEntry = nil then
   if newEntry = nil then
@@ -845,7 +845,7 @@ var
   i: Integer;
   i: Integer;
 begin
 begin
   for i := 0 to Count - 1 do
   for i := 0 to Count - 1 do
-    Proc(string(TColorEntry(Items[i]^).Name));
+    Proc(string(TGLColorEntry(Items[i]^).Name));
 end;
 end;
 
 
 procedure TGLColorManager.EnumColors(AValues: TStrings);
 procedure TGLColorManager.EnumColors(AValues: TStrings);
@@ -853,7 +853,7 @@ var
   i: Integer;
   i: Integer;
 begin
 begin
   for i := 0 to Count - 1 do
   for i := 0 to Count - 1 do
-    AValues.Add(string(TColorEntry(Items[i]^).Name));
+    AValues.Add(string(TGLColorEntry(Items[i]^).Name));
 end;
 end;
 
 
 procedure TGLColorManager.RegisterDefaultColors;
 procedure TGLColorManager.RegisterDefaultColors;
@@ -1020,7 +1020,7 @@ var
 begin
 begin
   for i := 0 to Count - 1 do
   for i := 0 to Count - 1 do
   begin
   begin
-    if CompareText(string(TColorEntry(Items[i]^).Name), aName) = 0 then
+    if CompareText(string(TGLColorEntry(Items[i]^).Name), aName) = 0 then
     begin
     begin
       Delete(i);
       Delete(i);
       Break;
       Break;
@@ -1028,7 +1028,7 @@ begin
   end;
   end;
 end;
 end;
 
 
-procedure RegisterColor(const aName: String; const aColor: TColorVector);
+procedure RegisterColor(const aName: String; const aColor: TGLColorVector);
 begin
 begin
   ColorManager.AddColor(aName, aColor);
   ColorManager.AddColor(aName, aColor);
 end;
 end;

+ 136 - 99
Source/GLS.Coordinates.pas

@@ -161,6 +161,17 @@ type
     procedure CoordinateChanged(Sender: TGLCustomCoordinates); virtual; abstract;
     procedure CoordinateChanged(Sender: TGLCustomCoordinates); virtual; abstract;
   end;
   end;
 
 
+(* Calculates the barycentric coordinates for the point p on the triangle
+  defined by the vertices v1, v2 and v3. That is, solves
+  p = u * v1 + v * v2 + (1-u-v) * v3
+  for u,v.
+  Returns true if the point is inside the triangle, false otherwise.
+  NOTE: This function assumes that the point lies on the plane defined by the triangle.
+  If this is not the case, the function will not work correctly!
+  https://mathworld.wolfram.com/BarycentricCoordinates.html *)
+function BarycentricCoordinates(const V1, V2, V3, p: TAffineVector; var u, V: Single): Boolean;
+
+
 //-------------------- Conversions of Coordinates --------------------
 //-------------------- Conversions of Coordinates --------------------
 (*
 (*
   Helper functions to convert between different three dimensional coordinate
   Helper functions to convert between different three dimensional coordinate
@@ -170,43 +181,89 @@ type
 (* Convert Cylindrical to Cartesian [single] with no checks, theta in rad
 (* Convert Cylindrical to Cartesian [single] with no checks, theta in rad
   Ref: http://mathworld.wolfram.com/CylindricalCoordinates.html *)
   Ref: http://mathworld.wolfram.com/CylindricalCoordinates.html *)
 procedure Cylindrical_Cartesian(const r, theta, z1: single; var x, y, z: single); overload;
 procedure Cylindrical_Cartesian(const r, theta, z1: single; var x, y, z: single); overload;
-// Convert cylindrical to cartesian [double]. theta in rads
+(* Convert Cylindrical to Cartesian with no checks. Double version, theta in rads
+  Ref: http://mathworld.wolfram.com/CylindricalCoordinates.html *)
 procedure Cylindrical_Cartesian(const r, theta, z1: double; var x, y, z: double); overload;
 procedure Cylindrical_Cartesian(const r, theta, z1: double; var x, y, z: double); overload;
-// Convert cylindrical to cartesian [single] (with error check). theta in rad
+(* Convert Cylindrical to Cartesian with checks. [single], theta in rad
+  ierr: [0] = ok,
+  [1] = r out of bounds. Acceptable r: [0,inf)
+  [2] = theta out of bounds. Acceptable theta: [0,2pi)
+  [3] = z1 out of bounds. Acceptable z1 : (-inf,inf)
+  Ref: http://mathworld.wolfram.com/CylindricalCoordinates.html *)
 procedure Cylindrical_Cartesian(const r, theta, z1: single; var x, y, z: single;
 procedure Cylindrical_Cartesian(const r, theta, z1: single; var x, y, z: single;
   var ierr: integer); overload;
   var ierr: integer); overload;
-// Convert cylindrical to cartesian [double] (with error check). theta in rad
+(* Convert Cylindrical to Cartesian with checks. [double], theta in rad
+  ierr: [0] = ok,
+  [1] = r out of bounds. Acceptable r: [0,inf)
+  [2] = theta out of bounds. Acceptable theta: [0,2pi)
+  [3] = z1 out of bounds. Acceptable z1 : (-inf,inf)
+  Ref: http://mathworld.wolfram.com/CylindricalCoordinates.html *)
 procedure Cylindrical_Cartesian(const r, theta, z1: double; var x, y, z: double;
 procedure Cylindrical_Cartesian(const r, theta, z1: double; var x, y, z: double;
   var ierr: integer); overload;
   var ierr: integer); overload;
-// Convert cartesian to cylindrical [single]
+(* Convert Cartesian to Cylindrical no checks. Single *)
 procedure Cartesian_Cylindrical(const x, y, z1: single; var r, theta, z: single); overload;
 procedure Cartesian_Cylindrical(const x, y, z1: single; var r, theta, z: single); overload;
-// Convert cartesion to cylindrical [double]
+(* Convert Cartesian to Cylindrical no checks. Duoble *)
 procedure Cartesian_Cylindrical(const x, y, z1: double; var r, theta, z: double); overload;
 procedure Cartesian_Cylindrical(const x, y, z1: double; var r, theta, z: double); overload;
-// Convert spherical to cartesion. [single] theta,phi in rads
+
+(* Convert Spherical to Cartesian with no checks. [single] theta,phi in rads
+   Ref: http://mathworld.wolfram.com/SphericalCoordinates.html *)
 procedure Spherical_Cartesian(const r, theta, phi: single; var x, y, z: single); overload;
 procedure Spherical_Cartesian(const r, theta, phi: single; var x, y, z: single); overload;
-// Convert spherical to cartesion. [double] theta,phi in rads
+(* Convert Spherical to Cartesian with no checks. Double version. theta,phi in rads *)
 procedure Spherical_Cartesian(const r, theta, phi: double; var x, y, z: double); overload;
 procedure Spherical_Cartesian(const r, theta, phi: double; var x, y, z: double); overload;
-// Convert spherical to cartesian [single] (with error check).theta,phi in rad
+(* Convert Spherical to Cartesian [single] (with error check).theta,phi in rad
+  ierr: [0] = ok,
+  [1] = r out of bounds
+  [2] = theta out of bounds
+  [3] = phi out of bounds
+  Ref: http://mathworld.wolfram.com/SphericalCoordinates.html *)
 procedure Spherical_Cartesian(const r, theta, phi: single; var x, y, z: single;
 procedure Spherical_Cartesian(const r, theta, phi: single; var x, y, z: single;
   var ierr: integer); overload;
   var ierr: integer); overload;
 // Convert spherical to cartesian [double] (with error check).theta,phi in rad
 // Convert spherical to cartesian [double] (with error check).theta,phi in rad
 procedure Spherical_Cartesian(const r, theta, phi: double; var x, y, z: double;
 procedure Spherical_Cartesian(const r, theta, phi: double; var x, y, z: double;
   var ierr: integer); overload;
   var ierr: integer); overload;
-// Convert cartesian to spherical [single]
+(* Convert Cartesian to Spherical, no checks, single
+  Ref: http://mathworld.wolfram.com/SphericalCoordinates.html
+  NB: Could be optimised by using jclmath.pas unit *)
 procedure Cartesian_Spherical(const x, y, z: single; var r, theta, phi: single); overload;
 procedure Cartesian_Spherical(const x, y, z: single; var r, theta, phi: single); overload;
 procedure Cartesian_Spherical(const v: TAffineVector; var r, theta, phi: single); overload;
 procedure Cartesian_Spherical(const v: TAffineVector; var r, theta, phi: single); overload;
-// Convert cartesion to spherical [double]
+(* convert Cartesian to Spherical, no checks, double
+  Ref: http://mathworld.wolfram.com/SphericalCoordinates.html
+  NB: Could be optimised by using jclmath.pas unit? *)
 procedure Cartesian_Spherical(const x, y, z: double; var r, theta, phi: double); overload;
 procedure Cartesian_Spherical(const x, y, z: double; var r, theta, phi: double); overload;
-// Convert Prolate-Spheroidal to Cartesian. [single] eta, phi in rad
+(* Convert Prolate-Spheroidal to Cartesian with no checks. [single] eta, phi in rad
+  A system of curvilinear coordinates in which two sets of coordinate surfaces are
+  obtained by revolving the curves of the elliptic cylindrical coordinates about
+  the x-axis, which is relabeled the z-axis. The third set of coordinates
+  consists of planes passing through this axis.
+  The coordinate system is parameterised by parameter a.
+  A default value of a=1 is suggesed:
+  Ref: http://mathworld.wolfram.com/ProlateSpheroidalCoordinates.html *)
 procedure ProlateSpheroidal_Cartesian(const xi, eta, phi, a: single;
 procedure ProlateSpheroidal_Cartesian(const xi, eta, phi, a: single;
   var x, y, z: single); overload;
   var x, y, z: single); overload;
-// Convert Prolate-Spheroidal to Cantesian. [double] eta,phi in rad
+(* Convert Prolate-Spheroidal to Cartesian [double] eta,phi in rad
+  A system of curvilinear coordinates in which two sets of coordinate surfaces are
+  obtained by revolving the curves of the elliptic cylindrical coordinates about
+  the x-axis, which is relabeled the z-axis. The third set of coordinates
+  consists of planes passing through this axis.
+  The coordinate system is parameterised by parameter a. A default value of a=1 is
+  suggesed:
+  Ref: http://mathworld.wolfram.com/ProlateSpheroidalCoordinates.html *)
 procedure ProlateSpheroidal_Cartesian(const xi, eta, phi, a: double;
 procedure ProlateSpheroidal_Cartesian(const xi, eta, phi, a: double;
   var x, y, z: double); overload;
   var x, y, z: double); overload;
-// Convert Prolate-Spheroidal to Cartesian [single](with error check). eta,phi in rad
+(* Convert Prolate-Spheroidal to Cartesian [single](with error check). eta,phi in rad
+  ierr: [0] = ok,
+  [1] = xi out of bounds. Acceptable xi: [0,inf)
+  [2] = eta out of bounds. Acceptable eta: [0,pi]
+  [3] = phi out of bounds. Acceptable phi: [0,2pi)
+  Ref: http://mathworld.wolfram.com/ProlateSpheroidalCoordinates.html *)
 procedure ProlateSpheroidal_Cartesian(const xi, eta, phi, a: single;
 procedure ProlateSpheroidal_Cartesian(const xi, eta, phi, a: single;
   var x, y, z: single; var ierr: integer); overload;
   var x, y, z: single; var ierr: integer); overload;
-// Convert Prolate-Spheroidal to Cartesian [single](with error check). eta,phi in rad
+(* Convert Prolate-Spheroidal to Cartesian [double](with error check). eta,phi in rad
+  ierr: [0] = ok,
+  [1] = xi out of bounds. Acceptable xi: [0,inf)
+  [2] = eta out of bounds. Acceptable eta: [0,pi]
+  [3] = phi out of bounds. Acceptable phi: [0,2pi)
+  Ref: http://mathworld.wolfram.com/ProlateSpheroidalCoordinates.html *)
 procedure ProlateSpheroidal_Cartesian(const xi, eta, phi, a: double;
 procedure ProlateSpheroidal_Cartesian(const xi, eta, phi, a: double;
   var x, y, z: double;  var ierr: integer); overload;
   var x, y, z: double;  var ierr: integer); overload;
 // Convert Oblate-Spheroidal to Cartesian. [Single] eta, phi in rad
 // Convert Oblate-Spheroidal to Cartesian. [Single] eta, phi in rad
@@ -218,19 +275,30 @@ procedure OblateSpheroidal_Cartesian(const xi, eta, phi, a: double;
 // Convert Oblate-Spheroidal to Cartesian (with error check). eta,phi in rad
 // Convert Oblate-Spheroidal to Cartesian (with error check). eta,phi in rad
 procedure OblateSpheroidal_Cartesian(const xi, eta, phi, a: single;
 procedure OblateSpheroidal_Cartesian(const xi, eta, phi, a: single;
   var x, y, z: single; var ierr: integer); overload;
   var x, y, z: single; var ierr: integer); overload;
-// Convert Oblate-Spheroidal to Cartesian (with error check).[Double] eta,phi in rad
+(* Convert Oblate-Spheroidal to Cartesian with checks. [Double] eta,phi in rad
+  ierr: [0] = ok,
+  [1] = xi out of bounds. Acceptable xi: [0,inf)
+  [2] = eta out of bounds. Acceptable eta: [-0.5*pi,0.5*pi]
+  [3] = phi out of bounds. Acceptable phi: [0,2*pi)
+  Ref: http://mathworld.wolfram.com/ProlateSpheroidalCoordinates.html *)
 procedure OblateSpheroidal_Cartesian(const xi, eta, phi, a: double;
 procedure OblateSpheroidal_Cartesian(const xi, eta, phi, a: double;
   var x, y, z: double; var ierr: integer); overload;
   var x, y, z: double; var ierr: integer); overload;
 // Convert Bipolar to Cartesian. u in rad
 // Convert Bipolar to Cartesian. u in rad
 procedure BipolarCylindrical_Cartesian(const u, v, z1, a: single;
 procedure BipolarCylindrical_Cartesian(const u, v, z1, a: single;
   var x, y, z: single); overload;
   var x, y, z: single); overload;
-// Convert Bipolar to Cartesian. [Double] u in rad
+(* Convert BiPolarCylindrical to Cartesian with no checks. Double, u in rad
+  http://mathworld.wolfram.com/BipolarCylindricalCoordinates.html *)
 procedure BipolarCylindrical_Cartesian(const u, v, z1, a: double;
 procedure BipolarCylindrical_Cartesian(const u, v, z1, a: double;
   var x, y, z: double); overload;
   var x, y, z: double); overload;
 // Convert Bipolar to Cartesian (with error check). u in rad
 // Convert Bipolar to Cartesian (with error check). u in rad
 procedure BipolarCylindrical_Cartesian(const u, v, z1, a: single;
 procedure BipolarCylindrical_Cartesian(const u, v, z1, a: single;
   var x, y, z: single; var ierr: integer); overload;
   var x, y, z: single; var ierr: integer); overload;
-// Convert Bipolar to Cartesian (with error check). [Double] u in rad
+(* Convert Oblate-Spheroidal to Cartesian with checks. Double, u in rad
+  ierr: [0] = ok,
+  [1] = u out of bounds. Acceptable u: [0,2*pi)
+  [2] = v out of bounds. Acceptable v: (-inf,inf)
+  [3] = z1 out of bounds. Acceptable z1: (-inf,inf)
+  Ref: https://mathworld.wolfram.com/BipolarCylindricalCoordinates.html *)
 procedure BipolarCylindrical_Cartesian(const u, v, z1, a: double;
 procedure BipolarCylindrical_Cartesian(const u, v, z1, a: double;
   var x, y, z: double; var ierr: integer); overload;
   var x, y, z: double; var ierr: integer); overload;
 
 
@@ -640,31 +708,20 @@ end;
 // ----------------- Conversions of coordinates --------------------
 // ----------------- Conversions of coordinates --------------------
 
 
 // ----------------- Cylindrical_Cartesian ----------------------
 // ----------------- Cylindrical_Cartesian ----------------------
-
 procedure Cylindrical_Cartesian(const r, theta, z1: single; var x, y, z: single);
 procedure Cylindrical_Cartesian(const r, theta, z1: single; var x, y, z: single);
-
 begin
 begin
   SinCosine(theta, r, y, x);
   SinCosine(theta, r, y, x);
   z := z1;
   z := z1;
 end;
 end;
 
 
 // ----- Cylindrical_Cartesian -------------------------------------
 // ----- Cylindrical_Cartesian -------------------------------------
-(* Convert Cylindrical to Cartesian with no checks. Double version
-  Ref: http://mathworld.wolfram.com/CylindricalCoordinates.html *)
 procedure Cylindrical_Cartesian(const r, theta, z1: double; var x, y, z: double);
 procedure Cylindrical_Cartesian(const r, theta, z1: double; var x, y, z: double);
-
 begin
 begin
   SinCosine(theta, r, y, x);
   SinCosine(theta, r, y, x);
   z := z1;
   z := z1;
 end;
 end;
 
 
 // ------------------ Cylindrical_Cartesian -----------------------
 // ------------------ Cylindrical_Cartesian -----------------------
-(* Convert Cylindrical to Cartesian with checks.
-  ierr: [0] = ok,
-  [1] = r out of bounds. Acceptable r: [0,inf)
-  [2] = theta out of bounds. Acceptable theta: [0,2pi)
-  [3] = z1 out of bounds. Acceptable z1 : (-inf,inf)
-  Ref: http://mathworld.wolfram.com/CylindricalCoordinates.html *)
 procedure Cylindrical_Cartesian(const r, theta, z1: single; var x, y, z: single;
 procedure Cylindrical_Cartesian(const r, theta, z1: single; var x, y, z: single;
   var ierr: integer);
   var ierr: integer);
 
 
@@ -685,12 +742,6 @@ begin
 end;
 end;
 
 
 // ----- Cylindrical_Cartesian -------------------------------------------------
 // ----- Cylindrical_Cartesian -------------------------------------------------
-(* Convert Cylindrical to Cartesian with checks.
-  ierr: [0] = ok,
-  [1] = r out of bounds. Acceptable r: [0,inf)
-  [2] = theta out of bounds. Acceptable theta: [0,2pi)
-  [3] = z1 out of bounds. Acceptable z1 : (-inf,inf)
-  Ref: http://mathworld.wolfram.com/CylindricalCoordinates.html *)
 procedure Cylindrical_Cartesian(const r, theta, z1: double; var x, y, z: double;
 procedure Cylindrical_Cartesian(const r, theta, z1: double; var x, y, z: double;
   var ierr: integer);
   var ierr: integer);
 
 
@@ -711,7 +762,6 @@ begin
 end;
 end;
 
 
 // ----- Cartesian_Cylindrical -------------------------------------------------
 // ----- Cartesian_Cylindrical -------------------------------------------------
-(* Convert Cartesian to Cylindrical no checks. Single *)
 procedure Cartesian_Cylindrical(const x, y, z1: single; var r, theta, z: single);
 procedure Cartesian_Cylindrical(const x, y, z1: single; var r, theta, z: single);
 begin
 begin
   r := sqrt(x * x + y * y);
   r := sqrt(x * x + y * y);
@@ -720,7 +770,6 @@ begin
 end;
 end;
 
 
 // ----- Cartesian_Cylindrical -------------------------------------------------
 // ----- Cartesian_Cylindrical -------------------------------------------------
-(* Convert Cartesian to Cylindrical no checks. Duoble *)
 procedure Cartesian_Cylindrical(const x, y, z1: double; var r, theta, z: double);
 procedure Cartesian_Cylindrical(const x, y, z1: double; var r, theta, z: double);
 begin
 begin
   r := sqrt(x * x + y * y);
   r := sqrt(x * x + y * y);
@@ -729,34 +778,24 @@ begin
 end;
 end;
 
 
 // ----- Spherical_Cartesian ---------------------------------------------------
 // ----- Spherical_Cartesian ---------------------------------------------------
-(* Convert Spherical to Cartesian with no checks.
-  Ref: http://mathworld.wolfram.com/SphericalCoordinates.html *)
 procedure Spherical_Cartesian(const r, theta, phi: single; var x, y, z: single);
 procedure Spherical_Cartesian(const r, theta, phi: single; var x, y, z: single);
 var
 var
   a: single;
   a: single;
 begin
 begin
-  SinCosine(phi, r, a, z); // z = r*cos(phi), a=r*sin(phi)
+  SinCosine(phi, r, a, z); // z = r*cos(phi), a = r*sin(phi)
   SinCosine(theta, a, y, x); // x = a*cos(theta), y = a*sin(theta)}
   SinCosine(theta, a, y, x); // x = a*cos(theta), y = a*sin(theta)}
 end;
 end;
 
 
 // ----- Spherical_Cartesian ---------------------------------------------------
 // ----- Spherical_Cartesian ---------------------------------------------------
-(* Convert Spherical to Cartesian with no checks. Double version.
-  Ref: http://mathworld.wolfram.com/SphericalCoordinates.html *)
 procedure Spherical_Cartesian(const r, theta, phi: double; var x, y, z: double);
 procedure Spherical_Cartesian(const r, theta, phi: double; var x, y, z: double);
 var
 var
   a: double;
   a: double;
 begin
 begin
-  SinCosine(phi, r, a, z); // z = r*cos(phi), a=r*sin(phi)
+  SinCosine(phi, r, a, z); // z = r*cos(phi), a = r*sin(phi)
   SinCosine(theta, a, y, x); // x = a*cos(theta), y = a*sin(theta)}
   SinCosine(theta, a, y, x); // x = a*cos(theta), y = a*sin(theta)}
 end;
 end;
 
 
 // ----- Spherical_Cartesian ---------------------------------------------------
 // ----- Spherical_Cartesian ---------------------------------------------------
-(* Convert Spherical to Cartesian with checks.
-  ierr: [0] = ok,
-  [1] = r out of bounds
-  [2] = theta out of bounds
-  [3] = phi out of bounds
-  Ref: http://mathworld.wolfram.com/SphericalCoordinates.html *)
 procedure Spherical_Cartesian(const r, theta, phi: single; var x, y, z: single;
 procedure Spherical_Cartesian(const r, theta, phi: single; var x, y, z: single;
   var ierr: integer);
   var ierr: integer);
 var
 var
@@ -772,7 +811,7 @@ begin
     ierr := 0;
     ierr := 0;
   if (ierr = 0) then
   if (ierr = 0) then
   begin
   begin
-    SinCosine(phi, r, a, z); // z = r*cos(phi), a=r*sin(phi)
+    SinCosine(phi, r, a, z); // z = r*cos(phi), a = r*sin(phi)
     SinCosine(theta, a, y, x); // x = a*cos(theta), y = a*sin(theta)}
     SinCosine(theta, a, y, x); // x = a*cos(theta), y = a*sin(theta)}
   end;
   end;
 end;
 end;
@@ -806,9 +845,6 @@ begin
 end;
 end;
 
 
 // ----- Cartesian_Spherical ---------------------------------------------------
 // ----- Cartesian_Spherical ---------------------------------------------------
-(* convert Cartesian to Spherical, no checks, single
-  Ref: http://mathworld.wolfram.com/SphericalCoordinates.html
-  NB: Could be optimised by using jclmath.pas unit? *)
 procedure Cartesian_Spherical(const x, y, z: single; var r, theta, phi: single);
 procedure Cartesian_Spherical(const x, y, z: single; var r, theta, phi: single);
 begin
 begin
   r := sqrt((x * x) + (y * y) + (z * z));
   r := sqrt((x * x) + (y * y) + (z * z));
@@ -824,9 +860,6 @@ begin
 end;
 end;
 
 
 // ----- Cartesian_Spherical ---------------------------------------------------
 // ----- Cartesian_Spherical ---------------------------------------------------
-(* convert Cartesian to Spherical, no checks, double
-  Ref: http://mathworld.wolfram.com/SphericalCoordinates.html
-  NB: Could be optimised by using jclmath.pas unit? *)
 procedure Cartesian_Spherical(const x, y, z: double; var r, theta, phi: double);
 procedure Cartesian_Spherical(const x, y, z: double; var r, theta, phi: double);
 begin
 begin
   r := sqrt((x * x) + (y * y) + (z * z));
   r := sqrt((x * x) + (y * y) + (z * z));
@@ -835,15 +868,6 @@ begin
 end;
 end;
 
 
 // ----- ProlateSpheroidal_Cartesian -------------------------------------------
 // ----- ProlateSpheroidal_Cartesian -------------------------------------------
-(* Convert Prolate-Spheroidal to Cartesian with no checks.
-  A system of curvilinear coordinates in which two sets of coordinate surfaces are
-  obtained by revolving the curves of the elliptic cylindrical coordinates about
-  the x-axis, which is relabeled the z-axis. The third set of coordinates
-  consists of planes passing through this axis.
-  The coordinate system is parameterised by parameter a. A default value of a=1 is
-  suggesed:
-  http://documents.wolfram.com/v4/AddOns/StandardPackages/Calculus/VectorAnalysis.html
-  Ref: http://mathworld.wolfram.com/ProlateSpheroidalCoordinates.html *)
 procedure ProlateSpheroidal_Cartesian(const xi, eta, phi, a: single; var x, y, z: single);
 procedure ProlateSpheroidal_Cartesian(const xi, eta, phi, a: single; var x, y, z: single);
 var
 var
   sn, cs, snphi, csphi, shx, chx: single;
   sn, cs, snphi, csphi, shx, chx: single;
@@ -858,15 +882,6 @@ begin
 end;
 end;
 
 
 // ----- ProlateSpheroidal_Cartesian -------------------------------------------
 // ----- ProlateSpheroidal_Cartesian -------------------------------------------
-(* Convert Prolate-Spheroidal to Cartesian with no checks. Double version.
-  A system of curvilinear coordinates in which two sets of coordinate surfaces are
-  obtained by revolving the curves of the elliptic cylindrical coordinates about
-  the x-axis, which is relabeled the z-axis. The third set of coordinates
-  consists of planes passing through this axis.
-  The coordinate system is parameterised by parameter a. A default value of a=1 is
-  suggesed:
-  http://documents.wolfram.com/v4/AddOns/StandardPackages/Calculus/VectorAnalysis.html
-  Ref: http://mathworld.wolfram.com/ProlateSpheroidalCoordinates.html *)
 procedure ProlateSpheroidal_Cartesian(const xi, eta, phi, a: double; var x, y, z: double);
 procedure ProlateSpheroidal_Cartesian(const xi, eta, phi, a: double; var x, y, z: double);
 var
 var
   sn, cs, snphi, csphi, shx, chx: double;
   sn, cs, snphi, csphi, shx, chx: double;
@@ -881,12 +896,6 @@ begin
 end;
 end;
 
 
 // ----- ProlateSpheroidal_Cartesian -------------------------------------------
 // ----- ProlateSpheroidal_Cartesian -------------------------------------------
-(* Convert Prolate-Spheroidal to Cartesian with checks.
-  ierr: [0] = ok,
-  [1] = xi out of bounds. Acceptable xi: [0,inf)
-  [2] = eta out of bounds. Acceptable eta: [0,pi]
-  [3] = phi out of bounds. Acceptable phi: [0,2pi)
-  Ref: http://mathworld.wolfram.com/ProlateSpheroidalCoordinates.html *)
 procedure ProlateSpheroidal_Cartesian(const xi, eta, phi, a: single;
 procedure ProlateSpheroidal_Cartesian(const xi, eta, phi, a: single;
   var x, y, z: single; var ierr: integer); overload;
   var x, y, z: single; var ierr: integer); overload;
 var
 var
@@ -913,12 +922,6 @@ begin
 end;
 end;
 
 
 // ----- ProlateSpheroidal_Cartesian -------------------------------------------
 // ----- ProlateSpheroidal_Cartesian -------------------------------------------
-(* Convert Prolate-Spheroidal to Cartesian with checks. Double Version.
-  ierr: [0] = ok,
-  [1] = xi out of bounds. Acceptable xi: [0,inf)
-  [2] = eta out of bounds. Acceptable eta: [0,pi]
-  [3] = phi out of bounds. Acceptable phi: [0,2pi)
-  Ref: http://mathworld.wolfram.com/ProlateSpheroidalCoordinates.html *)
 procedure ProlateSpheroidal_Cartesian(const xi, eta, phi, a: double;
 procedure ProlateSpheroidal_Cartesian(const xi, eta, phi, a: double;
   var x, y, z: double; var ierr: integer); overload;
   var x, y, z: double; var ierr: integer); overload;
 var
 var
@@ -1023,12 +1026,6 @@ begin
 end;
 end;
 
 
 // ----- OblateSpheroidal_Cartesian -------------------------------------------
 // ----- OblateSpheroidal_Cartesian -------------------------------------------
-(* Convert Oblate-Spheroidal to Cartesian with checks. Double Version.
-  ierr: [0] = ok,
-  [1] = xi out of bounds. Acceptable xi: [0,inf)
-  [2] = eta out of bounds. Acceptable eta: [-0.5*pi,0.5*pi]
-  [3] = phi out of bounds. Acceptable phi: [0,2*pi)
-  Ref: http://mathworld.wolfram.com/ProlateSpheroidalCoordinates.html *)
 procedure OblateSpheroidal_Cartesian(const xi, eta, phi, a: double;
 procedure OblateSpheroidal_Cartesian(const xi, eta, phi, a: double;
   var x, y, z: double; var ierr: integer); overload;
   var x, y, z: double; var ierr: integer); overload;
 var
 var
@@ -1070,8 +1067,6 @@ begin
 end;
 end;
 
 
 // ----- BipolarCylindrical_Cartesian ------------------------------------------
 // ----- BipolarCylindrical_Cartesian ------------------------------------------
-(* Convert BiPolarCylindrical to Cartesian with no checks. Double Version
-  http://mathworld.wolfram.com/BipolarCylindricalCoordinates.html *)
 procedure BipolarCylindrical_Cartesian(const u, v, z1, a: double; var x, y, z: double);
 procedure BipolarCylindrical_Cartesian(const u, v, z1, a: double; var x, y, z: double);
 var
 var
   cs, sn, shx, chx: double;
   cs, sn, shx, chx: double;
@@ -1112,12 +1107,6 @@ begin
 end;
 end;
 
 
 // ----- BipolarCylindrical_Cartesian ------------------------------------------
 // ----- BipolarCylindrical_Cartesian ------------------------------------------
-(* Convert Oblate-Spheroidal to Cartesian with checks. Double Version
-  ierr: [0] = ok,
-  [1] = u out of bounds. Acceptable u: [0,2*pi)
-  [2] = v out of bounds. Acceptable v: (-inf,inf)
-  [3] = z1 out of bounds. Acceptable z1: (-inf,inf)
-  Ref: http://mathworld.wolfram.com/BiPolarCylindricalCoordinates.html *)
 procedure BipolarCylindrical_Cartesian(const u, v, z1, a: double;
 procedure BipolarCylindrical_Cartesian(const u, v, z1, a: double;
   var x, y, z: double; var ierr: integer); overload;
   var x, y, z: double; var ierr: integer); overload;
 var
 var
@@ -1138,6 +1127,54 @@ begin
   end;
   end;
 end;
 end;
 
 
+function BarycentricCoordinates(const V1, V2, V3, p: TAffineVector;
+  var u, V: Single): Boolean;
+var
+  a1, a2: Integer;
+  n, e1, e2, pt: TAffineVector;
+begin
+  // calculate edges
+  VectorSubtract(V1, V3, e1);
+  VectorSubtract(V2, V3, e2);
+
+  // calculate p relative to v3
+  VectorSubtract(p, V3, pt);
+
+  // find the dominant axis
+  n := VectorCrossProduct(e1, e2);
+  AbsVector(n);
+  a1 := 0;
+  if n.Y > n.V[a1] then
+    a1 := 1;
+  if n.Z > n.V[a1] then
+    a1 := 2;
+
+  // use dominant axis for projection
+  case a1 of
+    0:
+      begin
+        a1 := 1;
+        a2 := 2;
+      end;
+    1:
+      begin
+        a1 := 0;
+        a2 := 2;
+      end;
+  else // 2:
+    a1 := 0;
+    a2 := 1;
+  end;
+
+  // solve for u and v
+  u := (pt.V[a2] * e2.V[a1] - pt.V[a1] * e2.V[a2]) /
+    (e1.V[a2] * e2.V[a1] - e1.V[a1] * e2.V[a2]);
+  V := (pt.V[a2] * e1.V[a1] - pt.V[a1] * e1.V[a2]) /
+    (e2.V[a2] * e1.V[a1] - e2.V[a1] * e1.V[a2]);
+
+  result := (u >= 0) and (V >= 0) and (u + V <= 1);
+end;
+
 
 
 //=====================================================================
 //=====================================================================
 initialization
 initialization

+ 1 - 1
Source/GLS.Extrusion.pas

@@ -926,7 +926,7 @@ type
   end;
   end;
   TRowData = record
   TRowData = record
     node: array of TNodeData;
     node: array of TNodeData;
-    color: TColorVector;
+    color: TGLColorVector;
     center: TVector3f;
     center: TVector3f;
     textcoordT: Single;
     textcoordT: Single;
   end;
   end;

+ 3 - 3
Source/GLS.FBORenderer.pas

@@ -808,7 +808,7 @@ end;
 procedure TGLFrameBuffer.Render(var rci: TGLRenderContextInfo; baseObject:
 procedure TGLFrameBuffer.Render(var rci: TGLRenderContextInfo; baseObject:
   TGLBaseSceneObject);
   TGLBaseSceneObject);
 var
 var
-  backColor: TColorVector;
+  backColor: TGLColorVector;
   buffer: TGLSceneBuffer;
   buffer: TGLSceneBuffer;
 begin
 begin
   Bind;
   Bind;
@@ -1278,7 +1278,7 @@ procedure TGLFBORenderer.RenderToFBO(var ARci: TGLRenderContextInfo);
 
 
 type
 type
   TGLStoredStates = record
   TGLStoredStates = record
-    ColorClearValue: TColorVector;
+    ColorClearValue: TGLColorVector;
     ColorWriteMask: TGLColorMask;
     ColorWriteMask: TGLColorMask;
     Tests: TGLStates;
     Tests: TGLStates;
   end;
   end;
@@ -1306,7 +1306,7 @@ type
   end;
   end;
 
 
 var
 var
-  backColor: TColorVector;
+  backColor: TGLColorVector;
   buffer: TGLSceneBuffer;
   buffer: TGLSceneBuffer;
   savedStates: TGLStoredStates;
   savedStates: TGLStoredStates;
   w, h: Integer;
   w, h: Integer;

+ 4 - 4
Source/GLS.FileMS3D.pas

@@ -123,10 +123,10 @@ type
   // *) ms3d_material_t;
   // *) ms3d_material_t;
   TMS3DMaterial = record
   TMS3DMaterial = record
     Name: array[0..31] of AnsiChar;
     Name: array[0..31] of AnsiChar;
-    Ambient: TColorVector;
-    Diffuse: TColorVector;
-    Specular: TColorVector;
-    Emissive: TColorVector;
+    Ambient: TGLColorVector;
+    Diffuse: TGLColorVector;
+    Specular: TGLColorVector;
+    Emissive: TGLColorVector;
     Shininess: single;
     Shininess: single;
     Transparency: single;
     Transparency: single;
     Mode: AnsiChar;
     Mode: AnsiChar;

+ 2 - 2
Source/GLS.FireFX.pas

@@ -79,7 +79,7 @@ type
     procedure Notification(AComponent: TComponent; Operation: TOperation); override;
     procedure Notification(AComponent: TComponent; Operation: TOperation); override;
     procedure CalcFire(deltaTime: Double; ParticleInterval, ParticleLife: Single;
     procedure CalcFire(deltaTime: Double; ParticleInterval, ParticleLife: Single;
       FireAlpha: Single);
       FireAlpha: Single);
-    procedure AffParticle3d(Color2: TColorVector; const mat: TGLMatrix);
+    procedure AffParticle3d(Color2: TGLColorVector; const mat: TGLMatrix);
   public
   public
     constructor Create(AOwner: TComponent); override;
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
     destructor Destroy; override;
@@ -526,7 +526,7 @@ begin
   end;
   end;
 end;
 end;
 
 
-procedure TGLFireFXManager.AffParticle3d(Color2: TColorVector; const mat: TGLMatrix);
+procedure TGLFireFXManager.AffParticle3d(Color2: TGLColorVector; const mat: TGLMatrix);
 var
 var
   vx, vy: TGLVector;
   vx, vy: TGLVector;
   i: Integer;
   i: Integer;

+ 1 - 1
Source/GLS.GameMenu.pas

@@ -164,7 +164,7 @@ var
   canvas: TGLCanvas;
   canvas: TGLCanvas;
   buffer: TGLSceneBuffer;
   buffer: TGLSceneBuffer;
   i, w, h, tw, Y: Integer;
   i, w, h, tw, Y: Integer;
-  color: TColorVector;
+  color: TGLColorVector;
   libMat: TGLLibMaterial;
   libMat: TGLLibMaterial;
 begin
 begin
   if Font = nil then
   if Font = nil then

+ 7 - 7
Source/GLS.Graph.pas

@@ -62,9 +62,9 @@ type
   end;
   end;
 
 
   TGLHeightFieldGetHeightEvent = procedure(const x, y: Single; var z: Single;
   TGLHeightFieldGetHeightEvent = procedure(const x, y: Single; var z: Single;
-    var Color: TColorVector; var TexPoint: TTexPoint) of object;
+    var Color: TGLColorVector; var TexPoint: TTexPoint) of object;
   TGLHeightFieldGetHeight2Event = procedure(Sender: TObject; const x, y: Single;
   TGLHeightFieldGetHeight2Event = procedure(Sender: TObject; const x, y: Single;
-    var z: Single; var Color: TColorVector; var TexPoint: TTexPoint) of object;
+    var z: Single; var Color: TGLColorVector; var TexPoint: TTexPoint) of object;
 
 
   TGLHeightFieldOption = (hfoTextureCoordinates, hfoTwoSided);
   TGLHeightFieldOption = (hfoTextureCoordinates, hfoTwoSided);
   TGLHeightFieldOptions = set of TGLHeightFieldOption;
   TGLHeightFieldOptions = set of TGLHeightFieldOption;
@@ -95,9 +95,9 @@ type
     procedure SetOnGetHeight2(const val: TGLHeightFieldGetHeight2Event);
     procedure SetOnGetHeight2(const val: TGLHeightFieldGetHeight2Event);
     procedure SetColorMode(const val: TGLHeightFieldColorMode);
     procedure SetColorMode(const val: TGLHeightFieldColorMode);
     procedure DefaultHeightField(const x, y: Single; var z: Single;
     procedure DefaultHeightField(const x, y: Single; var z: Single;
-      var Color: TColorVector; var TexPoint: TTexPoint);
+      var Color: TGLColorVector; var TexPoint: TTexPoint);
     procedure Height2Field(const x, y: Single; var z: Single;
     procedure Height2Field(const x, y: Single; var z: Single;
-      var Color: TColorVector; var texPoint: TTexPoint);
+      var Color: TGLColorVector; var texPoint: TTexPoint);
   public
   public
     constructor Create(AOwner: TComponent); override;
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
     destructor Destroy; override;
@@ -331,7 +331,7 @@ end;
 procedure TGLHeightField.BuildList(var rci: TGLRenderContextInfo);
 procedure TGLHeightField.BuildList(var rci: TGLRenderContextInfo);
 type
 type
   TRowData = packed record
   TRowData = packed record
-    Color: TColorVector;
+    Color: TGLColorVector;
     Z: Single;
     Z: Single;
     TexPoint: TTexPoint;
     TexPoint: TTexPoint;
     Normal: TAffineVector;
     Normal: TAffineVector;
@@ -553,7 +553,7 @@ end;
 
 
 
 
 procedure TGLHeightField.DefaultHeightField(const x, y: Single; var z: Single;
 procedure TGLHeightField.DefaultHeightField(const x, y: Single; var z: Single;
-  var color: TColorVector; var texPoint: TTexPoint);
+  var color: TGLColorVector; var texPoint: TTexPoint);
 begin
 begin
   z := VectorNorm(x, y);
   z := VectorNorm(x, y);
   z := cos(z * 12) / (2 * (z * 6.28 + 1));
   z := cos(z * 12) / (2 * (z * 6.28 + 1));
@@ -562,7 +562,7 @@ end;
 
 
 
 
 procedure TGLHeightField.Height2Field(const x, y: Single; var z: Single;
 procedure TGLHeightField.Height2Field(const x, y: Single; var z: Single;
-  var color: TColorVector; var texPoint: TTexPoint);
+  var color: TGLColorVector; var texPoint: TTexPoint);
 begin
 begin
   FOnGetHeight2(Self, x, y, z, color, texPoint);
   FOnGetHeight2(Self, x, y, z, color, texPoint);
 end;
 end;

+ 2 - 2
Source/GLS.LensFlare.pas

@@ -50,7 +50,7 @@ type
   public
   public
     constructor Create(AOwner: TPersistent); override;
     constructor Create(AOwner: TPersistent); override;
     constructor CreateInitialized(AOwner: TPersistent;
     constructor CreateInitialized(AOwner: TPersistent;
-      const fromColor, toColor: TColorVector);
+      const fromColor, toColor: TGLColorVector);
     destructor Destroy; override;
     destructor Destroy; override;
     procedure Assign(Source: TPersistent); override;
     procedure Assign(Source: TPersistent); override;
   published
   published
@@ -206,7 +206,7 @@ begin
 end;
 end;
 
 
 constructor TGLFlareGradient.CreateInitialized(AOwner: TPersistent;
 constructor TGLFlareGradient.CreateInitialized(AOwner: TPersistent;
-  const fromColor, toColor: TColorVector);
+  const fromColor, toColor: TGLColorVector);
 begin
 begin
   Create(AOwner);
   Create(AOwner);
   FFromColor.Initialize(fromColor);
   FFromColor.Initialize(fromColor);

+ 1 - 1
Source/GLS.LinePFX.pas

@@ -135,7 +135,7 @@ procedure TGLLinePFXManager.RenderParticle(var rci: TGLRenderContextInfo;
   aParticle: TGLParticle);
   aParticle: TGLParticle);
 var
 var
   lifeTime, sizeScale, fx, fy, f: Single;
   lifeTime, sizeScale, fx, fy, f: Single;
-  inner, outer: TColorVector;
+  inner, outer: TGLColorVector;
   pos, dir, start, stop, dv: TAffineVector;
   pos, dir, start, stop, dv: TAffineVector;
 begin
 begin
   lifeTime := CurrentTime - aParticle.CreationTime;
   lifeTime := CurrentTime - aParticle.CreationTime;

+ 2 - 2
Source/GLS.MaterialEx.pas

@@ -2590,7 +2590,7 @@ begin
       FWrap[0] := TGLSeparateTextureWrap(ReadInteger);
       FWrap[0] := TGLSeparateTextureWrap(ReadInteger);
       FWrap[1] := TGLSeparateTextureWrap(ReadInteger);
       FWrap[1] := TGLSeparateTextureWrap(ReadInteger);
       FWrap[2] := TGLSeparateTextureWrap(ReadInteger);
       FWrap[2] := TGLSeparateTextureWrap(ReadInteger);
-      Read(FBorderColor.AsAddress^, SizeOf(TColorVector));
+      Read(FBorderColor.AsAddress^, SizeOf(TGLColorVector));
       FCompareMode := TGLTextureCompareMode(ReadInteger);
       FCompareMode := TGLTextureCompareMode(ReadInteger);
       FCompareFunc := TGLDepthFunction(ReadInteger);
       FCompareFunc := TGLDepthFunction(ReadInteger);
       FDecodeSRGB := ReadBoolean;
       FDecodeSRGB := ReadBoolean;
@@ -2701,7 +2701,7 @@ begin
     WriteInteger(Integer(FWrap[0]));
     WriteInteger(Integer(FWrap[0]));
     WriteInteger(Integer(FWrap[1]));
     WriteInteger(Integer(FWrap[1]));
     WriteInteger(Integer(FWrap[2]));
     WriteInteger(Integer(FWrap[2]));
-    Write(FBorderColor.AsAddress^, SizeOf(TColorVector));
+    Write(FBorderColor.AsAddress^, SizeOf(TGLColorVector));
     WriteInteger(Integer(FCompareMode));
     WriteInteger(Integer(FCompareMode));
     WriteInteger(Integer(FCompareFunc));
     WriteInteger(Integer(FCompareFunc));
     WriteBoolean(FDecodeSRGB);
     WriteBoolean(FDecodeSRGB);

+ 4 - 4
Source/GLS.Mesh.pas

@@ -98,10 +98,10 @@ type
       Use the NullVector, NullHmgVector or NullTexPoint constants for
       Use the NullVector, NullHmgVector or NullTexPoint constants for
       params you don't want to set. *)
       params you don't want to set. *)
     procedure AddVertex(const aVertex: TVertex; const aNormal: TAffineVector;
     procedure AddVertex(const aVertex: TVertex; const aNormal: TAffineVector;
-      const aColor: TColorVector; const aTexPoint: TTexPoint); overload;
+      const aColor: TGLColorVector; const aTexPoint: TTexPoint); overload;
     //  Adds a vertex to the list, no texturing version.  
     //  Adds a vertex to the list, no texturing version.  
     procedure AddVertex(const vertex: TVertex; const normal: TAffineVector;
     procedure AddVertex(const vertex: TVertex; const normal: TAffineVector;
-      const color: TColorVector); overload;
+      const color: TGLColorVector); overload;
     //  Adds a vertex to the list, no texturing, not color version.  
     //  Adds a vertex to the list, no texturing, not color version.  
     procedure AddVertex(const vertex: TVertex; const normal: TAffineVector); overload;
     procedure AddVertex(const vertex: TVertex; const normal: TAffineVector); overload;
     //  Duplicates the vertex of given index and adds it at the end of the list. 
     //  Duplicates the vertex of given index and adds it at the end of the list. 
@@ -415,7 +415,7 @@ begin
 end;
 end;
 
 
 procedure TGLVertexList.AddVertex(const aVertex: TVertex;
 procedure TGLVertexList.AddVertex(const aVertex: TVertex;
-  const aNormal: TAffineVector; const aColor: TColorVector;
+  const aNormal: TAffineVector; const aColor: TGLColorVector;
   const aTexPoint: TTexPoint);
   const aTexPoint: TTexPoint);
 begin
 begin
   if FCount = FCapacity then
   if FCount = FCapacity then
@@ -433,7 +433,7 @@ begin
 end;
 end;
 
 
 procedure TGLVertexList.AddVertex(const vertex: TVertex;
 procedure TGLVertexList.AddVertex(const vertex: TVertex;
-  const normal: TAffineVector; const color: TColorVector);
+  const normal: TAffineVector; const color: TGLColorVector);
 begin
 begin
   AddVertex(vertex, normal, color, NullTexPoint);
   AddVertex(vertex, normal, color, NullTexPoint);
 end;
 end;

+ 1 - 1
Source/GLS.MeshBSP.pas

@@ -762,7 +762,7 @@ end;
 function TFGBSPNode.AddLerpIfDistinct(iA, iB, iMid: Integer): Integer;
 function TFGBSPNode.AddLerpIfDistinct(iA, iB, iMid: Integer): Integer;
 var
 var
   midNormal: TAffineVector;
   midNormal: TAffineVector;
-  midColor: TColorVector;
+  midColor: TGLColorVector;
   midTexCoord: TAffineVector;
   midTexCoord: TAffineVector;
   midLightmapTexCoord: TAffineVector;
   midLightmapTexCoord: TAffineVector;
   f: Single;
   f: Single;

+ 1 - 1
Source/GLS.Mirror.pas

@@ -141,7 +141,7 @@ var
   oldProxySubObject: Boolean;
   oldProxySubObject: Boolean;
   refMat, curMat, ModelMat: TGLMatrix;
   refMat, curMat, ModelMat: TGLMatrix;
   clipPlane: TDoubleHmgPlane;
   clipPlane: TDoubleHmgPlane;
-  bgColor: TColorVector;
+  bgColor: TGLColorVector;
   cameraPosBackup, cameraDirectionBackup: TGLVector;
   cameraPosBackup, cameraDirectionBackup: TGLVector;
   CurrentBuffer: TGLSceneBuffer;
   CurrentBuffer: TGLSceneBuffer;
 begin
 begin

+ 10 - 7
Source/GLS.Objects.pas

@@ -396,7 +396,7 @@ type
     FNodesAspect: TGLLineNodesAspect;
     FNodesAspect: TGLLineNodesAspect;
     FNodeColor: TGLColor;
     FNodeColor: TGLColor;
     FNodeSize: Single;
     FNodeSize: Single;
-    FOldNodeColor: TColorVector;
+    FOldNodeColor: TGLColorVector;
   protected
   protected
     procedure SetNodesAspect(const Value: TGLLineNodesAspect);
     procedure SetNodesAspect(const Value: TGLLineNodesAspect);
     procedure SetNodeColor(const Value: TGLColor);
     procedure SetNodeColor(const Value: TGLColor);
@@ -483,7 +483,8 @@ type
   (* A simple cube object.
   (* A simple cube object.
     This cube use the same material for each of its faces, ie. all faces look
     This cube use the same material for each of its faces, ie. all faces look
     the same. If you want a multi-material cube, use a mesh in conjunction
     the same. If you want a multi-material cube, use a mesh in conjunction
-    with a TGLFreeForm and a material library. *)
+    with a TGLFreeForm and a material library.
+    Ref: https://mathworld.wolfram.com/Cube.html *)
   TGLCube = class(TGLSceneObject)
   TGLCube = class(TGLSceneObject)
   private
   private
     FCubeSize: TAffineVector;
     FCubeSize: TAffineVector;
@@ -554,8 +555,9 @@ type
   TGLCapType = (ctNone, ctCenter, ctFlat);
   TGLCapType = (ctNone, ctCenter, ctFlat);
 
 
   (* A sphere object.
   (* A sphere object.
-    The sphere can have to and bottom caps, as well as being just a slice
-    of sphere. *)
+    The sphere can have to and bottom caps, as well as being just a slice of sphere.
+    Ref: https://mathworld.wolfram.com/Sphere.html
+    Ref: https://mathworld.wolfram.com/GeodesicDome.html *)
   TGLSphere = class(TGLQuadricObject)
   TGLSphere = class(TGLQuadricObject)
   private
   private
     FRadius: TGLFloat;
     FRadius: TGLFloat;
@@ -630,7 +632,8 @@ type
   end;
   end;
 
 
   (* A Superellipsoid object. The Superellipsoid can have top and bottom caps,
   (* A Superellipsoid object. The Superellipsoid can have top and bottom caps,
-    as well as being just a slice of Superellipsoid. *)
+    as well as being just a slice of Superellipsoid.
+    Ref: https://mathworld.wolfram.com/Superellipse.html  *)
   TGLSuperellipsoid = class(TGLQuadricObject)
   TGLSuperellipsoid = class(TGLQuadricObject)
   private
   private
     FRadius, FVCurve, FHCurve: TGLFloat;
     FRadius, FVCurve, FHCurve: TGLFloat;
@@ -678,7 +681,7 @@ type
 
 
 // Issues for a unit-size cube stippled wireframe
 // Issues for a unit-size cube stippled wireframe
 procedure CubeWireframeBuildList(var rci: TGLRenderContextInfo; Size: TGLFloat;
 procedure CubeWireframeBuildList(var rci: TGLRenderContextInfo; Size: TGLFloat;
-  Stipple: Boolean; const Color: TColorVector);
+  Stipple: Boolean; const Color: TGLColorVector);
 
 
 const
 const
   TangentAttributeName: PAnsiChar = 'Tangent';
   TangentAttributeName: PAnsiChar = 'Tangent';
@@ -689,7 +692,7 @@ implementation
 // -------------------------------------------------------------
 // -------------------------------------------------------------
 
 
 procedure CubeWireframeBuildList(var rci: TGLRenderContextInfo; Size: TGLFloat;
 procedure CubeWireframeBuildList(var rci: TGLRenderContextInfo; Size: TGLFloat;
-  Stipple: Boolean; const Color: TColorVector);
+  Stipple: Boolean; const Color: TGLColorVector);
 var
 var
   mi, ma: Single;
   mi, ma: Single;
 begin
 begin

+ 8 - 8
Source/GLS.ParticleFX.pas

@@ -497,9 +497,9 @@ type
     procedure InitializeRendering(var rci: TGLRenderContextInfo); override;
     procedure InitializeRendering(var rci: TGLRenderContextInfo); override;
     procedure FinalizeRendering(var rci: TGLRenderContextInfo); override;
     procedure FinalizeRendering(var rci: TGLRenderContextInfo); override;
     function MaxParticleAge: Single; override;
     function MaxParticleAge: Single; override;
-    procedure ComputeColors(var lifeTime: Single; var inner, outer: TColorVector);
-    procedure ComputeInnerColor(var lifeTime: Single; var inner: TColorVector);
-    procedure ComputeOuterColor(var lifeTime: Single; var outer: TColorVector);
+    procedure ComputeColors(var lifeTime: Single; var inner, outer: TGLColorVector);
+    procedure ComputeInnerColor(var lifeTime: Single; var inner: TGLColorVector);
+    procedure ComputeOuterColor(var lifeTime: Single; var outer: TGLColorVector);
     function ComputeSizeScale(var lifeTime: Single; var sizeScale: Single): Boolean;
     function ComputeSizeScale(var lifeTime: Single; var sizeScale: Single): Boolean;
     function ComputeRotateAngle(var lifeTime, rotateAngle: Single): Boolean;
     function ComputeRotateAngle(var lifeTime, rotateAngle: Single): Boolean;
     procedure RotateVertexBuf(buf: TAffineVectorList; lifeTime: Single;
     procedure RotateVertexBuf(buf: TAffineVectorList; lifeTime: Single;
@@ -2054,7 +2054,7 @@ begin
   Result := LifeColors.MaxLifeTime;
   Result := LifeColors.MaxLifeTime;
 end;
 end;
 
 
-procedure TGLLifeColoredPFXManager.ComputeColors(var lifeTime: Single; var inner, outer: TColorVector);
+procedure TGLLifeColoredPFXManager.ComputeColors(var lifeTime: Single; var inner, outer: TGLColorVector);
 var
 var
   i, k, n: Integer;
   i, k, n: Integer;
   f: Single;
   f: Single;
@@ -2100,7 +2100,7 @@ begin
   end;
   end;
 end;
 end;
 
 
-procedure TGLLifeColoredPFXManager.ComputeInnerColor(var lifeTime: Single; var inner: TColorVector);
+procedure TGLLifeColoredPFXManager.ComputeInnerColor(var lifeTime: Single; var inner: TGLColorVector);
 var
 var
   i, k, n: Integer;
   i, k, n: Integer;
   f: Single;
   f: Single;
@@ -2143,7 +2143,7 @@ begin
   end;
   end;
 end;
 end;
 
 
-procedure TGLLifeColoredPFXManager.ComputeOuterColor(var lifeTime: Single; var outer: TColorVector);
+procedure TGLLifeColoredPFXManager.ComputeOuterColor(var lifeTime: Single; var outer: TGLColorVector);
 var
 var
   i, k, n: Integer;
   i, k, n: Integer;
   f: Single;
   f: Single;
@@ -2451,7 +2451,7 @@ procedure TGLPolygonPFXManager.RenderParticle(var rci: TGLRenderContextInfo; aPa
 var
 var
   i: Integer;
   i: Integer;
   lifeTime, sizeScale: Single;
   lifeTime, sizeScale: Single;
-  inner, outer: TColorVector;
+  inner, outer: TGLColorVector;
   pos: TAffineVector;
   pos: TAffineVector;
   vertexList: PAffineVectorArray;
   vertexList: PAffineVectorArray;
 begin
 begin
@@ -2686,7 +2686,7 @@ const
     ((S: 0.5; T: 0.5), (S: 0.0; T: 0.5), (S: 0.0; T: 0.0), (S: 0.5; T: 0.0)));
     ((S: 0.5; T: 0.5), (S: 0.0; T: 0.5), (S: 0.0; T: 0.0), (S: 0.5; T: 0.0)));
 var
 var
   lifeTime, sizeScale: Single;
   lifeTime, sizeScale: Single;
-  inner, outer: TColorVector;
+  inner, outer: TGLColorVector;
   pos: TAffineVector;
   pos: TAffineVector;
   vertexList: PAffineVectorArray;
   vertexList: PAffineVectorArray;
   i: Integer;
   i: Integer;

+ 29 - 29
Source/GLS.RandomHDS.pas

@@ -108,7 +108,7 @@ type
   TGLBaseRandomHDS = class;
   TGLBaseRandomHDS = class;
 
 
   // Function type to use for topography-based texture
   // Function type to use for topography-based texture
-  TOnDrawTexture = function(const Sender: TGLBaseRandomHDS; x, y: integer; z: double; Normal: TGLVector): TColorVector of object;
+  TOnDrawTexture = function(const Sender: TGLBaseRandomHDS; x, y: integer; z: double; Normal: TGLVector): TGLColorVector of object;
 
 
   TSingleClamp = procedure(var x, y: single) of object;
   TSingleClamp = procedure(var x, y: single) of object;
   TIntegerClamp = procedure(var x, y: integer) of object;
   TIntegerClamp = procedure(var x, y: integer) of object;
@@ -131,7 +131,7 @@ type
     FLighting: boolean;
     FLighting: boolean;
     FLightDirection: TGLVector;
     FLightDirection: TGLVector;
     FTerrainRenderer: TGLTerrainRenderer;
     FTerrainRenderer: TGLTerrainRenderer;
-    FLightColor: TColorVector;
+    FLightColor: TGLColorVector;
     FShadows: boolean;
     FShadows: boolean;
     FSea: boolean;
     FSea: boolean;
     FSeaLevel: single;
     FSeaLevel: single;
@@ -145,13 +145,13 @@ type
     FPrimerLandscape: boolean;
     FPrimerLandscape: boolean;
     FLandTileInfo: TLandTileInfo;
     FLandTileInfo: TLandTileInfo;
     FOnDrawTexture: TOnDrawTexture;
     FOnDrawTexture: TOnDrawTexture;
-    function OnDrawTextureDefault(const Sender: TGLBaseRandomHDS; x, y: integer; z: double; Normal: TGLVector): TColorVector;
+    function OnDrawTextureDefault(const Sender: TGLBaseRandomHDS; x, y: integer; z: double; Normal: TGLVector): TGLColorVector;
     procedure SetSeed(const Value: integer);
     procedure SetSeed(const Value: integer);
     procedure SetMaterialName(const Value: string);
     procedure SetMaterialName(const Value: string);
     procedure SetLighting(const Value: boolean);
     procedure SetLighting(const Value: boolean);
     procedure SetLightDirection(const Value: TGLVector);
     procedure SetLightDirection(const Value: TGLVector);
     procedure SetTerrainRenderer(const Value: TGLTerrainRenderer); virtual; abstract;
     procedure SetTerrainRenderer(const Value: TGLTerrainRenderer); virtual; abstract;
-    procedure SetLightColor(const Value: TColorVector);
+    procedure SetLightColor(const Value: TGLColorVector);
     procedure SetShadows(const Value: boolean);
     procedure SetShadows(const Value: boolean);
     procedure SetSea(const Value: boolean);
     procedure SetSea(const Value: boolean);
     procedure SetSeaLevel(const Value: single);
     procedure SetSeaLevel(const Value: single);
@@ -177,7 +177,7 @@ type
     constructor Create(AOwner: TComponent); override;
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
     destructor Destroy; override;
     // Usually white, but you can generate e.g.sunset ambiance by setting it to red
     // Usually white, but you can generate e.g.sunset ambiance by setting it to red
-    property LightColor: TColorVector read FLightColor write SetLightColor;
+    property LightColor: TGLColorVector read FLightColor write SetLightColor;
     // Light is parallel (sun light)
     // Light is parallel (sun light)
     property LightDirection: TGLVector read FLightDirection write SetLightDirection;
     property LightDirection: TGLVector read FLightDirection write SetLightDirection;
     (* This function must be supplied by the user. Here he/she can define which
     (* This function must be supplied by the user. Here he/she can define which
@@ -274,7 +274,7 @@ type
     procedure BuildNormals;
     procedure BuildNormals;
     (* For every pixel of the texture, computes slope and interpolated height and
     (* For every pixel of the texture, computes slope and interpolated height and
       sends these information to a user-supplied function (OnDrawTexture), whose
       sends these information to a user-supplied function (OnDrawTexture), whose
-      result is a tColorVector. If no OnDrawTexture is supplied, a basic default
+      result is a TGLColorVector. If no OnDrawTexture is supplied, a basic default
       texture will be used. *)
       texture will be used. *)
     procedure BuildTexture;
     procedure BuildTexture;
     // Fill the heightfield with "Empty" values (-999)
     // Fill the heightfield with "Empty" values (-999)
@@ -571,14 +571,14 @@ type
 
 
 (* Texture functions *)
 (* Texture functions *)
 function LoadJPGtexture(const JpgName: string): tBitmap;
 function LoadJPGtexture(const JpgName: string): tBitmap;
-function NoisyColor(const Color: tColor; const Noise: single = 0.05): TColorVector;
-function TextureGreen(const x, y: integer): TColorVector;
-function TextureBlue(const x, y: integer): TColorVector;
-function TextureSand(const x, y: integer): TColorVector;
-function TextureBrownSoil(const x, y: integer): TColorVector;
-function TextureDarkGreen(const x, y: integer): TColorVector;
-function TextureDarkGray(const x, y: integer): TColorVector;
-function TextureWhite(const x, y: integer): TColorVector;
+function NoisyColor(const Color: tColor; const Noise: single = 0.05): TGLColorVector;
+function TextureGreen(const x, y: integer): TGLColorVector;
+function TextureBlue(const x, y: integer): TGLColorVector;
+function TextureSand(const x, y: integer): TGLColorVector;
+function TextureBrownSoil(const x, y: integer): TGLColorVector;
+function TextureDarkGreen(const x, y: integer): TGLColorVector;
+function TextureDarkGray(const x, y: integer): TGLColorVector;
+function TextureWhite(const x, y: integer): TGLColorVector;
 
 
 (* Random HDS functions *)
 (* Random HDS functions *)
 procedure FractalMiddlePointHDS(const aDepth, aSeed, aAmplitude: integer; const aRoughness: single; aCyclic: boolean;
 procedure FractalMiddlePointHDS(const aDepth, aSeed, aAmplitude: integer; const aRoughness: single; aCyclic: boolean;
@@ -620,7 +620,7 @@ begin
   Jpg.Free;
   Jpg.Free;
 end;
 end;
 
 
-function NoisyColor(const Color: tColor; const Noise: single = 0.05): TColorVector;
+function NoisyColor(const Color: tColor; const Noise: single = 0.05): TGLColorVector;
 var
 var
   r: single;
   r: single;
 begin
 begin
@@ -629,37 +629,37 @@ begin
   AddVector(Result, r);
   AddVector(Result, r);
 end;
 end;
 
 
-function TextureSand(const x, y: integer): TColorVector;
+function TextureSand(const x, y: integer): TGLColorVector;
 begin
 begin
   Result := NoisyColor($0071D8FF);
   Result := NoisyColor($0071D8FF);
 end;
 end;
 
 
-function TextureBrownSoil(const x, y: integer): TColorVector;
+function TextureBrownSoil(const x, y: integer): TGLColorVector;
 begin
 begin
   Result := NoisyColor($00008BBF);
   Result := NoisyColor($00008BBF);
 end;
 end;
 
 
-function TextureDarkGreen(const x, y: integer): TColorVector;
+function TextureDarkGreen(const x, y: integer): TGLColorVector;
 begin
 begin
   Result := NoisyColor($00004000);
   Result := NoisyColor($00004000);
 end;
 end;
 
 
-function TextureDarkGray(const x, y: integer): TColorVector;
+function TextureDarkGray(const x, y: integer): TGLColorVector;
 begin
 begin
   Result := NoisyColor(clDkGray);
   Result := NoisyColor(clDkGray);
 end;
 end;
 
 
-function TextureWhite(const x, y: integer): TColorVector;
+function TextureWhite(const x, y: integer): TGLColorVector;
 begin
 begin
   Result := NoisyColor(clWhite);
   Result := NoisyColor(clWhite);
 end;
 end;
 
 
-function TextureBlue(const x, y: integer): TColorVector;
+function TextureBlue(const x, y: integer): TGLColorVector;
 begin
 begin
   Result := NoisyColor(clBlue);
   Result := NoisyColor(clBlue);
 end;
 end;
 
 
-function TextureGreen(const x, y: integer): TColorVector;
+function TextureGreen(const x, y: integer): TGLColorVector;
 begin
 begin
   Result := NoisyColor(clGreen);
   Result := NoisyColor(clGreen);
 end;
 end;
@@ -727,7 +727,7 @@ begin
 end;
 end;
 
 
 function TGLBaseRandomHDS.OnDrawTextureDefault(const Sender: TGLBaseRandomHDS; x, y: integer; z: double; Normal: TGLVector)
 function TGLBaseRandomHDS.OnDrawTextureDefault(const Sender: TGLBaseRandomHDS; x, y: integer; z: double; Normal: TGLVector)
-  : TColorVector;
+  : TGLColorVector;
 begin
 begin
   if z > Sender.SeaLevel * VSF then
   if z > Sender.SeaLevel * VSF then
     Result := TextureGreen(x, y)
     Result := TextureGreen(x, y)
@@ -770,7 +770,7 @@ begin
   FLandTileInfo := Value;
   FLandTileInfo := Value;
 end;
 end;
 
 
-procedure TGLBaseRandomHDS.SetLightColor(const Value: TColorVector);
+procedure TGLBaseRandomHDS.SetLightColor(const Value: TGLColorVector);
 begin
 begin
   FLightColor := Value;
   FLightColor := Value;
 end;
 end;
@@ -1116,7 +1116,7 @@ var
     Result := RGB((r1 + r2) div 2, (g1 + g2) div 2, (b1 + b2) div 2);
     Result := RGB((r1 + r2) div 2, (g1 + g2) div 2, (b1 + b2) div 2);
   end;
   end;
 
 
-  procedure MakeRGBTriple(const Color: TColorVector; var RGBTriple: TRGBTriple);
+  procedure MakeRGBTriple(const Color: TGLColorVector; var RGBTriple: TRGBTriple);
   begin
   begin
     with RGBTriple do
     with RGBTriple do
     begin
     begin
@@ -1129,8 +1129,8 @@ var
   function ComputePixel(const x, y: integer): TRGBTriple;
   function ComputePixel(const x, y: integer): TRGBTriple;
   var
   var
     i, j: integer;
     i, j: integer;
-    Shade: TColorVector;
-    Cover: TColorVector;
+    Shade: TGLColorVector;
+    Cover: TGLColorVector;
     z: double;
     z: double;
   begin
   begin
     i := (x0 + x) div TextureScale;
     i := (x0 + x) div TextureScale;
@@ -1244,8 +1244,8 @@ end; // *)
   Mat	:TGLLibMaterial;
   Mat	:TGLLibMaterial;
   x,y	:integer;
   x,y	:integer;
   i,j	:integer;
   i,j	:integer;
-  Shade	:tColorVector;
-  Cover	:tColorVector;
+  Shade	:TGLColorVector;
+  Cover	:TGLColorVector;
   z		:double;
   z		:double;
   begin
   begin
   if not fTextureCreated then CreateTexture;
   if not fTextureCreated then CreateTexture;

+ 1 - 1
Source/GLS.RenderContextInfo.pas

@@ -78,7 +78,7 @@ type
     GLStates: TGLStateCache;
     GLStates: TGLStateCache;
     PipelineTransformation: TGLTransformation;
     PipelineTransformation: TGLTransformation;
     Rcci: TRenderContextClippingInfo;
     Rcci: TRenderContextClippingInfo;
-    SceneAmbientColor: TColorVector;
+    SceneAmbientColor: TGLColorVector;
     BufferFaceCull: Boolean;
     BufferFaceCull: Boolean;
     BufferLighting: Boolean;
     BufferLighting: Boolean;
     BufferFog: Boolean;
     BufferFog: Boolean;

+ 3 - 3
Source/GLS.SceneRegister.pas

@@ -85,7 +85,7 @@ type
   TGLColorProperty = class(TClassProperty, ICustomPropertyDrawing,
   TGLColorProperty = class(TClassProperty, ICustomPropertyDrawing,
     ICustomPropertyListDrawing)
     ICustomPropertyListDrawing)
   protected
   protected
-    function ColorToBorderColor(aColor: TColorVector; selected: Boolean): TColor;
+    function ColorToBorderColor(aColor: TGLColorVector; selected: Boolean): TColor;
   public
   public
     function GetAttributes: TPropertyAttributes; override;
     function GetAttributes: TPropertyAttributes; override;
     procedure GetValues(Proc: TGetStrProc); override;
     procedure GetValues(Proc: TGetStrProc); override;
@@ -688,7 +688,7 @@ begin
   Modified;
   Modified;
 end;
 end;
 
 
-function TGLColorProperty.ColorToBorderColor(aColor: TColorVector; selected: Boolean): TColor;
+function TGLColorProperty.ColorToBorderColor(aColor: TGLColorVector; selected: Boolean): TColor;
 begin
 begin
   if (aColor.X > 0.75) or (aColor.Y > 0.75) or (aColor.Z > 0.75) then
   if (aColor.X > 0.75) or (aColor.Y > 0.75) or (aColor.Z > 0.75) then
     Result := clBlack
     Result := clBlack
@@ -712,7 +712,7 @@ procedure TGLColorProperty.ListDrawValue(const Value: string; ACanvas: TCanvas;
 var
 var
   vRight: Integer;
   vRight: Integer;
   vOldPenColor, vOldBrushColor: TColor;
   vOldPenColor, vOldBrushColor: TColor;
-  Color: TColorVector;
+  Color: TGLColorVector;
 begin
 begin
   vRight := (ARect.Bottom - ARect.Top) + ARect.Left;
   vRight := (ARect.Bottom - ARect.Top) + ARect.Left;
   with ACanvas do
   with ACanvas do

+ 1 - 1
Source/GLS.ShadowPlane.pas

@@ -112,7 +112,7 @@ implementation
 
 
 constructor TGLShadowPlane.Create(AOwner: Tcomponent);
 constructor TGLShadowPlane.Create(AOwner: Tcomponent);
 const
 const
-  cDefaultShadowColor: TColorVector = (X:0; Y:0; Z:0; W:0.5);
+  cDefaultShadowColor: TGLColorVector = (X:0; Y:0; Z:0; W:0.5);
 begin
 begin
   inherited Create(AOwner);
   inherited Create(AOwner);
   FShadowOptions := cDefaultShadowPlaneOptions;
   FShadowOptions := cDefaultShadowPlaneOptions;

+ 12 - 9
Source/GLS.SkyDome.pas

@@ -190,7 +190,8 @@ type
     (* Adds nb random stars of the given color.
     (* Adds nb random stars of the given color.
       Stars are homogenously scattered on the complete sphere, not only the band defined or visible dome. *)
       Stars are homogenously scattered on the complete sphere, not only the band defined or visible dome. *)
     procedure AddRandomStars(const nb: Integer; const color: TColor; const limitToTopDome: Boolean = False); overload;
     procedure AddRandomStars(const nb: Integer; const color: TColor; const limitToTopDome: Boolean = False); overload;
-    procedure AddRandomStars(const nb: Integer; const ColorMin, ColorMax:TVector3b; const Magnitude_min, Magnitude_max: Single;const limitToTopDome: Boolean = False); overload;
+    procedure AddRandomStars(const nb: Integer; const ColorMin, ColorMax:TVector3b;
+      const Magnitude_min, Magnitude_max: Single;const limitToTopDome: Boolean = False); overload;
     (* Load a 'stars' file, which is made of TGLStarRecord.
     (* Load a 'stars' file, which is made of TGLStarRecord.
        Not that '.stars' files should already be sorted by magnitude and color. *)
        Not that '.stars' files should already be sorted by magnitude and color. *)
     procedure LoadStarsFile(const starsFileName: string);
     procedure LoadStarsFile(const starsFileName: string);
@@ -243,7 +244,7 @@ type
   private
   private
     FSunElevation: Single;
     FSunElevation: Single;
     FTurbidity: Single;
     FTurbidity: Single;
-    FCurSunColor, FCurSkyColor, FCurHazeColor: TColorVector;
+    FCurSunColor, FCurSkyColor, FCurHazeColor: TGLColorVector;
     FCurHazeTurbid, FCurSunSkyTurbid: Single;
     FCurHazeTurbid, FCurSunSkyTurbid: Single;
     FSunZenithColor: TGLColor;
     FSunZenithColor: TGLColor;
     FSunDawnColor: TGLColor;
     FSunDawnColor: TGLColor;
@@ -269,7 +270,7 @@ type
     procedure OnColorChanged(Sender: TObject);
     procedure OnColorChanged(Sender: TObject);
     procedure PreCalculate;
     procedure PreCalculate;
     procedure RenderDome;
     procedure RenderDome;
-    function CalculateColor(const theta, cosGamma: Single): TColorVector;
+    function CalculateColor(const theta, cosGamma: Single): TGLColorVector;
   public
   public
     constructor Create(AOwner: TComponent); override;
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
     destructor Destroy; override;
@@ -791,7 +792,7 @@ procedure TGLSkyDomeBand.BuildList(var rci: TGLRenderContextInfo);
 
 
 // always rendered as sphere of radius 1
 // always rendered as sphere of radius 1
   procedure RenderBand(start, stop: Single;
   procedure RenderBand(start, stop: Single;
-    const colStart, colStop: TColorVector);
+    const colStart, colStop: TGLColorVector);
   var
   var
     i: Integer;
     i: Integer;
     f, r, r2: Single;
     f, r, r2: Single;
@@ -1008,7 +1009,7 @@ var
   star: TGLSkyDomeStar;
   star: TGLSkyDomeStar;
   lastColor: TColor;
   lastColor: TColor;
   lastPointSize10, pointSize10: Integer;
   lastPointSize10, pointSize10: Integer;
-  Color, twinkleColor: TColorVector;
+  Color, twinkleColor: TGLColorVector;
 
 
   procedure DoTwinkle;
   procedure DoTwinkle;
   begin
   begin
@@ -1080,6 +1081,7 @@ begin
   rci.GLStates.SetGLAlphaFunction(cfGreater, 0);
   rci.GLStates.SetGLAlphaFunction(cfGreater, 0);
 end;
 end;
 
 
+//------------------------------------------------------------
 procedure TGLSkyDomeStars.AddRandomStars(const nb: Integer; const Color: TColor;
 procedure TGLSkyDomeStars.AddRandomStars(const nb: Integer; const Color: TColor;
   const limitToTopDome: Boolean = False);
   const limitToTopDome: Boolean = False);
 var
 var
@@ -1105,6 +1107,7 @@ begin
   end;
   end;
 end;
 end;
 
 
+//------------------------------------------------------------
 procedure TGLSkyDomeStars.AddRandomStars(const nb: Integer;
 procedure TGLSkyDomeStars.AddRandomStars(const nb: Integer;
   const ColorMin, ColorMax: TVector3b;
   const ColorMin, ColorMax: TVector3b;
   const Magnitude_min, Magnitude_max: Single;
   const Magnitude_min, Magnitude_max: Single;
@@ -1144,7 +1147,7 @@ procedure TGLSkyDomeStars.LoadStarsFile(const starsFileName: string);
 var
 var
   fs: TFileStream;
   fs: TFileStream;
   sr: TGLStarRecord;
   sr: TGLStarRecord;
-  colorVector: TColorVector;
+  colorVector: TGLColorVector;
 begin
 begin
   fs := TFileStream.Create(starsFileName, fmOpenRead + fmShareDenyWrite);
   fs := TFileStream.Create(starsFileName, fmOpenRead + fmShareDenyWrite);
   try
   try
@@ -1559,7 +1562,7 @@ begin
 end;
 end;
 
 
 function TGLEarthSkyDome.CalculateColor(const theta, cosGamma: Single)
 function TGLEarthSkyDome.CalculateColor(const theta, cosGamma: Single)
-  : TColorVector;
+  : TGLColorVector;
 var
 var
   t: Single;
   t: Single;
 begin
 begin
@@ -1592,7 +1595,7 @@ var
     i: Integer;
     i: Integer;
     r, thetaStart: Single;
     r, thetaStart: Single;
     vertex1: TGLVector;
     vertex1: TGLVector;
-    Color: TColorVector;
+    Color: TGLColorVector;
   begin
   begin
     r := 0;
     r := 0;
     vertex1.W := 1;
     vertex1.W := 1;
@@ -1619,7 +1622,7 @@ var
     i: Integer;
     i: Integer;
     r, r2, thetaStart, thetaStop: Single;
     r, r2, thetaStart, thetaStop: Single;
     vertex1, vertex2: TGLVector;
     vertex1, vertex2: TGLVector;
-    Color: TColorVector;
+    Color: TGLColorVector;
   begin
   begin
     vertex1.W := 1;
     vertex1.W := 1;
     if stop = 90 then
     if stop = 90 then

+ 1 - 1
Source/GLS.ThorFX.pas

@@ -472,7 +472,7 @@ var
 
 
   vx, vy: TGLVector;
   vx, vy: TGLVector;
   m: integer;
   m: integer;
-  Icol, Ocol, Ccol: TColorVector;
+  Icol, Ocol, Ccol: TGLColorVector;
   Ppos, Ppos2: TAffineVector;
   Ppos, Ppos2: TAffineVector;
 begin
 begin
   if Manager = nil then
   if Manager = nil then

+ 0 - 56
Source/GLS.VectorGeometry.pas

@@ -1368,14 +1368,6 @@ function PackRotationMatrix(const mat: TGLMatrix): TPackedRotationMatrix;
 // Restores a packed rotation matrix. See PackRotationMatrix
 // Restores a packed rotation matrix. See PackRotationMatrix
 function UnPackRotationMatrix(const packedMatrix: TPackedRotationMatrix): TGLMatrix;
 function UnPackRotationMatrix(const packedMatrix: TPackedRotationMatrix): TGLMatrix;
 
 
-(* Calculates the barycentric coordinates for the point p on the triangle
-  defined by the vertices v1, v2 and v3. That is, solves
-  p = u * v1 + v * v2 + (1-u-v) * v3
-  for u,v.
-  Returns true if the point is inside the triangle, false otherwise.
-  NOTE: This function assumes that the point lies on the plane defined by the triangle.
-  If this is not the case, the function will not work correctly! *)
-function BarycentricCoordinates(const V1, V2, V3, p: TAffineVector; var u, V: Single): Boolean;
 (*Calculates angles for the Camera.MoveAroundTarget(pitch, turn) procedure.
 (*Calculates angles for the Camera.MoveAroundTarget(pitch, turn) procedure.
   Initially from then GLCameraColtroller unit, requires AOriginalUpVector to contain only -1, 0 or 1.
   Initially from then GLCameraColtroller unit, requires AOriginalUpVector to contain only -1, 0 or 1.
   Result contains pitch and turn angles *)
   Result contains pitch and turn angles *)
@@ -6603,54 +6595,6 @@ begin
   result := QuaternionToMatrix(Q);
   result := QuaternionToMatrix(Q);
 end;
 end;
 
 
-function BarycentricCoordinates(const V1, V2, V3, p: TAffineVector;
-  var u, V: Single): Boolean;
-var
-  a1, a2: Integer;
-  n, e1, e2, pt: TAffineVector;
-begin
-  // calculate edges
-  VectorSubtract(V1, V3, e1);
-  VectorSubtract(V2, V3, e2);
-
-  // calculate p relative to v3
-  VectorSubtract(p, V3, pt);
-
-  // find the dominant axis
-  n := VectorCrossProduct(e1, e2);
-  AbsVector(n);
-  a1 := 0;
-  if n.Y > n.V[a1] then
-    a1 := 1;
-  if n.Z > n.V[a1] then
-    a1 := 2;
-
-  // use dominant axis for projection
-  case a1 of
-    0:
-      begin
-        a1 := 1;
-        a2 := 2;
-      end;
-    1:
-      begin
-        a1 := 0;
-        a2 := 2;
-      end;
-  else // 2:
-    a1 := 0;
-    a2 := 1;
-  end;
-
-  // solve for u and v
-  u := (pt.V[a2] * e2.V[a1] - pt.V[a1] * e2.V[a2]) /
-    (e1.V[a2] * e2.V[a1] - e1.V[a1] * e2.V[a2]);
-  V := (pt.V[a2] * e1.V[a1] - pt.V[a1] * e1.V[a2]) /
-    (e2.V[a2] * e1.V[a1] - e2.V[a1] * e1.V[a2]);
-
-  result := (u >= 0) and (V >= 0) and (u + V <= 1);
-end;
-
 //**********************************************************************
 //**********************************************************************
 
 
 function Vector2fMake(const X, Y: Single): TVector2f;
 function Vector2fMake(const X, Y: Single): TVector2f;

+ 11 - 11
Source/GLS.Windows.pas

@@ -161,16 +161,16 @@ type
   TGLBaseFontControl = class(TGLBaseControl)
   TGLBaseFontControl = class(TGLBaseControl)
   private
   private
     FBitmapFont: TGLCustomBitmapFont;
     FBitmapFont: TGLCustomBitmapFont;
-    FDefaultColor: TColorVector;
+    FDefaultColor: TGLColorVector;
   protected
   protected
     function GetDefaultColor: TColor;
     function GetDefaultColor: TColor;
     procedure SetDefaultColor(value: TColor);
     procedure SetDefaultColor(value: TColor);
     procedure SetBitmapFont(NewFont: TGLCustomBitmapFont);
     procedure SetBitmapFont(NewFont: TGLCustomBitmapFont);
     function GetBitmapFont: TGLCustomBitmapFont;
     function GetBitmapFont: TGLCustomBitmapFont;
     procedure WriteTextAt(var rci: TGLRenderContextInfo; const X, Y: TGLFloat;
     procedure WriteTextAt(var rci: TGLRenderContextInfo; const X, Y: TGLFloat;
-      const Data: UnicodeString; const Color: TColorVector); overload;
+      const Data: UnicodeString; const Color: TGLColorVector); overload;
     procedure WriteTextAt(var rci: TGLRenderContextInfo; const X1, Y1, X2, Y2:
     procedure WriteTextAt(var rci: TGLRenderContextInfo; const X1, Y1, X2, Y2:
-      TGLFloat; const Data: UnicodeString; const Color: TColorVector); overload;
+      TGLFloat; const Data: UnicodeString; const Color: TGLColorVector); overload;
     function GetFontHeight: Integer;
     function GetFontHeight: Integer;
   public
   public
     constructor Create(AOwner: TComponent); override;
     constructor Create(AOwner: TComponent); override;
@@ -199,7 +199,7 @@ type
     FOnKeyUp: TKeyEvent;
     FOnKeyUp: TKeyEvent;
     FOnKeyPress: TKeyPressEvent;
     FOnKeyPress: TKeyPressEvent;
     FShiftState: TShiftState;
     FShiftState: TShiftState;
-    FFocusedColor: TColorVector;
+    FFocusedColor: TGLColorVector;
   protected
   protected
     procedure InternalKeyPress(var Key: Char); virtual;
     procedure InternalKeyPress(var Key: Char); virtual;
     procedure InternalKeyDown(var Key: Word; Shift: TShiftState); virtual;
     procedure InternalKeyDown(var Key: Word; Shift: TShiftState); virtual;
@@ -318,7 +318,7 @@ type
     Moving: Boolean;
     Moving: Boolean;
     OldX: Integer;
     OldX: Integer;
     OldY: Integer;
     OldY: Integer;
-    FTitleColor: TColorVector;
+    FTitleColor: TGLColorVector;
     FTitleOffset: Single;
     FTitleOffset: Single;
   protected
   protected
     procedure InternalMouseDown(Shift: TShiftState; Button: TMouseButton; X, Y: Integer); override;
     procedure InternalMouseDown(Shift: TShiftState; Button: TMouseButton; X, Y: Integer); override;
@@ -528,7 +528,7 @@ type
     FColSelect: Boolean;
     FColSelect: Boolean;
     FColumns: TStrings;
     FColumns: TStrings;
     FRows: TList;
     FRows: TList;
-    FHeaderColor: TColorVector;
+    FHeaderColor: TGLColorVector;
     FMarginSize: Integer;
     FMarginSize: Integer;
     FColumnSize: Integer;
     FColumnSize: Integer;
     FRowHeight: Integer;
     FRowHeight: Integer;
@@ -1642,7 +1642,7 @@ begin
 end;
 end;
 
 
 procedure TGLBaseFontControl.WriteTextAt(var rci: TGLRenderContextInfo; const X,
 procedure TGLBaseFontControl.WriteTextAt(var rci: TGLRenderContextInfo; const X,
-  Y: TGLFloat; const Data: UnicodeString; const Color: TColorVector);
+  Y: TGLFloat; const Data: UnicodeString; const Color: TGLColorVector);
 var
 var
   Position: TGLVector;
   Position: TGLVector;
 begin
 begin
@@ -1657,7 +1657,7 @@ begin
 end;
 end;
 
 
 procedure TGLBaseFontControl.WriteTextAt(var rci: TGLRenderContextInfo; const X1,
 procedure TGLBaseFontControl.WriteTextAt(var rci: TGLRenderContextInfo; const X1,
-  Y1, X2, Y2: TGLFloat; const Data: UnicodeString; const Color: TColorVector);
+  Y1, X2, Y2: TGLFloat; const Data: UnicodeString; const Color: TGLColorVector);
 var
 var
   Position: TGLVector;
   Position: TGLVector;
 begin
 begin
@@ -2173,7 +2173,7 @@ end;
 procedure TGLForm.InternalRender(var rci: TGLRenderContextInfo; renderSelf,
 procedure TGLForm.InternalRender(var rci: TGLRenderContextInfo; renderSelf,
   renderChildren: Boolean);
   renderChildren: Boolean);
 var
 var
-  ATitleColor: TColorVector;
+  ATitleColor: TGLColorVector;
 begin
 begin
   if Assigned(FGuiComponent) then
   if Assigned(FGuiComponent) then
   begin
   begin
@@ -2486,7 +2486,7 @@ var
   TexHeight: Integer;
   TexHeight: Integer;
   Material: TGLMaterial;
   Material: TGLMaterial;
   LibMaterial: TGLLibMaterial;
   LibMaterial: TGLLibMaterial;
-  TextColor: TColorVector;
+  TextColor: TGLColorVector;
 begin
 begin
   if Pressed then
   if Pressed then
   begin
   begin
@@ -2773,7 +2773,7 @@ procedure TGLLabel.InternalRender(var rci: TGLRenderContextInfo; renderSelf,
 var
 var
   TekstPos: TGLVector;
   TekstPos: TGLVector;
   Tekst: UnicodeString;
   Tekst: UnicodeString;
-  TextColor: TColorVector;
+  TextColor: TGLColorVector;
 begin
 begin
   if Assigned(BitmapFont) then
   if Assigned(BitmapFont) then
   begin
   begin

+ 1 - 1
Source/GLSL.BumpShaders.pas

@@ -1667,7 +1667,7 @@ end;
 procedure TGLBumpShader.DoApply(var rci: TGLRenderContextInfo; Sender: TObject);
 procedure TGLBumpShader.DoApply(var rci: TGLRenderContextInfo; Sender: TObject);
 var
 var
   maxTextures, i: Integer;
   maxTextures, i: Integer;
-  ambient, LMaterialAmbient: TColorVector;
+  ambient, LMaterialAmbient: TGLColorVector;
   success: Boolean;
   success: Boolean;
 begin
 begin
   if (csDesigning in ComponentState) and not DesignTimeEnabled then
   if (csDesigning in ComponentState) and not DesignTimeEnabled then