aboutsummaryrefslogtreecommitdiffstats
path: root/src/macosx/Windows.pas
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/macosx/Windows.pas168
1 files changed, 85 insertions, 83 deletions
diff --git a/src/macosx/Windows.pas b/src/macosx/Windows.pas
index cee75591..26761af5 100644
--- a/src/macosx/Windows.pas
+++ b/src/macosx/Windows.pas
@@ -4,7 +4,8 @@ unit Windows;
interface
-uses Types;
+uses
+ Types;
const
opengl32 = 'OpenGL';
@@ -12,31 +13,31 @@ const
type
- DWORD = Types.DWORD;
- {$EXTERNALSYM DWORD}
- BOOL = LongBool;
- {$EXTERNALSYM BOOL}
- PBOOL = ^BOOL;
- {$EXTERNALSYM PBOOL}
- PByte = Types.PByte;
- PINT = ^Integer;
- {$EXTERNALSYM PINT}
- PSingle = ^Single;
- PWORD = ^Word;
- {$EXTERNALSYM PWORD}
- PDWORD = ^DWORD;
- {$EXTERNALSYM PDWORD}
- LPDWORD = PDWORD;
- {$EXTERNALSYM LPDWORD}
- HDC = type LongWord;
- {$EXTERNALSYM HDC}
- HGLRC = type LongWord;
- {$EXTERNALSYM HGLRC}
- TLargeInteger = Int64;
- HFONT = type LongWord;
- {$EXTERNALSYM HFONT}
- HWND = type LongWord;
- {$EXTERNALSYM HWND}
+ DWORD = Types.DWORD;
+ {$EXTERNALSYM DWORD}
+ BOOL = LongBool;
+ {$EXTERNALSYM BOOL}
+ PBOOL = ^BOOL;
+ {$EXTERNALSYM PBOOL}
+ PByte = Types.PByte;
+ PINT = ^Integer;
+ {$EXTERNALSYM PINT}
+ PSingle = ^Single;
+ PWORD = ^Word;
+ {$EXTERNALSYM PWORD}
+ PDWORD = ^DWORD;
+ {$EXTERNALSYM PDWORD}
+ LPDWORD = PDWORD;
+ {$EXTERNALSYM LPDWORD}
+ HDC = type LongWord;
+ {$EXTERNALSYM HDC}
+ HGLRC = type LongWord;
+ {$EXTERNALSYM HGLRC}
+ TLargeInteger = Int64;
+ HFONT = type LongWord;
+ {$EXTERNALSYM HFONT}
+ HWND = type LongWord;
+ {$EXTERNALSYM HWND}
PPaletteEntry = ^TPaletteEntry;
{$EXTERNALSYM tagPALETTEENTRY}
@@ -50,46 +51,46 @@ type
{$EXTERNALSYM PALETTEENTRY}
PALETTEENTRY = tagPALETTEENTRY;
- PRGBQuad = ^TRGBQuad;
- {$EXTERNALSYM tagRGBQUAD}
- tagRGBQUAD = packed record
- rgbBlue: Byte;
- rgbGreen: Byte;
- rgbRed: Byte;
- rgbReserved: Byte;
- end;
- TRGBQuad = tagRGBQUAD;
- {$EXTERNALSYM RGBQUAD}
- RGBQUAD = tagRGBQUAD;
-
- PBitmapInfoHeader = ^TBitmapInfoHeader;
- {$EXTERNALSYM tagBITMAPINFOHEADER}
- tagBITMAPINFOHEADER = packed record
- biSize: DWORD;
- biWidth: Longint;
- biHeight: Longint;
- biPlanes: Word;
- biBitCount: Word;
- biCompression: DWORD;
- biSizeImage: DWORD;
- biXPelsPerMeter: Longint;
- biYPelsPerMeter: Longint;
- biClrUsed: DWORD;
- biClrImportant: DWORD;
- end;
- TBitmapInfoHeader = tagBITMAPINFOHEADER;
- {$EXTERNALSYM BITMAPINFOHEADER}
- BITMAPINFOHEADER = tagBITMAPINFOHEADER;
-
- PBitmapInfo = ^TBitmapInfo;
- {$EXTERNALSYM tagBITMAPINFO}
- tagBITMAPINFO = packed record
- bmiHeader: TBitmapInfoHeader;
- bmiColors: array[0..0] of TRGBQuad;
- end;
- TBitmapInfo = tagBITMAPINFO;
- {$EXTERNALSYM BITMAPINFO}
- BITMAPINFO = tagBITMAPINFO;
+ PRGBQuad = ^TRGBQuad;
+ {$EXTERNALSYM tagRGBQUAD}
+ tagRGBQUAD = packed record
+ rgbBlue: Byte;
+ rgbGreen: Byte;
+ rgbRed: Byte;
+ rgbReserved: Byte;
+ end;
+ TRGBQuad = tagRGBQUAD;
+ {$EXTERNALSYM RGBQUAD}
+ RGBQUAD = tagRGBQUAD;
+
+ PBitmapInfoHeader = ^TBitmapInfoHeader;
+ {$EXTERNALSYM tagBITMAPINFOHEADER}
+ tagBITMAPINFOHEADER = packed record
+ biSize: DWORD;
+ biWidth: Longint;
+ biHeight: Longint;
+ biPlanes: Word;
+ biBitCount: Word;
+ biCompression: DWORD;
+ biSizeImage: DWORD;
+ biXPelsPerMeter: Longint;
+ biYPelsPerMeter: Longint;
+ biClrUsed: DWORD;
+ biClrImportant: DWORD;
+ end;
+ TBitmapInfoHeader = tagBITMAPINFOHEADER;
+ {$EXTERNALSYM BITMAPINFOHEADER}
+ BITMAPINFOHEADER = tagBITMAPINFOHEADER;
+
+ PBitmapInfo = ^TBitmapInfo;
+ {$EXTERNALSYM tagBITMAPINFO}
+ tagBITMAPINFO = packed record
+ bmiHeader: TBitmapInfoHeader;
+ bmiColors: array[0..0] of TRGBQuad;
+ end;
+ TBitmapInfo = tagBITMAPINFO;
+ {$EXTERNALSYM BITMAPINFO}
+ BITMAPINFO = tagBITMAPINFO;
PBitmapFileHeader = ^TBitmapFileHeader;
{$EXTERNALSYM tagBITMAPFILEHEADER}
@@ -105,24 +106,25 @@ type
BITMAPFILEHEADER = tagBITMAPFILEHEADER;
- function MakeLong(a, b: Word): Longint;
- procedure ZeroMemory(Destination: Pointer; Length: DWORD);
- function QueryPerformanceFrequency(var lpFrequency: TLargeInteger): BOOL;
- function QueryPerformanceCounter(var lpPerformanceCount: TLargeInteger): BOOL;
- function GetTickCount : Cardinal;
- Procedure ShowMessage(msg : string);
- procedure CopyMemory(Destination: Pointer; Source: Pointer; Length: DWORD);
+function MakeLong(a, b: Word): Longint;
+procedure ZeroMemory(Destination: Pointer; Length: DWORD);
+function QueryPerformanceFrequency(var lpFrequency: TLargeInteger): BOOL;
+function QueryPerformanceCounter(var lpPerformanceCount: TLargeInteger): BOOL;
+function GetTickCount : Cardinal;
+Procedure ShowMessage(msg : String);
+procedure CopyMemory(Destination: Pointer; Source: Pointer; Length: DWORD);
implementation
-uses SDL;
+uses
+ SDL;
procedure CopyMemory(Destination: Pointer; Source: Pointer; Length: DWORD);
begin
Move(Source^, Destination^, Length);
end;
-Procedure ShowMessage(msg : string);
+procedure ShowMessage(msg : String);
begin
// to be implemented
end;
@@ -134,34 +136,34 @@ end;
procedure ZeroMemory(Destination: Pointer; Length: DWORD);
begin
- FillChar( Destination^, Length, 0);
+ FillChar( Destination^, Length, 0);
end;
function QueryPerformanceFrequency(var lpFrequency: TLargeInteger): BOOL;
begin
{$IFDEF MSWINDOWS}
- Result := Windows.QueryPerformanceFrequency(lpFrequency);
+ Result := Windows.QueryPerformanceFrequency(lpFrequency);
{$ENDIF}
{$IFDEF MACOS}
- Result := true;
- lpFrequency := 1000;
+ Result := true;
+ lpFrequency := 1000;
{$ENDIF}
end;
function QueryPerformanceCounter(var lpPerformanceCount: TLargeInteger): BOOL;
begin
{$IFDEF MSWINDOWS}
- Result := Windows.QueryPerformanceCounter(lpPerformanceCount);
+ Result := Windows.QueryPerformanceCounter(lpPerformanceCount);
{$ENDIF}
{$IFDEF MACOS}
- Result := true;
- lpPerformanceCount := SDL_GetTicks;
+ Result := true;
+ lpPerformanceCount := SDL_GetTicks;
{$ENDIF}
end;
function GetTickCount : Cardinal;
begin
- Result := SDL_GetTicks;
+ Result := SDL_GetTicks;
end;
end.