Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Cross-Platform-Entwicklung (https://www.delphipraxis.net/91-cross-platform-entwicklung/)
-   -   Delphi Cross-Platform Game Loop (https://www.delphipraxis.net/189855-cross-platform-game-loop.html)

Mavarik 31. Jul 2016 23:55

AW: Cross-Platform Game Loop
 
Gameloop.... Ganz einfach...

UI Thread...

Delphi-Quellcode:
TTask.Run(Procedure
begin
  While GameRunning do
    begin
      Starte Stopuhr...
      Warte bis alle Threads ein Frame erzeugt haben
      Stoppe die StopUhr
      SingnaleThreadNextFrame;
      if StopUhr < 16 then
        Sleep(16-Stopuhr)
      Syncronize(DisplayFrame);
    end
end;
Mavarik


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:00 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz