//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// activate to enable build-in OpenGL support with statically linked methods
// use dglOpenGL.pas if not enabled
-{$DEFINE GLB_NATIVE_OGL_STATIC}
+{.$DEFINE GLB_NATIVE_OGL_STATIC}
// activate to enable build-in OpenGL support with dynamically linked methods
// use dglOpenGL.pas if not enabled
Position: TglBitmapPixelPosition;
Source: TglBitmapPixelData;
Dest: TglBitmapPixelData;
- Args: PtrInt;
+ Args: Pointer;
end;
TglBitmapFunction = procedure(var FuncRec: TglBitmapFunctionRec);
procedure SetAnisotropic(const aValue: Integer);
procedure CreateID;
- procedure SetupParameters(var aBuildWithGlu: Boolean);
+ procedure SetupParameters(out aBuildWithGlu: Boolean);
procedure SetDataPointer(const aData: PByte; const aFormat: TglBitmapFormat;
const aWidth: Integer = -1; const aHeight: Integer = -1); virtual;
procedure GenTexture(const aTestTextureSize: Boolean = true); virtual; abstract;
procedure LoadFromFile(const aFilename: String);
procedure LoadFromStream(const aStream: TStream); virtual;
procedure LoadFromFunc(const aSize: TglBitmapPixelPosition; const aFunc: TglBitmapFunction;
- const aFormat: TglBitmapFormat; const aArgs: PtrInt = 0);
+ const aFormat: TglBitmapFormat; const aArgs: Pointer = nil);
{$IFDEF GLB_DELPHI}
procedure LoadFromResource(const aInstance: Cardinal; const aResource: String; const aResType: PChar = nil);
procedure LoadFromResourceID(const sInstance: Cardinal; const aResourceID: Integer; const aResType: PChar);
procedure SaveToStream(const aStream: TStream; const aFileType: TglBitmapFileType); virtual;
//Convert
- function AddFunc(const aFunc: TglBitmapFunction; const aCreateTemp: Boolean; const aArgs: PtrInt = 0): Boolean; overload;
+ function AddFunc(const aFunc: TglBitmapFunction; const aCreateTemp: Boolean; const aArgs: Pointer = nil): Boolean; overload;
function AddFunc(const aSource: TglBitmap; const aFunc: TglBitmapFunction; aCreateTemp: Boolean;
- const aFormat: TglBitmapFormat; const aArgs: PtrInt = 0): Boolean; overload;
+ const aFormat: TglBitmapFormat; const aArgs: Pointer = nil): Boolean; overload;
public
//Alpha & Co
{$IFDEF GLB_SDL}
function AssignFromSurface(const aSurface: PSDL_Surface): Boolean;
function AssignAlphaToSurface(out aSurface: PSDL_Surface): Boolean;
function AddAlphaFromSurface(const aSurface: PSDL_Surface; const aFunc: TglBitmapFunction = nil;
- const aArgs: PtrInt = 0): Boolean;
+ const aArgs: Pointer = nil): Boolean;
{$ENDIF}
{$IFDEF GLB_DELPHI}
function AssignFromBitmap(const aBitmap: TBitmap): Boolean;
function AssignAlphaToBitmap(const aBitmap: TBitmap): Boolean;
function AddAlphaFromBitmap(const aBitmap: TBitmap; const aFunc: TglBitmapFunction = nil;
- const aArgs: PtrInt = 0): Boolean;
+ const aArgs: Pointer = nil): Boolean;
function AddAlphaFromResource(const aInstance: Cardinal; const aResource: String; const aResType: PChar = nil;
- const aFunc: TglBitmapFunction = nil; const aArgs: PtrInt = 0): Boolean;
+ const aFunc: TglBitmapFunction = nil; const aArgs: Pointer = nil): Boolean;
function AddAlphaFromResourceID(const aInstance: Cardinal; const aResourceID: Integer; const aResType: PChar;
- const aFunc: TglBitmapFunction = nil; const aArgs: PtrInt = 0): Boolean;
+ const aFunc: TglBitmapFunction = nil; const aArgs: Pointer = nil): Boolean;
{$ENDIF}
- function AddAlphaFromFunc(const aFunc: TglBitmapFunction; const aArgs: PtrInt = 0): Boolean; virtual;
- function AddAlphaFromFile(const aFileName: String; const aFunc: TglBitmapFunction = nil; const aArgs: PtrInt = 0): Boolean;
- function AddAlphaFromStream(const aStream: TStream; const aFunc: TglBitmapFunction = nil; const aArgs: PtrInt = 0): Boolean;
- function AddAlphaFromGlBitmap(const aBitmap: TglBitmap; aFunc: TglBitmapFunction = nil; const aArgs: PtrInt = 0): Boolean;
+ function AddAlphaFromFunc(const aFunc: TglBitmapFunction; const aArgs: Pointer = nil): Boolean; virtual;
+ function AddAlphaFromFile(const aFileName: String; const aFunc: TglBitmapFunction = nil; const aArgs: Pointer = nil): Boolean;
+ function AddAlphaFromStream(const aStream: TStream; const aFunc: TglBitmapFunction = nil; const aArgs: Pointer = nil): Boolean;
+ function AddAlphaFromGlBitmap(const aBitmap: TglBitmap; aFunc: TglBitmapFunction = nil; const aArgs: Pointer = nil): Boolean;
function AddAlphaFromColorKey(const aRed, aGreen, aBlue: Byte; const aDeviation: Byte = 0): Boolean;
function AddAlphaFromColorKeyRange(const aRed, aGreen, aBlue: Cardinal; const aDeviation: Cardinal = 0): Boolean;
const T: Cardinal = GL_CLAMP_TO_EDGE;
const R: Cardinal = GL_CLAMP_TO_EDGE);
- procedure GetPixel(const aPos: TglBitmapPixelPosition; var aPixel: TglBitmapPixelData); virtual;
- procedure SetPixel(const aPos: TglBitmapPixelPosition; const aPixel: TglBitmapPixelData); virtual;
-
procedure Bind(const aEnableTextureUnit: Boolean = true); virtual;
procedure Unbind(const aDisableTextureUnit: Boolean = true); virtual;
constructor Create(const aFileName: String); overload;
constructor Create(const aStream: TStream); overload;
constructor Create(const aSize: TglBitmapPixelPosition; const aFormat: TglBitmapFormat); overload;
- constructor Create(const aSize: TglBitmapPixelPosition; const aFormat: TglBitmapFormat; const aFunc: TglBitmapFunction; const aArgs: PtrInt = 0); overload;
+ constructor Create(const aSize: TglBitmapPixelPosition; const aFormat: TglBitmapFormat; const aFunc: TglBitmapFunction; const aArgs: Pointer = nil); overload;
{$IFDEF GLB_DELPHI}
constructor Create(const aInstance: Cardinal; const aResource: String; const aResType: PChar = nil); overload;
constructor Create(const aInstance: Cardinal; const aResourceID: Integer; const aResType: PChar); overload;
property AlphaMask: UInt64 read GetAlphaMask;
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); virtual; abstract;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); virtual; abstract;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); virtual; abstract;
function GetSize(const aSize: TglBitmapPixelPosition): Integer; virtual; overload;
function GetSize(const aWidth, aHeight: Integer): Integer; virtual; overload;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TfdAlpha_UB1 = class(TFormatDescriptor) //1* unsigned byte
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
TfdLuminance_UB1 = class(TFormatDescriptor) //1* unsigned byte
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
TfdUniversal_UB1 = class(TFormatDescriptor) //1* unsigned byte
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
TfdLuminanceAlpha_UB2 = class(TfdLuminance_UB1) //2* unsigned byte
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
TfdRGB_UB3 = class(TFormatDescriptor) //3* unsigned byte
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
TfdBGR_UB3 = class(TFormatDescriptor) //3* unsigned byte (inverse)
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
TfdRGBA_UB4 = class(TfdRGB_UB3) //4* unsigned byte
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
TfdBGRA_UB4 = class(TfdBGR_UB3) //4* unsigned byte (inverse)
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TfdAlpha_US1 = class(TFormatDescriptor) //1* unsigned short
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
TfdLuminance_US1 = class(TFormatDescriptor) //1* unsigned short
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
TfdUniversal_US1 = class(TFormatDescriptor) //1* unsigned short
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
TfdDepth_US1 = class(TFormatDescriptor) //1* unsigned short
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
TfdLuminanceAlpha_US2 = class(TfdLuminance_US1) //2* unsigned short
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
TfdRGB_US3 = class(TFormatDescriptor) //3* unsigned short
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
TfdBGR_US3 = class(TFormatDescriptor) //3* unsigned short (inverse)
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
TfdRGBA_US4 = class(TfdRGB_US3) //4* unsigned short
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
TfdBGRA_US4 = class(TfdBGR_US3) //4* unsigned short (inverse)
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TfdUniversal_UI1 = class(TFormatDescriptor) //1* unsigned int
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
TfdDepth_UI1 = class(TFormatDescriptor) //1* unsigned int
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
TfdS3tcDtx1RGBA = class(TFormatDescriptor)
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
TfdS3tcDtx3RGBA = class(TFormatDescriptor)
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
TfdS3tcDtx5RGBA = class(TFormatDescriptor)
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
constructor Create; override;
end;
property PixelSize: Single read fPixelSize write fPixelSize;
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
procedure CreateColorTable;
procedure Map(const aPixel: TglBitmapPixelData; var aData: PByte; var aMapData: Pointer); override;
- procedure Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
+ procedure Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer); override;
destructor Destroy; override;
end;
aLibHandle := GL_LibHandle;
{$IF DEFINED(GLB_WIN)}
- result := GetProcAddress(HMODULE(aLibHandle), aProcName);
+ result := GetProcAddress({%H-}HMODULE(aLibHandle), aProcName);
if Assigned(result) then
exit;
function glbLoadLibrary(const aName: PChar): Pointer;
begin
{$IF DEFINED(GLB_WIN)}
- result := Pointer(LoadLibrary(aName));
+ result := {%H-}Pointer(LoadLibrary(aName));
{$ELSEIF DEFINED(GLB_LINUX)}
result := dlopen(Name, RTLD_LAZY);
{$ELSE}
exit;
{$IF DEFINED(GLB_WIN)}
- Result := FreeLibrary(HINST(aLibHandle));
+ Result := FreeLibrary({%H-}HINST(aLibHandle));
{$ELSEIF DEFINED(GLB_LINUX)}
Result := dlclose(aLibHandle) = 0;
{$ENDIF}
end;
-var
- p: Pointer;
begin
if Assigned(GL_LibHandle) then
glbFreeLibrary(GL_LibHandle);
MajorVersion, MinorVersion: Integer;
///////////////////////////////////////////////////////////////////////////////////////////
- procedure TrimVersionString(Buffer: AnsiString; var Major, Minor: Integer);
+ procedure TrimVersionString(aBuffer: AnsiString; out aMajor, aMinor: Integer);
var
Separator: Integer;
begin
- Minor := 0;
- Major := 0;
+ aMinor := 0;
+ aMajor := 0;
- Separator := Pos(AnsiString('.'), Buffer);
- if (Separator > 1) and (Separator < Length(Buffer)) and
- (Buffer[Separator - 1] in ['0'..'9']) and
- (Buffer[Separator + 1] in ['0'..'9']) then begin
+ Separator := Pos(AnsiString('.'), aBuffer);
+ if (Separator > 1) and (Separator < Length(aBuffer)) and
+ (aBuffer[Separator - 1] in ['0'..'9']) and
+ (aBuffer[Separator + 1] in ['0'..'9']) then begin
Dec(Separator);
- while (Separator > 0) and (Buffer[Separator] in ['0'..'9']) do
+ while (Separator > 0) and (aBuffer[Separator] in ['0'..'9']) do
Dec(Separator);
- Delete(Buffer, 1, Separator);
- Separator := Pos(AnsiString('.'), Buffer) + 1;
+ Delete(aBuffer, 1, Separator);
+ Separator := Pos(AnsiString('.'), aBuffer) + 1;
- while (Separator <= Length(Buffer)) and (AnsiChar(Buffer[Separator]) in ['0'..'9']) do
+ while (Separator <= Length(aBuffer)) and (AnsiChar(aBuffer[Separator]) in ['0'..'9']) do
Inc(Separator);
- Delete(Buffer, Separator, 255);
- Separator := Pos(AnsiString('.'), Buffer);
+ Delete(aBuffer, Separator, 255);
+ Separator := Pos(AnsiString('.'), aBuffer);
- Major := StrToInt(Copy(String(Buffer), 1, Separator - 1));
- Minor := StrToInt(Copy(String(Buffer), Separator + 1, 1));
+ aMajor := StrToInt(Copy(String(aBuffer), 1, Separator - 1));
+ aMinor := StrToInt(Copy(String(aBuffer), Separator + 1, 1));
end;
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
procedure TFormatDescriptor.PreparePixel(out aPixel: TglBitmapPixelData);
begin
- FillChar(aPixel, SizeOf(aPixel), 0);
+ FillChar(aPixel{%H-}, SizeOf(aPixel), 0);
aPixel.Data := fRange;
aPixel.Range := fRange;
aPixel.Format := fFormat;
inc(aData);
end;
-procedure TfdAlpha_UB1.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdAlpha_UB1.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
begin
aPixel.Data.r := 0;
aPixel.Data.g := 0;
inc(aData);
end;
-procedure TfdLuminance_UB1.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdLuminance_UB1.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
begin
aPixel.Data.r := aData^;
aPixel.Data.g := aData^;
inc(aData);
end;
-procedure TfdUniversal_UB1.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdUniversal_UB1.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
var
i: Integer;
begin
inc(aData);
end;
-procedure TfdLuminanceAlpha_UB2.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdLuminanceAlpha_UB2.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
begin
inherited Unmap(aData, aPixel, aMapData);
aPixel.Data.a := aData^;
inc(aData);
end;
-procedure TfdRGB_UB3.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdRGB_UB3.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
begin
aPixel.Data.r := aData^;
inc(aData);
inc(aData);
end;
-procedure TfdBGR_UB3.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdBGR_UB3.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
begin
aPixel.Data.b := aData^;
inc(aData);
inc(aData);
end;
-procedure TfdRGBA_UB4.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdRGBA_UB4.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
begin
inherited Unmap(aData, aPixel, aMapData);
aPixel.Data.a := aData^;
inc(aData);
end;
-procedure TfdBGRA_UB4.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdBGRA_UB4.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
begin
inherited Unmap(aData, aPixel, aMapData);
aPixel.Data.a := aData^;
inc(aData, 2);
end;
-procedure TfdAlpha_US1.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdAlpha_US1.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
begin
aPixel.Data.r := 0;
aPixel.Data.g := 0;
inc(aData, 2);
end;
-procedure TfdLuminance_US1.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdLuminance_US1.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
begin
aPixel.Data.r := PWord(aData)^;
aPixel.Data.g := PWord(aData)^;
inc(aData, 2);
end;
-procedure TfdUniversal_US1.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdUniversal_US1.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
var
i: Integer;
begin
inc(aData, 2);
end;
-procedure TfdDepth_US1.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdDepth_US1.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
begin
aPixel.Data.r := PWord(aData)^;
aPixel.Data.g := PWord(aData)^;
inc(aData, 2);
end;
-procedure TfdLuminanceAlpha_US2.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdLuminanceAlpha_US2.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
begin
inherited Unmap(aData, aPixel, aMapData);
aPixel.Data.a := PWord(aData)^;
inc(aData, 2);
end;
-procedure TfdRGB_US3.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdRGB_US3.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
begin
aPixel.Data.r := PWord(aData)^;
inc(aData, 2);
inc(aData, 2);
end;
-procedure TfdBGR_US3.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdBGR_US3.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
begin
aPixel.Data.b := PWord(aData)^;
inc(aData, 2);
inc(aData, 2);
end;
-procedure TfdRGBA_US4.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdRGBA_US4.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
begin
inherited Unmap(aData, aPixel, aMapData);
aPixel.Data.a := PWord(aData)^;
inc(aData, 2);
end;
-procedure TfdBGRA_US4.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdBGRA_US4.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
begin
inherited Unmap(aData, aPixel, aMapData);
aPixel.Data.a := PWord(aData)^;
inc(aData, 4);
end;
-procedure TfdUniversal_UI1.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdUniversal_UI1.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
var
i: Integer;
begin
inc(aData, 4);
end;
-procedure TfdDepth_UI1.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdDepth_UI1.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
begin
aPixel.Data.r := PCardinal(aData)^;
aPixel.Data.g := PCardinal(aData)^;
raise EglBitmapException.Create('mapping for compressed formats is not supported');
end;
-procedure TfdS3tcDtx1RGBA.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdS3tcDtx1RGBA.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
begin
raise EglBitmapException.Create('mapping for compressed formats is not supported');
end;
raise EglBitmapException.Create('mapping for compressed formats is not supported');
end;
-procedure TfdS3tcDtx3RGBA.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdS3tcDtx3RGBA.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
begin
raise EglBitmapException.Create('mapping for compressed formats is not supported');
end;
raise EglBitmapException.Create('mapping for compressed formats is not supported');
end;
-procedure TfdS3tcDtx5RGBA.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TfdS3tcDtx5RGBA.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
begin
raise EglBitmapException.Create('mapping for compressed formats is not supported');
end;
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-procedure TbmpBitfieldFormat.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TbmpBitfieldFormat.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
var
data: UInt64;
s, i: Integer;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
procedure TbmpColorTableFormat.CreateColorTable;
var
- bits: Byte;
- len: Integer;
i: Integer;
begin
if not (Format in [tfLuminance4, tfLuminance8, tfR3G3B2]) then
if (aMapData = nil) then
aData^ := 0;
d := LuminanceWeight(aPixel) and Range.r;
- aData^ := aData^ or (d shl (4 - PtrInt(aMapData)));
+ aData^ := aData^ or (d shl (4 - {%H-}PtrUInt(aMapData)));
inc(aMapData, 4);
- if (PtrInt(aMapData) >= 8) then begin
+ if ({%H-}PtrUInt(aMapData) >= 8) then begin
inc(aData);
aMapData := nil;
end;
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-procedure TbmpColorTableFormat.Unmap(var aData: PByte; var aPixel: TglBitmapPixelData; var aMapData: Pointer);
+procedure TbmpColorTableFormat.Unmap(var aData: PByte; out aPixel: TglBitmapPixelData; var aMapData: Pointer);
type
PUInt64 = ^UInt64;
var
f := fPixelSize - s;
bits := Round(8 * f);
case s of
- 0: idx := (aData^ shr (8 - bits - PtrInt(aMapData))) and ((1 shl bits) - 1);
+ 0: idx := (aData^ shr (8 - bits - {%H-}PtrUInt(aMapData))) and ((1 shl bits) - 1);
1: idx := aData^;
2: idx := PWord(aData)^;
4: idx := PCardinal(aData)^;
aPixel.Data.a := a;
end;
inc(aMapData, bits);
- if (PtrInt(aMapData) >= 8) then begin
+ if ({%H-}PtrUInt(aMapData) >= 8) then begin
inc(aData, 1);
dec(aMapData, 8);
end;
begin
with aFuncRec do begin
Dest.Data := Source.Data;
- if (Args and $1 > 0) then begin
+ if ({%H-}PtrUInt(Args) and $1 > 0) then begin
Dest.Data.r := Dest.Data.r xor Dest.Range.r;
Dest.Data.g := Dest.Data.g xor Dest.Range.g;
Dest.Data.b := Dest.Data.b xor Dest.Range.b;
end;
- if (Args and $2 > 0) then begin
+ if ({%H-}PtrUInt(Args) and $2 > 0) then begin
Dest.Data.a := Dest.Data.a xor Dest.Range.a;
end;
end;
Temp: Single;
begin
with FuncRec do begin
- if (FuncRec.Args = 0) then begin //source has no alpha
+ if (FuncRec.Args = nil) then begin //source has no alpha
Temp :=
Source.Data.r / Source.Range.r * ALPHA_WEIGHT_R +
Source.Data.g / Source.Range.g * ALPHA_WEIGHT_G +
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
procedure glBitmapValueAlphaFunc(var FuncRec: TglBitmapFunctionRec);
-type
- PglBitmapPixelData = ^TglBitmapPixelData;
begin
with FuncRec do begin
Dest.Data.r := Source.Data.r;
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-procedure TglBitmap.SetupParameters(var aBuildWithGlu: Boolean);
+procedure TglBitmap.SetupParameters(out aBuildWithGlu: Boolean);
begin
// Set Up Parameters
SetWrap(fWrapS, fWrapT, fWrapR);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
procedure TglBitmap.LoadFromFunc(const aSize: TglBitmapPixelPosition; const aFunc: TglBitmapFunction;
- const aFormat: TglBitmapFormat; const aArgs: PtrInt);
+ const aFormat: TglBitmapFormat; const aArgs: Pointer);
var
tmpData: PByte;
size: Integer;
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-function TglBitmap.AddFunc(const aFunc: TglBitmapFunction; const aCreateTemp: Boolean; const aArgs: PtrInt): Boolean;
+function TglBitmap.AddFunc(const aFunc: TglBitmapFunction; const aCreateTemp: Boolean; const aArgs: Pointer): Boolean;
begin
result := AddFunc(Self, aFunc, aCreateTemp, Format, aArgs);
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function TglBitmap.AddFunc(const aSource: TglBitmap; const aFunc: TglBitmapFunction; aCreateTemp: Boolean;
- const aFormat: TglBitmapFormat; const aArgs: PtrInt): Boolean;
+ const aFormat: TglBitmapFormat; const aArgs: Pointer): Boolean;
var
DestData, TmpData, SourceData: pByte;
TempHeight, TempWidth: Integer;
{$ENDIF}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-function TglBitmap.AddAlphaFromFunc(const aFunc: TglBitmapFunction; const aArgs: PtrInt): Boolean;
+function TglBitmap.AddAlphaFromFunc(const aFunc: TglBitmapFunction; const aArgs: Pointer): Boolean;
begin
(* TODO
if not FormatIsUncompressed(InternalFormat) then
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-function TglBitmap.AddAlphaFromFile(const aFileName: String; const aFunc: TglBitmapFunction; const aArgs: PtrInt): Boolean;
+function TglBitmap.AddAlphaFromFile(const aFileName: String; const aFunc: TglBitmapFunction; const aArgs: Pointer): Boolean;
var
FS: TFileStream;
begin
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-function TglBitmap.AddAlphaFromStream(const aStream: TStream; const aFunc: TglBitmapFunction; const aArgs: PtrInt): Boolean;
+function TglBitmap.AddAlphaFromStream(const aStream: TStream; const aFunc: TglBitmapFunction; const aArgs: Pointer): Boolean;
var
tex: TglBitmap2D;
begin
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-function TglBitmap.AddAlphaFromGlBitmap(const aBitmap: TglBitmap; aFunc: TglBitmapFunction; const aArgs: PtrInt): Boolean;
+function TglBitmap.AddAlphaFromGlBitmap(const aBitmap: TglBitmap; aFunc: TglBitmapFunction; const aArgs: Pointer): Boolean;
var
DestData, DestData2, SourceData: pByte;
TempHeight, TempWidth: Integer;
if ((aBitmap.Width = Width) and (aBitmap.Height = Height)) then begin
result := ConvertTo(TFormatDescriptor.Get(Format).WithAlpha);
- if not Assigned(aFunc) then
- aFunc := glBitmapAlphaFunc;
SourceFD := TFormatDescriptor.Get(aBitmap.Format);
DestFD := TFormatDescriptor.Get(Format);
+ if not Assigned(aFunc) then begin
+ aFunc := glBitmapAlphaFunc;
+ FuncRec.Args := {%H-}Pointer(SourceFD.HasAlpha);
+ end else
+ FuncRec.Args := aArgs;
+
// Values
TempHeight := aBitmap.FileHeight;
TempWidth := aBitmap.FileWidth;
FuncRec.Sender := Self;
- FuncRec.Args := aArgs;
FuncRec.Size := Dimension;
FuncRec.Position.Fields := FuncRec.Size.Fields;
- FuncRec.Args := PtrInt(SourceFD.HasAlpha) and 1;
DestData := Data;
DestData2 := Data;
Data.a := 0;
Range.a := 0;
end;
- result := AddAlphaFromFunc(glBitmapColorKeyAlphaFunc, PtrInt(@PixelData));
+ result := AddAlphaFromFunc(glBitmapColorKeyAlphaFunc, @PixelData);
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TFormatDescriptor.GetWithAlpha(Format).PreparePixel(PixelData);
with PixelData do
Data.a := Min(Range.a, Max(0, Round(Range.a * aAlpha)));
- result := AddAlphaFromFunc(glBitmapValueAlphaFunc, PtrInt(@PixelData.Data.a));
+ result := AddAlphaFromFunc(glBitmapValueAlphaFunc, @PixelData.Data.a);
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ShiftData.g := GetShift(SourcePD.Range.g, DestPD.Range.g);
ShiftData.b := GetShift(SourcePD.Range.b, DestPD.Range.b);
ShiftData.a := GetShift(SourcePD.Range.a, DestPD.Range.a);
- result := AddFunc(Self, glBitmapConvertShiftRGBAFunc, false, aFormat, PtrInt(@ShiftData));
+ result := AddFunc(Self, glBitmapConvertShiftRGBAFunc, false, aFormat, @ShiftData);
end else
result := AddFunc(Self, glBitmapConvertCalculateRGBAFunc, false, aFormat);
end else
procedure TglBitmap.Invert(const aUseRGB: Boolean; const aUseAlpha: Boolean);
begin
if aUseRGB or aUseAlpha then
- AddFunc(glBitmapInvertFunc, false, ((PtrInt(aUseAlpha) and 1) shl 1) or (PtrInt(aUseRGB) and 1));
+ AddFunc(glBitmapInvertFunc, false, {%H-}Pointer(
+ ((PtrInt(aUseAlpha) and 1) shl 1) or
+ (PtrInt(aUseRGB) and 1) ));
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Data.b := Max(0, Min(Range.b, Trunc(Range.b * aBlue)));
Data.a := Max(0, Min(Range.a, Trunc(Range.a * aAlpha)));
end;
- AddFunc(glBitmapFillWithColorFunc, false, PtrInt(@PixelData));
+ AddFunc(glBitmapFillWithColorFunc, false, @PixelData);
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-procedure TglBitmap.GetPixel(const aPos: TglBitmapPixelPosition; var aPixel: TglBitmapPixelData);
-begin
- { TODO delete?
- if Assigned (fGetPixelFunc) then
- fGetPixelFunc(aPos, aPixel);
- }
-end;
-
-//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-procedure TglBitmap.SetPixel(const aPos: TglBitmapPixelPosition; const aPixel: TglBitmapPixelData);
-begin
- {TODO delete?
- if Assigned (fSetPixelFunc) then
- fSetPixelFuc(aPos, aPixel);
- }
-end;
-
-//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
procedure TglBitmap.Bind(const aEnableTextureUnit: Boolean);
begin
if aEnableTextureUnit then
ImageSize: Integer;
begin
Create;
- TFormatDescriptor.Get(aFormat).GetSize(aSize);
+ ImageSize := TFormatDescriptor.Get(aFormat).GetSize(aSize);
GetMem(Image, ImageSize);
try
FillChar(Image^, ImageSize, #$FF);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
constructor TglBitmap.Create(const aSize: TglBitmapPixelPosition; const aFormat: TglBitmapFormat;
- const aFunc: TglBitmapFunction; const aArgs: PtrInt);
+ const aFunc: TglBitmapFunction; const aArgs: Pointer);
begin
Create;
LoadFromFunc(aSize, aFunc, aFormat, aArgs);
function TglBitmap.LoadBMP(const aStream: TStream): Boolean;
//////////////////////////////////////////////////////////////////////////////////////////////////
- function ReadInfo(var aInfo: TBMPInfo; var aMask: TglBitmapColorRec): TglBitmapFormat;
+ function ReadInfo(out aInfo: TBMPInfo; out aMask: TglBitmapColorRec): TglBitmapFormat;
begin
result := tfEmpty;
- aStream.Read(aInfo, SizeOf(aInfo));
- FillChar(aMask, SizeOf(aMask), 0);
+ aStream.Read(aInfo{%H-}, SizeOf(aInfo));
+ FillChar(aMask{%H-}, SizeOf(aMask), 0);
//Read Compression
case aInfo.biCompression of
LineBuf, ImageData, TmpData: PByte;
SourceMD, DestMD: Pointer;
BmpFormat: TglBitmapFormat;
- ColorTable: TbmpColorTable;
//records
Mask: TglBitmapColorRec;
//////////////////////////////////////////////////////////////////////////////////////////////////
procedure SpecialFormatReadLine(aData: PByte; aLineBuf: PByte);
var
- i, j: Integer;
+ i: Integer;
Pixel: TglBitmapPixelData;
begin
aStream.Read(aLineBuf^, rbLineSize);
// Header
StartPos := aStream.Position;
- aStream.Read(Header, SizeOf(Header));
+ aStream.Read(Header{%H-}, SizeOf(Header));
if Header.bfType = BMP_MAGIC then begin
try try
dec(TmpData, wbLineSize)
else
inc(TmpData, wbLineSize);
- aStream.Read(PaddingBuff, Padding);
+ aStream.Read(PaddingBuff{%H-}, Padding);
end;
SetDataPointer(ImageData, BmpFormat, Info.biWidth, abs(Info.biHeight));
result := true;
pData, srcData, dstData, ConvertBuffer: pByte;
Pixel: TglBitmapPixelData;
- PixelFormat: TglBitmapPixelData;
- ImageSize, wbLineSize, rbLineSize, Padding, LineIdx, PixelIdx, i: Integer;
+ ImageSize, wbLineSize, rbLineSize, Padding, LineIdx, PixelIdx: Integer;
RedMask, GreenMask, BlueMask, AlphaMask: Cardinal;
PaddingBuff: Cardinal;
FormatDesc := TFormatDescriptor.Get(Format);
ImageSize := FormatDesc.GetSize(Dimension);
- FillChar(Header, SizeOf(Header), 0);
+ FillChar(Header{%H-}, SizeOf(Header), 0);
Header.bfType := BMP_MAGIC;
Header.bfSize := SizeOf(Header) + SizeOf(Info) + ImageSize;
Header.bfReserved1 := 0;
Header.bfReserved2 := 0;
Header.bfOffBits := SizeOf(Header) + SizeOf(Info);
- FillChar(Info, SizeOf(Info), 0);
+ FillChar(Info{%H-}, SizeOf(Info), 0);
Info.biSize := SizeOf(Info);
Info.biWidth := Width;
Info.biHeight := Height;
BytesRead := 0;
if (CacheSize - CachePos > 0) then begin
BytesRead := CacheSize - CachePos;
- Move(PByteArray(Cache)^[CachePos], Buffer, BytesRead);
+ Move(PByteArray(Cache)^[CachePos], Buffer{%H-}, BytesRead);
inc(CachePos, BytesRead);
end;
// reading header to test file and set cursor back to begin
StartPosition := aStream.Position;
- aStream.Read(Header, SizeOf(Header));
+ aStream.Read(Header{%H-}, SizeOf(Header));
// no colormapped files
if (Header.ColorMapType = TGA_NONE_COLOR_TABLE) and (Header.ImageType in [
raise EglBitmapUnsupportedFormatFormat.Create('SaveTGA - ' + UNSUPPORTED_FORMAT);
//prepare header
- FillChar(Header, SizeOf(Header), 0);
+ FillChar(Header{%H-}, SizeOf(Header), 0);
//set ImageType
if (Format in [tfLuminance8, tfLuminance6Alpha2, tfLuminance4Alpha4, tfAlpha8,
var
StreamPos: Int64;
- x, y, j, LineSize, RowSize, Magic: Cardinal;
+ x, y, LineSize, RowSize, Magic: Cardinal;
NewImage, TmpData, RowData, SrcData: PByte;
SourceMD, DestMD: Pointer;
Pixel: TglBitmapPixelData;
StreamPos := aStream.Position;
// Magic
- aStream.Read(Magic, sizeof(Magic));
+ aStream.Read(Magic{%H-}, sizeof(Magic));
if (Magic <> DDS_MAGIC) then begin
aStream.Position := StreamPos;
exit;
end;
//Header
- aStream.Read(Header, sizeof(Header));
+ aStream.Read(Header{%H-}, sizeof(Header));
if (Header.dwSize <> SizeOf(Header)) or
((Header.dwFlags and (DDSD_PIXELFORMAT or DDSD_CAPS or DDSD_WIDTH or DDSD_HEIGHT)) <>
(DDSD_PIXELFORMAT or DDSD_CAPS or DDSD_WIDTH or DDSD_HEIGHT)) then
FormatDesc := TFormatDescriptor.Get(Format);
// Generell
- FillChar(Header, SizeOf(Header), 0);
+ FillChar(Header{%H-}, SizeOf(Header), 0);
Header.dwSize := SizeOf(Header);
Header.dwFlags := DDSD_WIDTH or DDSD_HEIGHT or DDSD_CAPS or DDSD_PIXELFORMAT;
var
Temp: PByte;
TempWidth, TempHeight: Integer;
- TempType, TempIntFormat: Cardinal;
+ TempIntFormat: Cardinal;
IntFormat, f: TglBitmapFormat;
FormatDesc: TFormatDescriptor;
begin
glGetTexLevelParameteriv(Target, 0, GL_TEXTURE_INTERNAL_FORMAT, @TempIntFormat);
IntFormat := tfEmpty;
- for f := Low(TglBitmapFormat) to High(TglBitmapFormat) do
- if (TFormatDescriptor.Get(f).glInternalFormat = TempIntFormat) then begin
+ for f := Low(TglBitmapFormat) to High(TglBitmapFormat) do begin
+ FormatDesc := TFormatDescriptor.Get(f);
+ if (FormatDesc.glInternalFormat = TempIntFormat) then begin
IntFormat := FormatDesc.Format;
break;
end;
+ end;
// Getting data from OpenGL
FormatDesc := TFormatDescriptor.Get(IntFormat);
// Daten Sammeln
if aUseAlpha and TFormatDescriptor.Get(Format).HasAlpha then
- AddFunc(glBitmapToNormalMapPrepareAlphaFunc, false, PtrInt(@Rec))
+ AddFunc(glBitmapToNormalMapPrepareAlphaFunc, false, @Rec)
else
- AddFunc(glBitmapToNormalMapPrepareFunc, false, PtrInt(@Rec));
- AddFunc(glBitmapToNormalMapFunc, false, PtrInt(@Rec));
+ AddFunc(glBitmapToNormalMapPrepareFunc, false, @Rec);
+ AddFunc(glBitmapToNormalMapFunc, false, @Rec);
finally
SetLength(Rec.Heights, 0);
end;