X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fflexui%2Fsdlcarcass.pas;h=20363e688fd9345414248373f62f4e806974f005;hb=b60024b9a25fbf72f8e83cfe6b023d0cc4f933c5;hp=611c4f8f721129821ae5362a1d04e4989a3143d5;hpb=08b53e05935bfc8f5c8e6c18754fd3768917aa77;p=d2df-sdl.git diff --git a/src/flexui/sdlcarcass.pas b/src/flexui/sdlcarcass.pas index 611c4f8..20363e6 100644 --- a/src/flexui/sdlcarcass.pas +++ b/src/flexui/sdlcarcass.pas @@ -1,9 +1,8 @@ -(* Copyright (C) DooM 2D:Forever Developers +(* Copyright (C) Doom 2D: Forever Developers * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * the Free Software Foundation, version 3 of the License ONLY. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -16,6 +15,10 @@ {$INCLUDE ../shared/a_modes.inc} unit sdlcarcass; + {$IFNDEF USE_SDL2} + {$FATAL SDL2 required for flexui sdlcarcass} + {$ENDIF} + interface uses @@ -69,11 +72,12 @@ implementation uses SysUtils, Classes, - GL, GLExt, - {$IF DEFINED(LINUX)} + {$IF DEFINED(LINUX) OR DEFINED(ANDROID)} unixtype, linux {$ELSEIF DEFINED(WINDOWS)} Windows + {$ELSEIF DEFINED(HAIKU) OR DEFINED(UNIX)} + unixtype {$ELSE} {$WARNING You suck!} {$ENDIF} @@ -111,7 +115,7 @@ begin if not mHasHPTimer then raise Exception.Create('profiler error: hires timer is not available'); mFrequency := 1; // just a flag if (r.tv_nsec <> 0) then mFrequency := 1000000000000000000 div r.tv_nsec; -{$ELSE} +{$ELSEIF DEFINED(WINDOWS)} mHasHPTimer := QueryPerformanceFrequency(r); if not mHasHPTimer then raise Exception.Create('profiler error: hires timer is not available'); mFrequency := r; @@ -128,7 +132,7 @@ begin {$IF DEFINED(LINUX)} clock_gettime(CLOCK_MONOTONIC, @r); result := UInt64(r.tv_sec)*1000000+UInt64(r.tv_nsec) div 1000; // microseconds - {$ELSE} + {$ELSEIF DEFINED(WINDOWS)} QueryPerformanceCounter(r); result := UInt64(r)*1000000 div mFrequency; {$ENDIF}