Results 1 to 8 of 8

Thread: Professional Opinion

  1. #1

    Professional Opinion

    Please respond with your best opinion and possibly a reasoning on this situation.

    Would it be more efficient to use a DXTimer or a Procedure GameLoop(); in DelphiX for doing all the game stuff and rendering?

    Right now my game is using a DXTimer, and when you focus on a different window like internet explorer and go back to the game, the Timer is oddly stopped for some ungodly reason and I can't figure it out? Any suggestive additives to the above as well would bring forth much gradititude. Thanks alot!
    I have a 2005 CRF 250 so <^>(>&lt<^>
    <br />

  2. #2
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Randburg, South Africa

    Professional Opinion

    Since I have found out about GameLoop I dont use anything else.

    I find a GameLoop makes for better animations.

    To solve your problem try make the timer activate whenever the APPLICATION get activated (application.onActivate)
    William Cairns
    My Games: (Currently very inactive)
    MyOnline Games: (Currently very inactive)

  3. #3

    Professional Opinion

    I don't know if I qualify to give you a "professional opinion" since I'm not a professional game developer but here's what I think:

    If GameLoop() is an event handle for Application.OnIdle then don't use it. I know a lot of people use it but it's not a good idea. It might work fine in exclusive mode apps but in windowed mode apps there's too much going on to be able to truly predict how OnIdle is going to react. I remember releasing a game once that used App.OnIdle and it worked fine on all computers that I tested it on. Shortly after the release, I had received dozens of emails saying that the game freezes on start-up. I tested it on a few more computers and found one where I could reconstruct the bug. After I had replaced OnIdle with a real Timer it worked fine on all computers.

    I suggest that you use a thread-driven timer and I believe DXTimer is thread-driven.

    As for the focus-loss problem: You should handle the events Application.OnMinimize, Application.OnMaximize, Application.OnRestore, Application.OnActivate and Application.OnDeactivate (you will only need two event handlers). In Minimize/Deactivate, pause your timer, in Maximize/Restore/Activate re-start your timer. That should do the trick.
    Ask me about the xcess game development kit

  4. #4

    Professional Opinion

    Man, you were faster!
    Ask me about the xcess game development kit

  5. #5

    Professional Opinion

    Thanks for both of you're tips. I got the timer working for now. If it starts acting up again im going to switch to a GameLoop procedure. Anyway, TDXFonts is acting up for me. In a sample included in the DelphiX package, it shows how to type to the DXDraw using DXFonts, but now it's just erroring like heck, even the sample. Any known possibilities?
    I have a 2005 CRF 250 so &lt;^&gt;(&gt;&lt&lt;^&gt;
    <br />

  6. #6

    Professional Opinion

    You might want to post this into the DelphiX forum because the DelphiX pros might not find your post here. I don't know jack about DelphiX anymore
    Ask me about the xcess game development kit

  7. #7

    Professional Opinion

    Quote Originally Posted by Harry Hunt
    I suggest that you use a thread-driven timer and I believe DXTimer is thread-driven.
    Actually, DXTimer just uses Application.OnIdle.
    [size=10px][ Join us in #pgd on ] [ Sign the Petition for a Software Patent Free Europe ][/size]

  8. #8

    Professional Opinion

    that's good to know.
    Ask me about the xcess game development kit


Posting Permissions

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