* added HasOpenGLSupport to FormatDescriptor to check if the given format is supporte...
[glBitmap.git] / glBitmap.pas
index 1e804e0..574bab5 100644 (file)
@@ -390,6 +390,10 @@ type
 
     { @return @true if the format is a grayscale format, @false otherwise }
     function GetIsGrayscale: Boolean;
 
     { @return @true if the format is a grayscale format, @false otherwise }
     function GetIsGrayscale: Boolean;
+
+    { @return @true if the format is supported by OpenGL, @false otherwise }
+    function GetHasOpenGLSupport: Boolean;
+
   protected
     fFormat:        TglBitmapFormat;  //< format this descriptor belongs to
     fWithAlpha:     TglBitmapFormat;  //< suitable format with alpha channel
   protected
     fFormat:        TglBitmapFormat;  //< format this descriptor belongs to
     fWithAlpha:     TglBitmapFormat;  //< suitable format with alpha channel
@@ -442,6 +446,8 @@ type
     property HasColor:     Boolean read GetHasColor;      //< @true if the format has any color color channel, @false otherwise
     property IsGrayscale:  Boolean read GetIsGrayscale;   //< @true if the format is a grayscale format, @false otherwise
 
     property HasColor:     Boolean read GetHasColor;      //< @true if the format has any color color channel, @false otherwise
     property IsGrayscale:  Boolean read GetIsGrayscale;   //< @true if the format is a grayscale format, @false otherwise
 
+    property HasOpenGLSupport: Boolean read GetHasOpenGLSupport; //< @true if the format is supported by OpenGL, @false otherwise
+
     function GetSize(const aSize: TglBitmapSize): Integer;     overload; virtual;
     function GetSize(const aWidth, aHeight: Integer): Integer; overload; virtual;
 
     function GetSize(const aSize: TglBitmapSize): Integer;     overload; virtual;
     function GetSize(const aWidth, aHeight: Integer): Integer; overload; virtual;
 
@@ -3837,6 +3843,11 @@ begin
   result := (Mask.r = Mask.g) and (Mask.g = Mask.b) and (Mask.r > 0);
 end;
 
   result := (Mask.r = Mask.g) and (Mask.g = Mask.b) and (Mask.r > 0);
 end;
 
+function TglBitmapFormatDescriptor.GetHasOpenGLSupport: Boolean;
+begin
+  result := (OpenGLFormat = Format);
+end;
+
 procedure TglBitmapFormatDescriptor.SetValues;
 begin
   fFormat       := tfEmpty;
 procedure TglBitmapFormatDescriptor.SetValues;
 begin
   fFormat       := tfEmpty;