| @@ -251,9 +251,9 @@ type | |||||
| tfARGB4us1, //< 1 x unsigned short (4bit alpha, 4bit red, 4bit green, 4bit blue) | tfARGB4us1, //< 1 x unsigned short (4bit alpha, 4bit red, 4bit green, 4bit blue) | ||||
| tfRGB5A1us1, //< 1 x unsigned short (5bit red, 5bit green, 5bit blue, 1bit alpha) | tfRGB5A1us1, //< 1 x unsigned short (5bit red, 5bit green, 5bit blue, 1bit alpha) | ||||
| tfA1RGB5us1, //< 1 x unsigned short (1bit alpha, 5bit red, 5bit green, 5bit blue) | tfA1RGB5us1, //< 1 x unsigned short (1bit alpha, 5bit red, 5bit green, 5bit blue) | ||||
| tfRGBA8ub4, //< 1 x unsigned byte (red), 1 x unsigned byte (green), 1 x unsigned byte (blue), 1 x unsigned byte (alpha) | |||||
| tfRGBA8ui1, //< 1 x unsigned int (8bit red, 8bit green, 8bit blue, 8 bit alpha) | tfRGBA8ui1, //< 1 x unsigned int (8bit red, 8bit green, 8bit blue, 8 bit alpha) | ||||
| tfARGB8ui1, //< 1 x unsigned int (8 bit alpha, 8bit red, 8bit green, 8bit blue) | tfARGB8ui1, //< 1 x unsigned int (8 bit alpha, 8bit red, 8bit green, 8bit blue) | ||||
| tfRGBA8ub4, //< 1 x unsigned byte (red), 1 x unsigned byte (green), 1 x unsigned byte (blue), 1 x unsigned byte (alpha) | |||||
| tfRGB10A2ui1, //< 1 x unsigned int (10bit red, 10bit green, 10bit blue, 2bit alpha) | tfRGB10A2ui1, //< 1 x unsigned int (10bit red, 10bit green, 10bit blue, 2bit alpha) | ||||
| tfA2RGB10ui1, //< 1 x unsigned int (2bit alpha, 10bit red, 10bit green, 10bit blue) | tfA2RGB10ui1, //< 1 x unsigned int (2bit alpha, 10bit red, 10bit green, 10bit blue) | ||||
| tfRGBA16us4, //< 1 x unsigned short (red), 1 x unsigned short (green), 1 x unsigned short (blue), 1 x unsigned short (alpha) | tfRGBA16us4, //< 1 x unsigned short (red), 1 x unsigned short (green), 1 x unsigned short (blue), 1 x unsigned short (alpha) | ||||
| @@ -274,9 +274,9 @@ type | |||||
| tfABGR4us1, //< 1 x unsigned short (4bit alpha, 4bit blue, 4bit green, 4bit red) | tfABGR4us1, //< 1 x unsigned short (4bit alpha, 4bit blue, 4bit green, 4bit red) | ||||
| tfBGR5A1us1, //< 1 x unsigned short (5bit blue, 5bit green, 5bit red, 1bit alpha) | tfBGR5A1us1, //< 1 x unsigned short (5bit blue, 5bit green, 5bit red, 1bit alpha) | ||||
| tfA1BGR5us1, //< 1 x unsigned short (1bit alpha, 5bit blue, 5bit green, 5bit red) | tfA1BGR5us1, //< 1 x unsigned short (1bit alpha, 5bit blue, 5bit green, 5bit red) | ||||
| tfBGRA8ub4, //< 1 x unsigned byte (blue), 1 x unsigned byte (green), 1 x unsigned byte (red), 1 x unsigned byte (alpha) | |||||
| tfBGRA8ui1, //< 1 x unsigned int (8bit blue, 8bit green, 8bit red, 8bit alpha) | tfBGRA8ui1, //< 1 x unsigned int (8bit blue, 8bit green, 8bit red, 8bit alpha) | ||||
| tfABGR8ui1, //< 1 x unsigned int (8bit alpha, 8bit blue, 8bit green, 8bit red) | tfABGR8ui1, //< 1 x unsigned int (8bit alpha, 8bit blue, 8bit green, 8bit red) | ||||
| tfBGRA8ub4, //< 1 x unsigned byte (blue), 1 x unsigned byte (green), 1 x unsigned byte (red), 1 x unsigned byte (alpha) | |||||
| tfBGR10A2ui1, //< 1 x unsigned int (10bit blue, 10bit green, 10bit red, 2bit alpha) | tfBGR10A2ui1, //< 1 x unsigned int (10bit blue, 10bit green, 10bit red, 2bit alpha) | ||||
| tfA2BGR10ui1, //< 1 x unsigned int (2bit alpha, 10bit blue, 10bit green, 10bit red) | tfA2BGR10ui1, //< 1 x unsigned int (2bit alpha, 10bit blue, 10bit green, 10bit red) | ||||
| tfBGRA16us4, //< 1 x unsigned short (blue), 1 x unsigned short (green), 1 x unsigned short (red), 1 x unsigned short (alpha) | tfBGRA16us4, //< 1 x unsigned short (blue), 1 x unsigned short (green), 1 x unsigned short (red), 1 x unsigned short (alpha) | ||||
| @@ -455,7 +455,12 @@ type | |||||
| { get the format descriptor by a given OpenGL internal format | { get the format descriptor by a given OpenGL internal format | ||||
| @param aInternalFormat OpenGL internal format to get format descriptor for | @param aInternalFormat OpenGL internal format to get format descriptor for | ||||
| @returns suitable format descriptor or tfEmpty-Descriptor } | @returns suitable format descriptor or tfEmpty-Descriptor } | ||||
| class function GetByFormat(const aInternalFormat: GLenum): TglBitmapFormatDescriptor; | |||||
| class function GetByFormat(const aInternalFormat: GLenum): TglBitmapFormatDescriptor; overload; | |||||
| { get the format descriptor by the given format | |||||
| @param aFormat format to get descriptor for | |||||
| @return suitable format descriptor or tfEmpty-Descriptor } | |||||
| class function GetByFormat(const aFormat: TglBitmapFormat): TglBitmapFormatDescriptor; overload; | |||||
| end; | end; | ||||
| //////////////////////////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////////////////////////// | ||||
| @@ -1742,9 +1747,9 @@ const | |||||
| TfdARGB4us1, | TfdARGB4us1, | ||||
| TfdRGB5A1us1, | TfdRGB5A1us1, | ||||
| TfdA1RGB5us1, | TfdA1RGB5us1, | ||||
| TfdRGBA8ub4, | |||||
| TfdRGBA8ui1, | TfdRGBA8ui1, | ||||
| TfdARGB8ui1, | TfdARGB8ui1, | ||||
| TfdRGBA8ub4, | |||||
| TfdRGB10A2ui1, | TfdRGB10A2ui1, | ||||
| TfdA2RGB10ui1, | TfdA2RGB10ui1, | ||||
| TfdRGBA16us4, | TfdRGBA16us4, | ||||
| @@ -1765,9 +1770,9 @@ const | |||||
| TfdABGR4us1, | TfdABGR4us1, | ||||
| TfdBGR5A1us1, | TfdBGR5A1us1, | ||||
| TfdA1BGR5us1, | TfdA1BGR5us1, | ||||
| TfdBGRA8ub4, | |||||
| TfdBGRA8ui1, | TfdBGRA8ui1, | ||||
| TfdABGR8ui1, | TfdABGR8ui1, | ||||
| TfdBGRA8ub4, | |||||
| TfdBGR10A2ui1, | TfdBGR10A2ui1, | ||||
| TfdA2BGR10ui1, | TfdA2BGR10ui1, | ||||
| TfdBGRA16us4, | TfdBGRA16us4, | ||||
| @@ -3070,7 +3075,7 @@ begin | |||||
| fPrecision := glBitmapRec4ub( 4, 4, 4, 4); | fPrecision := glBitmapRec4ub( 4, 4, 4, 4); | ||||
| fShift := glBitmapRec4ub(12, 8, 4, 0); | fShift := glBitmapRec4ub(12, 8, 4, 0); | ||||
| fglFormat := GL_RGBA; | fglFormat := GL_RGBA; | ||||
| fglInternalFormat := {$IF NOT DEFINED(OPENGL_ES) OR DEFINED(OPENGL_ES_3_0)}GL_RGBA8{$ELSE}GL_RGBA{$IFEND}; | |||||
| fglInternalFormat := {$IF NOT DEFINED(OPENGL_ES) OR DEFINED(OPENGL_ES_3_0)}GL_RGBA4{$ELSE}GL_RGBA{$IFEND}; | |||||
| fglDataFormat := GL_UNSIGNED_SHORT_4_4_4_4; | fglDataFormat := GL_UNSIGNED_SHORT_4_4_4_4; | ||||
| end; | end; | ||||
| @@ -3932,6 +3937,14 @@ begin | |||||
| result := TFormatDescriptor.Get(tfEmpty); | result := TFormatDescriptor.Get(tfEmpty); | ||||
| end; | end; | ||||
| ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||||
| class function TglBitmapFormatDescriptor.GetByFormat(const aFormat: TglBitmapFormat): TglBitmapFormatDescriptor; | |||||
| begin | |||||
| result := TFormatDescriptor.Get(aFormat); | |||||
| if not Assigned(result) then | |||||
| result := TFormatDescriptor.Get(tfEmpty); | |||||
| end; | |||||
| ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||||
| //TFormatDescriptor/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | //TFormatDescriptor/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||||
| ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||||
| @@ -8439,6 +8452,7 @@ begin | |||||
| FormatDesc := TFormatDescriptor.Get(IntFormat); | FormatDesc := TFormatDescriptor.Get(IntFormat); | ||||
| GetMem(Temp, FormatDesc.GetSize(TempWidth, TempHeight)); | GetMem(Temp, FormatDesc.GetSize(TempWidth, TempHeight)); | ||||
| try | try | ||||
| glPixelStorei(GL_PACK_ALIGNMENT, 1); | |||||
| if FormatDesc.IsCompressed then begin | if FormatDesc.IsCompressed then begin | ||||
| if not Assigned(glGetCompressedTexImage) then | if not Assigned(glGetCompressedTexImage) then | ||||
| raise EglBitmap.Create('compressed formats not supported by video adapter'); | raise EglBitmap.Create('compressed formats not supported by video adapter'); | ||||