Results 1 to 9 of 9

Thread: Graphics in Turbo delphi

  1. #1

    Graphics in Turbo delphi

    does anyone know how i can get delphiX in turbodelphi? I Don't really know how to work with packages w/o 3rd party packages available. I heard it was possible tho

    any help would be great, thanks
    -chris

  2. #2
    PGD Community Manager AthenaOfDelphi's Avatar
    Join Date
    Dec 2004
    Location
    South Wales, UK
    Posts
    1,245
    Blog Entries
    2

    Graphics in Turbo delphi

    I can't help you I'm afraid hon, but maybe if the thread is bumped someone who can may see it.
    :: AthenaOfDelphi :: My Blog :: My Software ::

  3. #3
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    Graphics in Turbo delphi

    Hadn't seen this

    The Turbo products are designed to stop people adding in components - however there are workarounds if you search the web enough.

    S2DL is designed not to required VCL components. This makes the programs smaller and makes it a perfect set of libraries to use with the Turbo Products.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  4. #4
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Graphics in Turbo delphi

    you could try to create to components runtime. Worked form me for some other components...
    NecroSOFT - End of line -

  5. #5

    Graphics in Turbo delphi

    you could try to create to components runtime. Worked form me for some other components...
    Yep, that's how I'm doing it with any third-party components. I haven't tried it with DelphiX but it works with no problems at all with Asphyre 3.
    However there where an article that described how to add the components to the palette. I've done it with the spin-edit. I believe I found the link on this site. I'll try and see if I can find it.
    Imagine I've written something clever here inspiring you to make something awesome. If that happens give me credits

  6. #6

    Graphics in Turbo delphi

    Hey,

    I investigated this a while ago, and it's fairly easy to get many of the component based graphics libraries to work within Turbo Delphi. Since you're provided with the full source code, you can simply link to the library (Tools > Options > Delphi Options > Library Win32). Add all unDelphiX source paths under 'Library Path'.

    The catch is that you can't just drag and drop the unDelphiX components onto the form anymore, and would need to create them dynamically. Here's some code from one of my projects where I create the DXDraw dynamically:

    Code:
    Uses
        DirectX, DXClass, DXDraws;
    
    // CREATE
    
      // Create the DXDraw Component
       FDXDraw := TDXDraw.Create(TDXForm(oOwner));
       FDXDraw.Parent := TDXForm(FOwner);
    
       // Link DXDraw Keyboard and Mouse Input to Parent Form
       FDXDraw.OnKeyDown := TDXForm(FOwner).OnKeyDown;
       FDXDraw.OnKeyUp := TDXForm(FOwner).OnKeyUp;
       FDXDraw.OnMouseDown := TDXForm(FOwner).OnMouseDown;
       FDXDraw.OnMouseUp := TDXForm(FOwner).OnMouseUp;
       FDXDraw.OnMouseMove := TDXForm(FOwner).OnMouseMove;
    
      // Center the Form and set it's size
      TDXForm(FOwner).Left := (Screen.Width - GD_SCREEN_RES_X) DIV 2;
      TDXForm(FOwner).Top := (Screen.Height - GD_SCREEN_RES_Y) DIV 2;
      TDXForm(FOwner).ClientWidth := GD_SCREEN_RES_X;
      TDXForm(FOwner).ClientHeight := GD_SCREEN_RES_Y;
    
      // Set up the DXDraw Display
      FDXDraw.Left := 0;
      FDXDraw.Top := 0;
      FDXDraw.Width := GD_SCREEN_RES_X;
      FDXDraw.Height := GD_SCREEN_RES_Y;
      FDXDraw.Display.Width := GD_SCREEN_RES_X;
      FDXDraw.Display.Height := GD_SCREEN_RES_Y;
      FDXDraw.Display.BitCount := GD_COLOR_DEPTH;
      FDXDraw.Display.FixedBitCount := True;
      FDXDraw.Cursor := crNone;
      FDXDraw.SendToBack;
    
      // Set the render options
      If not (doDirectX7Mode in FDXDraw.Options) Then FDXDraw.Options := FDXDraw.Options + [doDirectX7Mode];
      If not (doHardware in FDXDraw.Options) Then FDXDraw.Options := FDXDraw.Options + [doHardware];
      If not (do3D in FDXDraw.Options) Then FDXDraw.Options := FDXDraw.Options + [do3D];
      If not (doWaitVBlank in FDXDraw.Options) Then FDXDraw.Options := FDXDraw.Options + [doWaitVBlank];
    
      If (GD_FULLSCREEN) Then Begin
        If not (doFullScreen in FDXDraw.Options) Then FDXDraw.Options := FDXDraw.Options + [doFullScreen];
        TDXForm(FOwner).BorderStyle := bsNone;
      End Else Begin
        If (doFullScreen in FDXDraw.Options) Then FDXDraw.Options := FDXDraw.Options - [doFullScreen];
      End;
    
      // Initialize DXDraw
      FDXDraw.Initialize;
    
    
    // DESTROY
    
       // Finalise the DXDraw Control
       FDXDraw.Finalize;
       // Free the DXDraw Control
       FDXDraw.Free;
    That code certainly won't run if you just cut and paste, since there's a whole lot of custom variables, but you should be able to adapt it for your uses.

    Anoter thing to keep in mind (which has caught me out in the past) is that you need to change your form to type TDXForm.

    Code:
    Uses
      DXClass;
    
       TFormMain = class(TForm)
       change to:
       TFormMain = class(TDXForm)
    [/code]
    Always nearly there...

  7. #7

    Graphics in Turbo delphi

    You could also add the DelphiX-units to dclusr.dpk.

  8. #8

    Graphics in Turbo delphi

    Quote Originally Posted by 3_of_8
    You could also add the DelphiX-units to dclusr.dpk.
    I think they crippled that little trick in the latest versions and the update they made available after the initial release.

    However, as someone said, if you search around enough, I think there are a set of tools and tricks that will let you get around the limitation.

  9. #9
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Graphics in Turbo delphi

    You know, you're probably better off without the components anyhow.

    You'll learn more that way. And if you want to really grab people graphics card by the you-know-whats you'll need to go with a non-visual component based library anyhow. Even Asphyre is going the way of non-VCL based.
    Jason McMillen
    Pascal Game Development
    Co-Founder





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
  •