hi, thannkssssssssssssssss, i have changed to this and it works perfect, doing as you said thanks very much DDDD
for anyone else it may help to see, i have changed to >
private's >
[pascal]
F_Freq : Int64;
F_DeltaTime : Single;
F_LastTime : Single;
F_ThisTime : Single;
[/pascal]
[pascal]
procedure TFury.ProcessKBInput;
const
iSpeed = 60;
var
buffer: array[0..255] of byte;
hr: HResult;
d: Double;
begin
hr := F_DIDevice.GetDeviceState(SizeOf(buffer), @buffer);
if FAILED(hr) then begin
F_DIDevice.Acquire;
exit;
end;
d := iSpeed * F_DeltaTime;
if (buffer[DIK_A] and $80) <> 0 then
F_MapBuilder.Player.PosX := F_MapBuilder.Player.PosX + d
else if (buffer[DIK_D] and $80) <> 0 then
F_MapBuilder.Player.PosX := F_MapBuilder.Player.PosX - d;
if (buffer[DIK_W] and $80) <> 0 then
F_MapBuilder.Player.PosY := F_MapBuilder.Player.PosY + d
else if (buffer[DIK_S] and $80) <> 0 then
F_MapBuilder.Player.PosY := F_MapBuilder.Player.PosY - d;
end;
procedure TFury.Render;
var
iTime: Int64;
begin
if F_DXDevice = nil then exit;
// clear the backbuffer to black
F_DXDevice.Clear(0, nil, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,0), 1.0, 0);
// Rendering of scene objects can happen here
F_DXDevice.BeginScene;
begin
//get user input.
ProcessKBInput;
F_MapBuilder.DrawBricks;
end;
F_DXDevice.EndScene;
// Present the backbuffer contents to the display
F_DXDevice.Present(nil, nil, 0, nil);
QueryPerformanceCounter(iTime);
F_ThisTime := (iTime / F_Freq);
F_DeltaTime := F_ThisTime - F_LastTime;
F_LastTime := F_ThisTime;
end;
[/pascal]
thanks again
-MM
Bookmarks