Core 2 Duo x6700 2.6MHz sorry it was bad shortcut
Yes latest JEDI work fine
Now i try fix problem with mouse delta for freelook, because if VSync is ON the is speed OK, but if is OFF is slow. I think that i must calc Delta Tick Count for correct calc on different FPS. I any tutorial about TickCount and movement?
Currently i have my timer helper class writed so:
Code:unit F3D_Timer; {******************************************************************************} { F3D_TIMER: {******************************************************************************} interface uses gl,sdl; type TProcedureEvent = procedure of object; { The type of event that is called by the timer. } Type TF3D_TimerEvent = procedure(Sender: TObject; FrameTime: Single) of object; Type TF3D_Timer = class private m_lastTick : integer; m_fpsDuration : single; m_fpsFrames : integer; m_fps : integer; ElapsedTime:single; public constructor Create(); destructor Destroy; function GetElapsedTime: Single; function GetTickCount: Integer; function GetFPS: Integer; procedure Update(); end; implementation uses F3Dlib; {******************************************************************************} { F3D_TIMER: {******************************************************************************} constructor TF3D_Timer.Create(); begin inherited Create; m_lastTick := 0; end; {******************************************************************************} { F3D_TIMER: {******************************************************************************} destructor TF3D_Timer.Destroy; begin inherited destroy; end; {******************************************************************************} { F3D_TIMER: {******************************************************************************} function TF3D_Timer.GetFPS: Integer; begin result:=self.m_fps; end; {******************************************************************************} { F3D_TIMER: {******************************************************************************} function TF3D_Timer.GetTickCount: Integer; begin result:=m_lastTick; end; {******************************************************************************} { F3D_TIMER: {******************************************************************************} function TF3D_Timer.GetElapsedTime: Single; begin result:=ElapsedTime*100; end; {******************************************************************************} { F3D_TIMER: {******************************************************************************} procedure TF3D_Timer.Update; var tick : integer; begin // get the current tick value tick := SDL_GetTicks; // calculate the amount of elapsed seconds ElapsedTime := ( tick - m_lastTick ) / 1000.0; if ElapsedTime = 0 then exit; // adjust fps counter m_fpsDuration := m_fpsDuration + ElapsedTime; if ( m_fpsDuration >= 1.0 ) then begin m_fps := round( m_fpsFrames / m_fpsDuration ); m_fpsDuration := 0.0; m_fpsFrames := 0; end; m_lastTick := tick; inc( m_fpsFrames ); glFlush(); end; end.
Bookmarks