hedgewars/hwengine.pas
changeset 12657 2065819170ce
parent 12621 d972b31f8881
child 12711 20dbb3a03e61
equal deleted inserted replaced
12656:161c10db4f27 12657:2065819170ce
    34      , SysUtils, uTypes, uVariables, uCommands, uUtils, uCaptions, uDebug, uCommandHandlers, uLandPainted
    34      , SysUtils, uTypes, uVariables, uCommands, uUtils, uCaptions, uDebug, uCommandHandlers, uLandPainted
    35      , uPhysFSLayer, uCursor, uRandom, ArgParsers, uVisualGearsHandlers, uTextures, uRender
    35      , uPhysFSLayer, uCursor, uRandom, ArgParsers, uVisualGearsHandlers, uTextures, uRender
    36      {$IFDEF USE_VIDEO_RECORDING}, uVideoRec {$ENDIF}
    36      {$IFDEF USE_VIDEO_RECORDING}, uVideoRec {$ENDIF}
    37      {$IFDEF USE_TOUCH_INTERFACE}, uTouch {$ENDIF}
    37      {$IFDEF USE_TOUCH_INTERFACE}, uTouch {$ENDIF}
    38      {$IFDEF ANDROID}, GLUnit{$ENDIF}
    38      {$IFDEF ANDROID}, GLUnit{$ENDIF}
       
    39      {$IFDEF WIN32}, dynlibs{$ENDIF}
    39      ;
    40      ;
    40 
    41 
    41 {$IFDEF HWLIBRARY}
    42 {$IFDEF HWLIBRARY}
    42 function RunEngine(argc: LongInt; argv: PPChar): LongInt; cdecl; export;
    43 function RunEngine(argc: LongInt; argv: PPChar): LongInt; cdecl; export;
    43 
    44 
    48 implementation
    49 implementation
    49 {$ELSE}
    50 {$ELSE}
    50 procedure preInitEverything(); forward;
    51 procedure preInitEverything(); forward;
    51 procedure initEverything(complete:boolean); forward;
    52 procedure initEverything(complete:boolean); forward;
    52 procedure freeEverything(complete:boolean); forward;
    53 procedure freeEverything(complete:boolean); forward;
       
    54 {$ENDIF}
       
    55 
       
    56 {$IFDEF WIN32}
       
    57 type TSetProcessDpiAwareness = function(value: Integer): Integer; stdcall;
       
    58 var SetProcessDpiAwareness: TSetProcessDpiAwareness;
       
    59 var ShcoreLibHandle: TLibHandle;
    53 {$ENDIF}
    60 {$ENDIF}
    54 
    61 
    55 ///////////////////////////////////////////////////////////////////////////////
    62 ///////////////////////////////////////////////////////////////////////////////
    56 function DoTimer(Lag: LongInt): boolean;
    63 function DoTimer(Lag: LongInt): boolean;
    57 var s: shortstring;
    64 var s: shortstring;
   585     operatingsystem_parameter_argv:= argv;
   592     operatingsystem_parameter_argv:= argv;
   586 {$ELSE}
   593 {$ELSE}
   587 begin
   594 begin
   588 {$ENDIF}
   595 {$ENDIF}
   589 
   596 
       
   597 {$IFDEF WIN32}
       
   598     ShcoreLibHandle := LoadLibrary('Shcore.dll');
       
   599     if (ShcoreLibHandle <> 0) then
       
   600     begin
       
   601         SetProcessDpiAwareness :=
       
   602             TSetProcessDpiAwareness(GetProcedureAddress(ShcoreLibHandle, 'SetProcessDpiAwareness'));
       
   603         if (SetProcessDpiAwareness <> nil) then
       
   604             SetProcessDpiAwareness(1);
       
   605     end;
       
   606 {$ENDIF}
       
   607 
   590 ///////////////////////////////////////////////////////////////////////////////
   608 ///////////////////////////////////////////////////////////////////////////////
   591 /////////////////////////////////// m a i n ///////////////////////////////////
   609 /////////////////////////////////// m a i n ///////////////////////////////////
   592 ///////////////////////////////////////////////////////////////////////////////
   610 ///////////////////////////////////////////////////////////////////////////////
   593 {$IFDEF PAS2C}
   611 {$IFDEF PAS2C}
   594     // workaround for pascal's ParamStr and ParamCount
   612     // workaround for pascal's ParamStr and ParamCount