Please yes, I like when you prepare demo for illustrate overwritten problem.
I can try correct it.
I saw in your code, that you no use attribute for hardware acceleration in DelphiX (BeginScene, EndScene). Please use prototype demo (you use threaded timer instead DXTimer), there is barebone for application. I will be prepare better prototype, because many extensions are missing (like DXInput).
Code:
procedure TForm1.DXTimerTimer(Sender: TObject; LagCount: Integer);
begin
if not DXDraw.CanDraw then Exit;
DXDraw.BeginScene;
try
{clear surface with predefined windows color}
DXDraw.Surface.Fill(DXDraw.Surface.ColorMatch(clBlack));
//----------------------------------------------------------------------------
{All drawing here like}
//DXImageList.Items[0].Draw(DXDraw.surface,0,0,0);
//----------------------------------------------------------------------------
finally
DXDraw.EndScene;
end;
{ Draw FrameRate }
with DXDraw.Surface.Canvas do
try
Brush.Style := bsClear;
Font.Color := clWhite;
Font.Size := 10;
Textout(3, 3, 'FPS: ' + IntToStr(DXTimer.FrameRate));
if doHardware in DXDraw.NowOptions then begin
Textout(3, 14, 'Device: Hardware');
Textout(3, DXDraw.Height-16-14, 'Change device mode to software press SPACE.')
end
else begin
Textout(3, 14, 'Device: Software');
Textout(3, DXDraw.Height-16-14, 'Change device mode to hardware press SPACE.')
end;
if doFullScreen in DXDraw.NowOptions then
TextOut(3,DXDraw.Height-16,'For windowed mode press ALT+Enter.')
else
TextOut(3,DXDraw.Height-16,'For fullscreen press ALT+Enter.');
finally
Release; { Indispensability }
end;
DXDraw.Flip;
end;
Thank you for your cooperative work.
Regards
Bookmarks