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]
Bookmarks