Results 1 to 8 of 8

Thread: Problems with Delphi 7 & DelphiX

  1. #1

    Problems with Delphi 7 & DelphiX

    when i want to use DelphiX component DXInput, and try to compile project, i get an error in DXInput.pas file, in lines 33, 35, 36... the error is: "Undeclared indentifier: TDIEffect", "Undeclared identifier: TDIEnvelope"....
    http://www.programuotojas.com

  2. #2

    Problems with Delphi 7 & DelphiX

    Come on, can someone help me?
    http://www.programuotojas.com

  3. #3

    Problems with Delphi 7 & DelphiX

    Would love to help you, however I don't have Delphi 7... I'm not sure but I vaguely remember someone making a DelphiX version for D7.
    Do it by the book, but be the author!
    <br />
    <br />Visit the Lion Productions website at:
    <br />http://lionprod.f2o.org

  4. #4

    Problems with Delphi 7 & DelphiX

    well i solve this problem by instaling delphi 5 , but here is another i tried to do simple program displaying two images and FPS. For showing FPS i use DXTimer, but then i see nothing but black screen , here is my code.
    Code:
    procedure TForm1.GameLoop&#40;sender&#58; TObject; var done&#58; boolean&#41;;
    begin
    done &#58;= false;
    
    DXDraw1.Surface.Canvas.Brush.Color &#58;= clWhite;
    DXDraw1.Surface.Canvas.TextOut&#40;10, 10, 'FPS&#58; '+ IntToStr&#40;DXTimer1.FrameRate&#41;&#41;;
    
    DrawGameGraphics&#40;0, 0, GameGraphics&#91;2&#93;, False&#41;;
    DrawGameGraphics&#40;10, 15, GameGraphics&#91;1&#93;, true&#41;;
    
    DXDraw1.Flip;
    end;
    
    procedure TForm1.FormCreate&#40;Sender&#58; TObject&#41;;
    begin
    application.OnIdle &#58;= Form1.GameLoop;
    VideoModeX &#58;= GetSystemMetrics&#40;SM_CXSCREEN&#41;;
    VideoModeY &#58;= GetSystemMetrics&#40;SM_CYSCREEN&#41;;
    
    ShowCursor&#40;False&#41;;
    
    ChangeResolution&#40;1024, 768, 16&#41;;
    
    form1.BorderStyle &#58;= bsNone;
    form1.WindowState &#58;= wsMaximized;
    
    DXDraw1.Initialize;
    LoadGameGraphics;
    
    end;
    
    procedure TForm1.FormKeyPress&#40;Sender&#58; TObject; var Key&#58; Char&#41;;
    begin
    if key=#27 then
    begin
      SendMessage&#40;Handle, WM_CLOSE, 0, 0&#41;;
    end;
    end;
    
    procedure TForm1.LoadGameGraphics;
    var i&#58; integer;
    begin
    for i &#58;= 1 to 100 do
      GameGraphics&#91;i&#93; &#58;= TDirectDrawSurface.Create&#40;DXDraw1.DDraw&#41;;
    
    GameGraphics&#91;1&#93;.LoadFromFile&#40;ExtractFilePath&#40;ParamStr&#40;0&#41;&#41;+'forsas.bmp'&#41;;
    GameGraphics&#91;1&#93;.TransparentColor &#58;= clWhite;
    
    GameGraphics&#91;2&#93;.LoadFromFile&#40;ExtractFilePath&#40;ParamStr&#40;0&#41;&#41;+'map.bmp'&#41;;
    
    end;
    
    procedure TForm1.DrawGameGraphics&#40;x, y&#58; integer; DDS&#58; TDirectDrawSurface;
      transparent&#58; boolean&#41;;
    var
      SourceRect&#58; TRect;
    begin
      SourceRect &#58;= rect&#40;0, 0, DDS.Width, DDS.Height &#41;;
      DXDraw1.Surface.Draw&#40;x, y, SourceRect, DDS, Transparent&#41;;
    end;
    
    
    procedure TForm1.ChangeResolution&#40;ModeX, ModeY, Bits&#58; integer&#41;;
    var
      DeviceMode&#58; TDevMode;
    begin
      with DeviceMode do
      begin
        dmSize &#58;= SizeOf&#40;DeviceMode&#41;;
        dmBitsPerPel &#58;= Bits;
        dmPelsWidth &#58;= ModeX;
        dmPelsHeight &#58;= ModeY;
        dmFields &#58;= DM_BITSPERPEL or DM_PELSWIDTH or DM_PELSHEIGHT;
        ChangeDisplaySettings&#40;DeviceMode, CDS_FULLSCREEN&#41;;
      end;
    end;
    
    end.
    i think i cann't use Application.OnIdle := GameLoop with timer, or maybe can? well what you think? Where is my problem
    http://www.programuotojas.com

  5. #5

    Problems with Delphi 7 & DelphiX

    As far as I know DXTimer uses the onIdle event and probably reassigns it from your procedure to its own, just stick everything from you're GameLoop to timers OnTimer event and everything should be fine.

  6. #6

    Problems with Delphi 7 & DelphiX

    nop, the same
    http://www.programuotojas.com

  7. #7

    Problems with Delphi 7 & DelphiX

    DelphiX is nolonger updated I'm afraid, however, there is an unDelphiX version available over at Turbo which can be used with D7.

    And to answer the other problem, you need to add DXDraw1.Surface.Canvas.release directly after DXDraw1.Surface.Canvas.TextOut(..)

  8. #8

    Problems with Delphi 7 & DelphiX

    je, now everything is ok
    http://www.programuotojas.com

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •