CAST II Game Engine |
||||||||
![]() |
MAIN | FEATURES | SCREENSHOTS | FORUMS | MANUAL | DOWNLOADS | CONTACTS | |
(C) 2006-2007 George "Mirage" Bakhtadze. www.casteng.com
The source code may be used under either MPL 1.1 or LGPL 2.1 license. See included license.txt file
Unit contains basic OS-related classes
function ActivateWindow(hwnd: THandle): Boolean; |
function AdjustCursorVisibility(Show: Boolean): Integer; |
procedure ClientToScreen(Handle: THandle; out X, Y: Integer); |
procedure ClipCursor(Rect: TRect); |
procedure Delay(Microseconds: Integer); |
procedure Exec(const Command: string); |
function GetActiveWindow: THandle; |
function GetAsyncKeyState(Key: Integer): Integer; |
procedure GetClientRect(Handle: THandle; out Rect: TRect); |
function GetClipCursor: TRect; |
function GetCurrentMs: Cardinal; |
function GetOSErrorStr(ErrorID: Integer): string; |
function GetPerformanceCounter: Int64; |
function GetSysFolder(SysFolder: TSysFolder): string; |
function GetTextFromClipboard: string; |
procedure GetWindowRect(Handle: THandle; out Rect: TRect); |
procedure HideCursor; |
procedure HideWindow(Handle: THandle); |
function IsWindowVisible(Handle: THandle): Boolean; |
procedure MinimizeWindow(Handle: THandle); |
procedure ObtainCursorPos(var X, Y: Integer); |
procedure ObtainKeyboardState(var State: TKbdState); |
procedure ObtainPerformanceFrequency; |
procedure OpenURL(const URL: string); |
procedure OpenWith(ParentHandle: Cardinal; const FileName: string); |
procedure ScreenToClient(Handle: THandle; out X, Y: Integer); |
procedure SetCursorPos(X, Y: Integer); |
procedure SetCursorVisibility(Counter: Integer); |
procedure SetWindowCaption(Handle: THandle; const ACaption: string); |
procedure ShowCursor; |
procedure ShowWindow(Handle: THandle); |
procedure Sleep(Milliseconds: Integer); |
function ThreadSafeDecrement(var Addend: Integer): Integer; stdcall; external kernel name 'InterlockedDecrement'; |
function ThreadSafeIncrement(var Addend: Integer): Integer; stdcall; external kernel name 'InterlockedIncrement'; |
function WMToMessage(MsgID: Cardinal; wParam, lParam: Integer): TMessage; overload; |
function WMToMessage(const Msg: Messages.TMessage): TMessage; overload; |
function ActivateWindow(hwnd: THandle): Boolean; |
function AdjustCursorVisibility(Show: Boolean): Integer; |
procedure ClientToScreen(Handle: THandle; out X, Y: Integer); |
procedure ClipCursor(Rect: TRect); |
procedure Delay(Microseconds: Integer); |
Not accurate (~10ms)
procedure Exec(const Command: string); |
Accurate
function GetActiveWindow: THandle; |
function GetAsyncKeyState(Key: Integer): Integer; |
procedure GetClientRect(Handle: THandle; out Rect: TRect); |
function GetClipCursor: TRect; |
function GetCurrentMs: Cardinal; |
function GetOSErrorStr(ErrorID: Integer): string; |
function GetPerformanceCounter: Int64; |
function GetSysFolder(SysFolder: TSysFolder): string; |
function GetTextFromClipboard: string; |
procedure GetWindowRect(Handle: THandle; out Rect: TRect); |
procedure HideCursor; |
procedure HideWindow(Handle: THandle); |
function IsWindowVisible(Handle: THandle): Boolean; |
procedure MinimizeWindow(Handle: THandle); |
procedure ObtainCursorPos(var X, Y: Integer); |
OS dependent
procedure ObtainKeyboardState(var State: TKbdState); |
procedure ObtainPerformanceFrequency; |
procedure OpenURL(const URL: string); |
procedure OpenWith(ParentHandle: Cardinal; const FileName: string); |
procedure ScreenToClient(Handle: THandle; out X, Y: Integer); |
procedure SetCursorPos(X, Y: Integer); |
procedure SetCursorVisibility(Counter: Integer); |
OS independent
procedure SetWindowCaption(Handle: THandle; const ACaption: string); |
procedure ShowCursor; |
procedure ShowWindow(Handle: THandle); |
procedure Sleep(Milliseconds: Integer); |
function ThreadSafeDecrement(var Addend: Integer): Integer; stdcall; external kernel name 'InterlockedDecrement'; |
function ThreadSafeIncrement(var Addend: Integer): Integer; stdcall; external kernel name 'InterlockedIncrement'; |
function WMToMessage(MsgID: Cardinal; wParam, lParam: Integer): TMessage; overload; |
function WMToMessage(const Msg: Messages.TMessage): TMessage; overload; |
THandle = Cardinal; |
TKbdState = array[0..255] of Byte; |
TRect = Windows.TRect; |
THandle = Cardinal; |
TKbdState = array[0..255] of Byte; |
TRect = Windows.TRect; |
TSysFolder | ||
| System path | ||
sfRecycled | ||
sfDesktop | ||
sfStartMenu | ||
sfPrograms | ||
sfStartup | ||
sfPersonal | ||
sfTemplates | ||
sfRecent | ||
sfSendTo | ||
sfNetHood | ||
sfAppData | ||
sfWinRoot | ||
sfWinSys | ||
kernel = 'kernel32.dll'; |
kernel = 'kernel32.dll'; |
ToDo: Move to advanced unit
OneOverPerformanceFrequency: Single; |
PerformanceFrequency: Int64; |
OneOverPerformanceFrequency: Single; |
PerformanceFrequency: Int64; |
|
Last modified: Jan 6, 2010 |