Ok making progres... running in GDI mode I have a form with Application.OnIdle set to the below method:
Code:
procedure TGameWindow.Idle(Sender: TObject; var Done: Boolean);
begin
CurrentTime := QueryTimer;
if fGame.CheckTick(CurrentTime, LastTime) then // check elapsed time (>= 60 ms)
begin
fGamePainter.HandleInput(fInput); // if vk_left in keyboard then scroll left
fGame.Tick;
fGamePainter.Update;
LastTime := CurrentTime;
end;
Done := False;
end;
Now the HandleInput (which stores keyboard state etc) is done in sync with the game ticks.
Now if I - for example - want to speed up scrolling, is the best way to do this to have the GamePainter have its own timing and put the HandleInput at the first line of the method?
Or else: what is a good central place to handle this? Tips are welcome
BTW: Fullscreen GDI StretchDIBits gives me about 3000 FPS. Is this method hardware accelerated??
Bookmarks