Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: DirectX and Turbo Delphi for .NET

  1. #11

    DirectX and Turbo Delphi for .NET

    Does the assembly come with the SDK?

  2. #12

    DirectX and Turbo Delphi for .NET

    It comes with both the SDK and the Runtime, as I mentioned earlier.
    If you have the latest SDK installed you should find a sub-directory named Managed, which contains all the C# DirectX examples.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  3. #13

    DirectX and Turbo Delphi for .NET

    Oh, very good And, is the assembly installed the same way components are installed in Delphi, or is there a specific option in the IDE to add them?

    Thanks!
    -Marco

  4. #14

    DirectX and Turbo Delphi for .NET

    When you have the project open, in the project manager you will see a folder called "References", right click on it and you should see an option called "Add Reference..." this should open up a dialog box that lists all the assemblies installed on your system. It may take a while to load them into the dialog. If you scroll down you should find quite a few there named "Microsoft.DirectX.*". Select the ones you want to refer to an in your code add the respective namespace to your unit and you are ready to go.

    To save you some time, I've managed to get the 6 Managed Tutorials working again. Download them from http://chrome.pascalgamedevelopment....s/DirectX9.zip

    Hopefully the project files should open in Turbo, if not open the .dpr file and it should create a Turbo compatible project. Have a look through the code and see how it all hangs together. If only the other 28 demos were as easy to get working it would show off stuff like particle systems and even Voice Over IP.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  5. #15

    DirectX and Turbo Delphi for .NET

    Wow, thanks! I'll try it at home.

    Regards!

  6. #16

    DirectX and Turbo Delphi for .NET

    You are in luck. Through the use of black magic and jiggery pokery most the samples now compile. The main exception being DirectInput and DirectPlay examples which seemed to be cause by the compiler and not my code ( honest :-) ).

    It's midnight here so I will try and zip them up and upload them tomorrow night.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  7. #17

    DirectX and Turbo Delphi for .NET

    Hey that's great news!

    Yesterday I ran the examples, and they work great. I was very excited, I thought I would have to learn C# to make managed DX applications.

    I see the syntax in Delphi for .NET haven't changed a lot (I'm using Delphi 7). Now there are some questions:

    1. What's the benefit of DX in Delphi .NET? Apart from being managed, which I understand as a memory safe execution, is it possible to make a Delphi .NET application run in the XBox?

    2. I tried to compile some of my classes, and got an error like "Language feature not available: 'destructor' ". But in the help they explain classes, and there appear the constructor and destructor! I'm confused about that. I understand .NET will release any object when it loses all it's references, but what can I do in the case I want to restore a given state after an object has been released?

    3. I see the Pointer type now is unsecure. There are several cases where I need to pass memory locations, and do type conversions. What's the best way to translate this code? Should I keep using Pointer and wrap it inside {$UNSAFECODE xxx} directives? Or should I use as many typed-pointers as possible?

    Also I plan to update my units for the .NET platform using conditional compilation, so I don't have to create two versions of the whole engine I'm building. Is the Turbo Delphi for .NET the only compiler with VER140 ? Or is Turbo Delphi (Win32) using that value too?

    Thanks!
    -Marco

  8. #18

    DirectX and Turbo Delphi for .NET

    I've just uploaded a new zip which overwrite the previous version. This one contains 17 demos :
    AudioVideo
    -------------
    Player - Plays movies
    Texture - Plays movies on a texture

    DirectDraw
    -------------
    SpriteAnimate

    Direct3D
    ----------
    AnimatedSprites
    Billboard
    Fractal
    Lighting
    PointSprites
    Text3D
    Tutorial 1-6

    DirectPlay
    ------------
    Tutorial 1

    DirectSound
    --------------
    EnumSoundDevices

    As it turns out, DirectSound also causes problems with the .NET compiler. So that leaves 16 demos that don't currently work.

    To answer your questions

    1. The Managed DirectX API is much much simpler than the normal one and the XNA one is even better! You need XNA to write games for the XBox 360 and you also need .NET 2.0 compliant compiler, which I think the Turbo versions are not yet. Highlander is .NET 2.0 compliant, but it is a real pain to use with XNA. Using Chrome is much easier and has been tested on Xbox 360. The down side of Managed code is that it is slightly slower than native code, but with multi-core system getting more and more cores, this won't matter much in the very near future.

    2. .NET is a different way to of writing your code/classes. If I were you I would read up on the difference between .NET and managed out and how it differs from Native coding. If an object has been released, typically you would re-create, but as long as you keep a reference to the object it will stick around in memory.

    3. Managed code hates pointer. That does not mean you can't use it, but it's considered unsafe and is therefore not recommended. Again I would suggest you read up on the difference between native and managed coding.

    4. I'm not sure how the Turbo versions are versioned , the best thing I can suggest is looking here - http://delphi.wikia.com/wiki/Borland...tional_Defines or posting on a CodeGear forum.

    Let me know if you have any problems with the demo.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  9. #19

    DirectX and Turbo Delphi for .NET

    Downloaded the new demos, I'll try them at home.

    Thanks for the recommendations, I'm following some guides to make my code safe. At the moment I haven't had many problem to convert my code, but there are two things that I don't know how to translate:

    1. What's the best way to replace an "absolute"?

    2. What's the best way to replace a string[1]? For example in: Move(data^, mystring[1], n);

    Thanks!

Page 2 of 2 FirstFirst 12

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
  •