X-Git-Url: https://git.delphigl.com/?p=glBitmap.git;a=blobdiff_plain;f=glBitmap.pas;h=574bab5cce277b628670e6ea90c2c2e1f8f93208;hp=1e804e05e0ba1b8f37f25ca9b02670d38493417a;hb=e991f684566fa8872e7807a9eac99844ac60c058;hpb=c110c2d190cfdd632a622163d3edb7c9c90cf21a diff --git a/glBitmap.pas b/glBitmap.pas index 1e804e0..574bab5 100644 --- a/glBitmap.pas +++ b/glBitmap.pas @@ -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 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 +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 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 +3843,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;