* removed some compiler defines
[LazOpenGLCore.git] / glBitmap.pas
index 1e804e0..9f3706b 100644 (file)
@@ -179,8 +179,6 @@ unit glBitmap;
   {$OPTIMIZATION ON}
 {$ENDIF}
 
-{$UNDEF GLB_LAZARUS}
-
 interface
 
 uses
@@ -390,6 +388,10 @@ type
 
     { @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
@@ -442,6 +444,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 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;
 
@@ -3837,6 +3841,11 @@ begin
   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;